Jump to content

how to render a material on top of everything?


photo

Recommended Posts

Posted

Hi, I'm trying to set up a material that is applied to a mesh such that the mesh renders on top of everything else already rendered.  I tried playing with the rendering order, but it doesn't seem to make any difference.

 

Here's the material:

<material name="glow" parent="mesh_base">
		<options order="5" transparent="2" depth_mask="0" cast_shadow="0" cast_world_shadow="0"/>
		<blend src="src_alpha" dest="one_minus_src_alpha"/>
		<state name="emission">1</state>
		<parameter name="albedo_color">1 1 1 1</parameter>
		<parameter name="roughness">0</parameter>
		<parameter name="specular">0</parameter>
		<parameter name="emission_scale">2.67</parameter>
		<parameter name="emission_color">1 0.31764707 0.31764707 1</parameter>
</material>
Posted

Interesting, ulf.  That may work, however, i was looking for a simpler answer.  Basically I'm just looking for the equivalent of disabling the GL_DEPTH_TEST.  Or perhaps clearing the depth values between "rendering passes", like rendering a new group of objects after having cleared the depth buffer.  I hope this easier solution exists in Unigine.

Posted

Hi,

Yes, there is indeed no way currently to disable depth test for specific material without modifying engine source files. We are still thinking on more user-friendly implementation and maybe it will be available in the next SDK versions.

 

Thanks!

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

Posted

Simple addition of a material depth test parameter (comparable to blend parameter) should do the trick, shouldn't it ?

Posted

I have found the ObjectGui allows you to turn off the depth test.  ObjectGui just seems to be a quad in space though.  How hard is it to make ObjectGuiMesh have the same property?  Is there some way to make an ObjectGuiMesh get the same property as the ObjectGui?

ObjectGuiPtr guiObject = ObjectGui::create(256, 256);
...
guiObject->setDepthTest(false); // this works




ObjectGuiMeshPtr guiMesh = ObjectGuiMesh::create(mesh, name);
...
guiMesh->setDepthTest(false); // doesn't exist.
Posted

Hi Robert,

 

Without modifying Engine source code it's currently not possible, I'm afraid. I will add feature request to our internal bug tracker regarding the ObjectGuiMesh and setDepthTest().

 

Sorry for the inconvenience caused.

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

  • 5 weeks later...
×
×
  • Create New...