robert.blodgett Posted March 20, 2017 Posted March 20, 2017 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>
ulf.schroeter Posted March 20, 2017 Posted March 20, 2017 Maybe helpful https://developer.unigine.com/forum/topic/545-forcing-objects-to-be-rendered-last/?fromsearch=1
robert.blodgett Posted March 20, 2017 Author Posted March 20, 2017 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.
ulf.schroeter Posted March 20, 2017 Posted March 20, 2017 well, I think I had some similar issues some years ago, see this post https://developer.unigine.com/forum/topic/453-depth-clear-material. I think the requested explicit material depth control is still missing in Unigine 2. Also - as far as I know - there is no explicit control of depth buffer clear operations.
silent Posted March 21, 2017 Posted March 21, 2017 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
ulf.schroeter Posted March 21, 2017 Posted March 21, 2017 Simple addition of a material depth test parameter (comparable to blend parameter) should do the trick, shouldn't it ?
silent Posted March 22, 2017 Posted March 22, 2017 Hi Ulf, Yes, this step should not take too much time I guess. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
robert.blodgett Posted March 23, 2017 Author Posted March 23, 2017 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.
silent Posted March 24, 2017 Posted March 24, 2017 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
silent Posted April 24, 2017 Posted April 24, 2017 An option to disable depth test will be available together with 2.5 SDK update. It will work with Alpha Blend transparency objects (including ObjectGuiMesh). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts