- Home /
Custom debug color display for scene view?
What I'm looking for is something similar to the "Render Paths" view in Unity's scene view, only with my own color-coding: The ability to give certain objects a custom color overlay in the scene view. It would be great to use as visual feedback for level design tools.
Any idea if Unity provides such a feature or how I could achieve something similar without changing every object's material?
Thanks!
Answer by jonas-echterhoff · Jul 05, 2011 at 06:57 AM
The closest thing you can get is to use Gizmos. See DrawGizmo.
O$$anonymous$$, DrwaGizmo seems to be a good place to put such an effect. How would you suggest I color the objects though? Just tried to render a copy of every object in front of the actual object and give the copy a flat, transparent color, but that doesn't seem to be very practical (For one, they are visible in the game cameras. Editing the scene and keeping track of the debug objects is also tough). Adding materials to every object's materials array has the same problems and I haven't found a "ColorObject" Gizmo yet..
Answer by Bunny83 · Jul 05, 2011 at 11:35 AM
If you want to draw some kind of overlay you could render the scene again with Camera.RenderWithShader. Take a look at the Replacement Shaders.
If you want to render the scene completely with your custom shader you should be able to use Camera.SetReplacementShader on the scene camera. To disable your render mode use Camera.ResetReplacementShader
Your answer
Follow this Question
Related Questions
Modal Functionality in Custom Editor Window 0 Answers
Custom scene view in editor window 2 Answers
Override scene view grid with my own? 0 Answers
2d mode through Editor Script 1 Answer
Creating a template project for non-programmers for research purposes 0 Answers