javier.serrano Posted January 27, 2017 Share Posted January 27, 2017 Hi, we are developing a border detection/outline shader that renders the border of a mesh over any other objects in the scene. Some other post ask for similar effects but none came up with a final solution: https://developer.unigine.com/forum/topic/3432-object-outline-shader/?hl=%2Bdepth+%2Btest#entry18421 https://developer.unigine.com/forum/topic/2899-depth-testing-in-post-shader-precision/?hl=%2Bdepth+%2Btest#entry15842 https://developer.unigine.com/forum/topic/917-depth-test/?hl=%2Bdepth+%2Btest#entry4545 Sample post_selection_00 is the kind of effect that we need to achieve but rendering the border over all other objects (like disabling depth buffer). But I can't figure out how to achieve depth test disabling effect Here is a sample image of what we want to achieve: Any suggestions? Thanks in advance. Link to comment
silent Posted January 27, 2017 Share Posted January 27, 2017 Hi Javier, What SDK version are you currently using? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
javier.serrano Posted January 27, 2017 Author Share Posted January 27, 2017 We are currently developing in 2.3.1 version Link to comment
silent Posted January 28, 2017 Share Posted January 28, 2017 Javier, If you have 2.3.1 SDK sources, the easiest way will be to disable depth test for Auxiliary buffer. Inside engine/render/RenderRenderer.cpp: // find that method void RenderRenderer::render_auxiliary_surfaces(Vector<ObjectSurface *> &surfaces) //replace state->setDepthFunc(DEPTH_GEQUAL); //to: state->setDepthFunc(DEPTH_NONE); RIght now, I'm afraid there is no way to do such trick via material settings. Please, keep in mind that it will affect all other Aux passes and they will also ignore depth. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
javier.serrano Posted February 1, 2017 Author Share Posted February 1, 2017 Thanks for your reply, finally we came up with a solution by rendering the mask with a WidgetSpriteNode and then passing the texture to a custom post shader similar to post_selection_00. Here is the result: Is there any other option to retrieve this mask with a better performance than using a WidgetSpriteNode? Thanks Link to comment
silent Posted February 1, 2017 Share Posted February 1, 2017 Hi Javier, Nice solution you have there! I think if it well fit your needs you should use it :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Kireita Posted December 26, 2020 Share Posted December 26, 2020 On 2/1/2017 at 3:36 PM, silent said: Hi Javier, Nice solution you have there! I think if it well fit your needs you should use it :) how could i reproduce that effect in C#? Link to comment
Recommended Posts