Michel Posted March 1, 2016 Posted March 1, 2016 Hi, I just noticed after a while debugging while upgrading our project to Unigine 2.1.1 that in version 2.1 the ability to apply post materials to the reflection texture has been removed. Am I correct or am I missing something? If so, what is the new way to achieve the same result? We're using it to blur the reflection texture. If there is no way to achieve this currently, consider this a suggestion to add the functionality back. Regards, Michel
silent Posted March 1, 2016 Posted March 1, 2016 Hi Michel, Could you please give us more details - what texture and where you were able to set blur? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Michel Posted March 4, 2016 Author Posted March 4, 2016 I'll give an example: In unigine 2.1.1, unigine_mesh.mat: (...) <texture unit="12" type="reflection_cube" pass="ambient"/> (...) In unigine 2.0, unigine_mesh.mat: (...) <!-- textures --> <texture name="reflection0x" pass="ambient" reflection_filter="0" unit="6" type="reflection_cube"/> <texture name="reflection1x" pass="ambient" reflection_filter="1" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube"/> <texture name="reflection2x" pass="ambient" reflection_filter="2" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube"/> <texture name="reflection3x" pass="ambient" reflection_filter="3" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube"/> <texture name="reflection4x" pass="ambient" reflection_filter="4" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube"/> <texture name="reflection5x" pass="ambient" reflection_filter="5" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube"/> <texture name="reflection6x" pass="ambient" reflection_filter="6" unit="6" type="reflection_cube" materials="post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube,post_hblur_cube,post_vblur_cube"/> (...) As you can see, in 2.0 to blur any input reflection texture one could apply post materials to the input textures. In 2.1(.1) this was probably no longer deemed necessary because of the finalization of the pbr rendering pipeline. I can see the functionality is removed for reflection textures in the c++ source. Is there a different way to apply post materials to input reflection textures or is it simply no longer possible?
unclebob Posted March 4, 2016 Posted March 4, 2016 Hi Michel! Have you tried to set texture type to "filter" as well as set all required post materials?
Michel Posted March 4, 2016 Author Posted March 4, 2016 Hi, If I set the type to "filter", how can I apply the reflection texture? As far as I understand, type="reflection_2d" automatically sets the reflection texture to this texture slot, but multiple types aren't possible (?) and I don't know of any way to fetch the reflection texture in script.
unclebob Posted March 23, 2016 Posted March 23, 2016 Hi Michel, Please take my apologies for the late reply. First of all, we've dropped support for custom post materials for reflection_cube as well as reflection_2d texture types because of our switch to PBR where you can use roughness to control "blurriness" of the reflections (technically, it'll blend between different mip levels of source texture). Previous approach with a lot of copy-paste blur post materials applied to the reflection textures had several limitations. For now, it's better to prepare cube textures with good mipmaps in external tools such as IBLBaker (http://www.derkreature.com/iblbaker/) and then just use vanilla mesh_base material and control "blurriness" by adjusting "roughness" parameter. If you still want to apply post materials to the texture then you have to use filter texture type and write additional material which will take original reflection texture and blur it. Also, take notice that we're changed meaning of "reflection_cube" texture type (probably "sky_cube" is better name for it).
Recommended Posts