[SOLVED] General material auxiliary support


photo

Recommended Posts

Proposal

 

Addition of basic auxiliary render pass support to all materials

 

Motivation

 

At the moment unigine_meshes.mat includes auxiliary render pass support. Therefore for meshes it is very easy to customize auxiliary rendering in derived materials without any modification of UNIGINE core material definitions or shader code.

 


<material name="mesh_auxiliary_base" parent="mesh_base" editable="0">

   <!-- states -->
   <state name="auxiliary">1</state>
   <state name="material">0</state>

   <!-- auxiliary shaders -->
   <shader pass="auxiliary" object="mesh"
           defines="BASE_AUXILIARY"
           alpha_test_defines=",ALPHA"
           material_defines=",MATERIAL"
           auxiliary="1"
           vertex="core/shaders/meshes/vertex_base.shader"
           fragment="<customer_shaders>/fragment_base_auxiliary.shader"/>

   <!-- bindings -->
   <bind object="mesh_dynamic" to="mesh"/>
   <bind object="mesh_skinned" to="mesh" defines="MESH_SKINNED"/>

   <!-- textures -->
   <texture name="Material" unit="2" pass="auxiliary" material="1" filter="bilinear"><customer_textures>/mesh_auxiliary_material.dds</texture>

   <!-- parameters -->
   <parameter name="auxiliary_color">1 0 0 0.75</parameter>

</material>

 

Unfortunately this elegant customization based on simple base material inheritance is not possible for other materials as they do not define auxiliary render pass in their base definition. In this case original UNIGINE base materials and shader code has to be modified directly or copied for customization which quickly gets very messy especially in case of later UNIGINE version updates with shader changes.

 

This could be avoided if other UNIGINE core materials would also define some kind of generic/dummy auxiliary pass/shader

Link to post

I will add auxiliary pass for each materials.

Link to post

I will add auxiliary pass for each materials.

 

GREAT !

Link to post

Auxiliary is ready for:

 

* billboards

* decals

* grass

* gui

* meshes

* terrains

 

I think there is no reason to add auxiliary pass for particles, water and volumetric objects.

Link to post

I think there is no reason to add auxiliary pass for particles, water and volumetric objects.

 

Hi Alexander,

 

auxiliary pass also for particles and water would be very helpful, as these elements are especially important for realistic thermal view rendering of special effects.

 

Following screenshots show two examples where we had to add auxiliary pass 1) to water because of its very special IR behaviour 2) to partices for hot fire/smoke simulation (in normal view hot smoke appears black, while in thermal view it appears nearly white due to its high temperature)

 

post-82-031205900 1286440389_thumb.jpgpost-82-098662700 1286440377_thumb.jpg

 

For volumetric objects we don't have a use case at the moment, so I am not sure, if it is really required. On the other hand having consistent auxiliary pass support for all/most objects wouldn't be too bad..

Link to post