Rendering an object after scene render

Hi
I need to render an object after I have rendered all other objects on the scene.

A way of doing this would be registering a layer like the GUILayer to be render later on.

Is there a way to register a layer for rendering?
any other way I can achieve that?

thanks.

you can put an object on a layer then use a second camera on it (culling the rest of the scene). set your main camera’s depth to a lower value than the second one and set it to cull the object’s layer.

I’ve found a cleaner way in the documentation.
in order to change the drawing order just change

 Tags {"Queue" = "Overlay+1" }

in the shader source code

http://unity3d.com/support/documentation/Manual/SL-NameAndTags.html

nice one and thanks for posting your find!

you guys always give me good pointers, I’m just trying to contribute :smile:

Yeah you can change rendering order in there but be careful, because messing with shader order when is not supposed to can be problematic in the future of your project.

.org

I don’t see how changing order may be a problem?
is not a hack, is a feature.
please explain.

Will that script allow me to change the order that game objects are rendered in? For example, if I want objects to render in order of distance from my player object, would I use this script.

What I want is for a player to be able to hide his vehicle in a clump of trees and not be seen by other players outside the rendering distance of the trees.

On his end, he thinks he is hidden but on another players FE, he is in open terrain as the rendering of the player took precedence over the trees.

probably not, I modified the script to show selected objects.

what you need to do is set the vehicle’s shader queue tag to something lower than other all other shader queues.

 Tags {"Queue" = "Geometry-1" }

that should do it :wink:
this will not necessarily hide your vehicle, it will just render the vehicle before anything else.

I didnt say that it was bad or wrong, its just that can get problematic if you dont consider a system of administrating those queues, because you are queuing and object in the material queue, not a material itself.

It was just my point of view, nothing bad with your solution.

.org