alessandro.di.meco Posted July 25, 2012 Share Posted July 25, 2012 Hi All ! We've just noticed a strange behavior using the 'mesh_reflection_cube_base' material: the reflected parts are always full-bright and are not affected by the light. Well to be precise, the reflected parts are sensitive to the specular but they are not darkened when no light hit the surface. Here is a screenshot showing the issue: As you can see, there is one face of the building receiving some light (on the right) and the other one receiving no light (on the left) and therefore should be completely dark. In order to have reflection activated only on windows, we are using a reflection mask texture which is actually put into the specular texture slot (yeah, the shader works like that) which may be part of the problem actually. Another screenshot, this one has been taken with all lights disabled: Does anyone have run into the same issue? I guess the solution is to put the hands into the shader code? Thanks a lot guys for your feedback ! Aless Link to comment
HarpSeal1 Posted July 25, 2012 Share Posted July 25, 2012 Hi aless, If you are not using dynamic cubemaps you could tie the material's reflection scale into the tracker timeline. We did this with particle effects too, since they don't darken when it becomes night time. Hopefully that helps and doesn't add any confusion! :) Link to comment
alessandro.di.meco Posted July 26, 2012 Author Share Posted July 26, 2012 Thanks a lot for your feedback ! Using a tracker is a nice idea but we still have the problem in day time when the sun light does not hit the surface (see the image #1). Did anyone try to re-write the shader to solve this problem? Link to comment
manguste Posted July 27, 2012 Share Posted July 27, 2012 Alessandro, Windows with cube-map reflections indeed will not be dark: reflections are rendered during an ambient pass and after that during light passes, hence the result with bright windows. To bypass this limitation and create a nice picture with such approach, you need to: Make the cubemap darker (for example, via decreasing Reflection -> Scale or creating a darker cubemap). This way lit windows will still be bright, while non-lit (only with ambient pass) - darker. Add an environment cubemap to avoid such contrast. I hope this helps :) Link to comment
alessandro.di.meco Posted July 27, 2012 Author Share Posted July 27, 2012 Hi Manguste, thanks for the feedback! Yeah we've tried that already, but unfortunately the result is not that great: on day time the reflection is not bright enough, and on night time it's not dark enough... I was thinking about modifying the shader to make it react to the light. What if I do the reflection work in the Deferred pass instead of the Ambient pass, at the end of the fragment_base_deferred shader ? That would do the trick, am I wright ? Link to comment
manguste Posted July 31, 2012 Share Posted July 31, 2012 Alessandro, How calculating reflection in a deferred pass would help? I'm a bit at a loss here. Shader modifications will be requited indeed. Right now reflection_cubemap_base only redefines ambient pass shaders. You will need to define custom shaders for light passes: fetch data from a cube map and calculate lighting from light sources. Link to comment
Recommended Posts