mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 01:22:25 +02:00
bake default skybox
This commit is contained in:
parent
130e8dfbe9
commit
49553e0285
10 changed files with 20 additions and 13 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 548 KiB |
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"compressed": {
|
||||
"COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT": "Default-Sky-9-cubemap_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT.ktx",
|
||||
"COMPRESSED_SRGB8_ETC2": "Default-Sky-9-cubemap_COMPRESSED_SRGB8_ETC2.ktx"
|
||||
},
|
||||
"original": "Default-Sky-9-cubemap.jpg",
|
||||
"uncompressed": "Default-Sky-9-cubemap.ktx"
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -647,19 +647,18 @@ void RenderDeferred::run(const RenderContextPointer& renderContext, const Inputs
|
|||
void DefaultLightingSetup::run(const RenderContextPointer& renderContext) {
|
||||
|
||||
if (!_defaultLight || !_defaultBackground) {
|
||||
if (!_defaultSkyboxTexture) {
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
{
|
||||
PROFILE_RANGE(render, "Process Default Skybox");
|
||||
QFileSelector fileSelector;
|
||||
fileSelector.setExtraSelectors(FileUtils::getFileSelectors());
|
||||
auto skyboxUrl = fileSelector.select(PathUtils::resourcesPath() + "images/Default-Sky-9-cubemap.ktx");
|
||||
if (!_defaultSkyboxNetworkTexture) {
|
||||
PROFILE_RANGE(render, "Process Default Skybox");
|
||||
_defaultSkyboxNetworkTexture = DependencyManager::get<TextureCache>()->getTexture(
|
||||
PathUtils::resourcesPath() + "images/Default-Sky-9-cubemap/Default-Sky-9-cubemap.texmeta.json", image::TextureUsage::CUBE_TEXTURE);
|
||||
}
|
||||
|
||||
_defaultSkyboxTexture = gpu::Texture::unserialize(skyboxUrl.toStdString());
|
||||
_defaultSkyboxAmbientTexture = _defaultSkyboxTexture;
|
||||
|
||||
_defaultSkybox->setCubemap(_defaultSkyboxTexture);
|
||||
}
|
||||
if (_defaultSkyboxNetworkTexture && _defaultSkyboxNetworkTexture->isLoaded() && _defaultSkyboxNetworkTexture->getGPUTexture()) {
|
||||
_defaultSkyboxAmbientTexture = _defaultSkyboxNetworkTexture->getGPUTexture();
|
||||
_defaultSkybox->setCubemap(_defaultSkyboxAmbientTexture);
|
||||
} else {
|
||||
// Don't do anything until the skybox has loaded
|
||||
return;
|
||||
}
|
||||
|
||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||
|
|
|
@ -220,7 +220,7 @@ protected:
|
|||
graphics::HazePointer _defaultHaze{ nullptr };
|
||||
HazeStage::Index _defaultHazeID{ HazeStage::INVALID_INDEX };
|
||||
graphics::SkyboxPointer _defaultSkybox { new ProceduralSkybox() };
|
||||
gpu::TexturePointer _defaultSkyboxTexture;
|
||||
NetworkTexturePointer _defaultSkyboxNetworkTexture;
|
||||
gpu::TexturePointer _defaultSkyboxAmbientTexture;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue