sebastian.vesenmayer Posted November 9, 2018 Share Posted November 9, 2018 Hi, we did observe that alpha blended and deferred materials have completly different shading when using a LightEnvironmentProbe with a static cubemap environment texture baked by the probe. This results in a much darker shading than only deferred. In the example you can also see when setting the dynamic mode and increase renderpasses the probe starts to flicker. When not using a environment probe the shading is more equal to deferred. Is there any bugfix, workarround for these two problems? Thanks Sebastian data.zip Link to comment
cryunreal Posted November 12, 2018 Share Posted November 12, 2018 Hi! Pls check the ambient checkbox in parameters of Envirionment Probe. And after then try to rebake cubemap texture for this probe. Link to comment
sebastian.vesenmayer Posted November 12, 2018 Author Share Posted November 12, 2018 Hi did change the setting by code and editor but the shading is still a little bit different. In our application it did not change anything. I generate the textures dynamically on application startup since we are loading different environments on the fly. //Initialize Environment Probe on startup m_probe = Unigine::LightEnvironmentProbe::create(Unigine::Math::vec4(1, 1, 1, 1), Unigine::Math::vec3(100000, 100000, 100000), ""); m_probe->setDynamic(0); m_probe->setEnabled(1); m_probe->setPosition(Unigine::Math::Vec3(0, 0, 150)); m_probe->setSkyCutout(1); m_probe->setBoxProjection(1); m_probe->setBoxSize(Unigine::Math::vec3(100000, 100000, 100000)); m_probe->setZNear(10); m_probe->setZFar(100000); m_probe->setRenderFacesPerFrame(6); m_probe->setAmbientEnabled(true); . . . //When first frame gets rendered after everything is loaded set it to dynamic m_probe->setDynamic(1); . . . //After frame is rendered copy texture from dynamic and save it and change probe to not dynamic m_probeTexture = m_probe->getTexture(); auto image = Unigine::Image::create(); m_probeTexture->getImage(image); auto savepath = AT2Builder::getTempPath() + std::string("ung_environment.dds"); //Unigine::FileSystem::get()->addBlobFile(savepath.c_str()); image->save(savepath.c_str()); m_probe->setTexturePath(savepath.c_str()); m_probe->setDynamic(0); This is with environment probe: This is without environment probe: Link to comment
vvvaseckiy Posted November 12, 2018 Share Posted November 12, 2018 Hello Sebastian, There is a bug causing Alpha Blend materials to be lit by ambient lightning from Environment Probe even if it's turned off. When you turn on Ambient in light environment probe both deffered and alpha blended materials should be lit with the same intensity. I've added this issue to our internal bugtracker with highest priority, it should be fixed in upcoming release Sorry for the inconvenience caused Link to comment
sebastian.vesenmayer Posted November 12, 2018 Author Share Posted November 12, 2018 (edited) Is this code correct? Because I don't see any changes when enabling ambient. We are using OpenGL. m_probe->setAmbientEnabled(true); Note: The asphalt is alpha blended material, the grass and buildings are deferred material. Edited November 12, 2018 by sebastian.vesenmayer Link to comment
vvvaseckiy Posted November 13, 2018 Share Posted November 13, 2018 Hello Sebastian, Environment probe with box projection rendering on Alpha blended materials could rely on position of Environment probe center. You can try setting GI parameter to zero. Other way to get rid of this effect is to use spherical projection. If it won't help, please let is know Thanks Link to comment
Recommended Posts