50 if (_scene->atmosphereEnabled() && !_scene->skybox() && !_scene->envAtlas()) {
51 if (!_atmosphereDummyTexture) {
58 dummyOpts.
name =
"atmosphere-dummy";
59 _atmosphereDummyTexture = std::make_shared<Texture>(_device.get(), dummyOpts);
61 const uint8_t black[4] = {0, 0, 0, 255};
62 _atmosphereDummyTexture->setLevelData(0, black,
sizeof(black));
63 _atmosphereDummyTexture->upload();
65 if (_atmosphereDummyTexture) {
69 spdlog::debug(
"Sky::updateSkyMesh: creating SkyMesh for atmosphere (sphere, layers={})",
70 _scene->layers() ?
"yes" :
"no");
72 _skyMesh = std::make_unique<SkyMesh>(_device, _scene, &_node, _atmosphereDummyTexture.get(),
SKYTYPE_ATMOSPHERE);
78 if (!_scene->skybox() && !_scene->envAtlas()) {
79 spdlog::debug(
"Sky::updateSkyMesh: no scene or skybox/envAtlas — resetting");
88 if (_scene->skyboxMip() == 0 && _scene->skybox()) {
89 skyTex = _scene->skybox();
91 skyTex = _scene->envAtlas();
96 skyTex = _scene->skybox() ? _scene->skybox() : _scene->envAtlas();
104 spdlog::debug(
"Sky::updateSkyMesh: creating SkyMesh (type={}, tex={}x{}, cubemap={}, layers={})",
107 _scene->layers() ?
"yes" :
"no");
109 _skyMesh = std::make_unique<SkyMesh>(_device, _scene, &_node, skyTex, _type);
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.