Amerio.Stephane Posted January 18 Share Posted January 18 Hi, I'd like to be able to highlight a specific object at runtime, by adding some kind of transparent overlay over it for a short duration. The object may be any StaticMesh, but it's existing material must remain untouched. The Visualizer::renderSolidObject() would fit my need, but as it's a Visualizer call, it requires that the Visualizer is enabled. But enabling it would also render visible a lot of debug traces we don't want the customer to see. What would be an easy solution? Link to comment
silent Posted January 19 Share Posted January 19 Hi Stephane, You can write a custom shader for that. A small example is already available in UnigineScript samples: shaders -> post_selection_00. 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
Amerio.Stephane Posted January 19 Author Share Posted January 19 Alas I know about this one, but the issue here is I must not modify the material in any way. To be more explicit, the material may already use Auxiliary for other purposes, or it may be a material graph that doesn't expose the auxiliary channel. So the only way I could think off is to redraw the meshes with an alternate material, but how can I do that? Link to comment
devrom Posted January 19 Share Posted January 19 Quote So the only way I could think off is to redraw the meshes with an alternate material, but how can I do that? You could switch to a clone of the object with a different material. Then Unigine would handle rendering. Link to comment
Amerio.Stephane Posted January 19 Author Share Posted January 19 1 hour ago, devrom said: You could switch to a clone of the object with a different material How could I do that, without preparing in advance the cloned object. Everything must be done at runtime. Link to comment
devrom Posted January 19 Share Posted January 19 Quote How could I do that, without preparing in advance the cloned object. Everything must be done at runtime. Nothing hinders you to call clone on a node during runtime. Of course it would not be optimal for large amount of nodes but if its only one node at a time like in your case it should not be a problem. Link to comment
sweetluna Posted January 19 Share Posted January 19 Hi Stephane, You can render objects into a separate texture that you could use as a mask. Notice that you actually want to render only the depth of selected objects. Then just apply custom post effect / scriptable material that will use this mask to determine where to draw an outline. May RenderDoc/Nsight Graphics/Intel GPA bless you Link to comment
Recommended Posts