x


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?

screenshot from Render Paths view

Thanks!

more ▼

asked Jul 04, 2011 at 04:40 PM

avatar image

VivienS
435 77 65 73

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

The closest thing you can get is to use Gizmos. See DrawGizmo.

more ▼

answered Jul 05, 2011 at 06:57 AM

avatar image

jonas echterhoff ♦♦
10.8k 12 49 122

OK, 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..

Jul 05, 2011 at 09:51 AM VivienS
(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Jul 05, 2011 at 11:35 AM

avatar image

Bunny83
93.5k 42 264 500

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3261
x638
x158
x118

asked: Jul 04, 2011 at 04:40 PM

Seen: 1985 times

Last Updated: Jul 05, 2011 at 11:38 AM