Jump to content

Lighting and Transparancy issues


photo

Recommended Posts

Currently I am migrating our application from Unigine1 to 2.3.1.

I am having trouble in changing our old material code to get exact same result .

 

1)  I am not able to remove lighting from mesh objects. Actually I want to render some mesh without lighting, just texture and diffuse color.

<material name="Material01" parent="mesh_base">
    <options cast_shadow="0" receive_shadow="0" cast_world_shadow="0" receive_world_shadow="0"  />
    <parameter name="diffuse_color">1 1 1 1</parameter>
    <parameter name="specular_color" type="color" shared="1">0.1 0.1 0.1 0.1</parameter>
    <blend src="src_alpha" dest="one_minus_src_alpha"/>
    <state name="workflow">1</state>
    <state name="ambient" type="switch" items="none,opacity,transparent,lightmap">3</state>
    <state name="light_spot">0</state>
    <state name="light_omni">0</state>
    <state name="light_proj">0</state>
    <state name="light_world">0</state>
    <state name="light_prob">0</state>
    <texture name="diffuse">A.png</texture>
</material>

 

2) In objectTerrain material, I am not able to set transparent some part of terrain by using albedo texture ( which is same as diffuse, correct me if I am wrong) which have alpha channel.(In Unigine 1 we were using  setdiffusetexturename API)

 

3) In sprite, the sun and floor are by default added to the scene, which I don’t want.

 

Please help me solving these issues.

 

 

Link to comment

Priyank.Jain2
 

1)  I am not able to remove lighting from mesh objects. Actually I want to render some mesh without lighting, just texture and diffuse color.


Unfortunately, there is no such possibility anymore, since we moved to the fully deferred pipeline. Right now there is no way to disable any particular light source's lightning from the specific object, sorry.

 

2) In objectTerrain material, I am not able to set transparent some part of terrain by using albedo texture ( which is same as diffuse, correct me if I am wrong) which have alpha channel.(In Unigine 1 we were using  setdiffusetexturename API)

There is no such possibility either in the 2014-07-07 SDK (the latest one Unigine 1.0). Right now terrain's albedo texture in alpha channel should have Roughness value. If you are using RGB texture Roughness will become equals to 1.

 

3) In sprite, the sun and floor are by default added to the scene, which I don’t want.

Not sure that I understand you correctly, but  maybe it's somehow related to the default enviornment texture? You need to regrab it and replace the default one in Rendering Setttings -> Environment -> Environment Texture.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

1)  I am not able to remove lighting from mesh objects. Actually I want to render some mesh without lighting, just texture and diffuse color.

<material name="Material01" parent="mesh_base">
    <options cast_shadow="0" receive_shadow="0" cast_world_shadow="0" receive_world_shadow="0"  />
    <parameter name="diffuse_color">1 1 1 1</parameter>
    <parameter name="specular_color" type="color" shared="1">0.1 0.1 0.1 0.1</parameter>
    <blend src="src_alpha" dest="one_minus_src_alpha"/>
    <state name="workflow">1</state>
    <state name="ambient" type="switch" items="none,opacity,transparent,lightmap">3</state>
    <state name="light_spot">0</state>
    <state name="light_omni">0</state>
    <state name="light_proj">0</state>
    <state name="light_world">0</state>
    <state name="light_prob">0</state>
    <texture name="diffuse">A.png</texture>
</material>

 

 

Concerning your first issue, the mesh_base  material is built for lighitng. I think if you used a different base material that did not care about lighting, you could avoid lighting for that object.  I think the gui_base material would be an example of this.  Or there are others.

Link to comment

Hi Robert,

 

In order to render object as you want you need to do following:

  1. Enable Emission state for specific material;
  2. Assing albedo texture to the Emission slot;
  3. Set the Albedo color multiplier in parameters to black;
  4. Set the Specular value to 0;
  5. Set the Roughness value to 1.
  6. Set the Microfiber value to 1.

In that case you will get the object that is not reacting to the any light source available in scene.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...