- Home /
How do I create a colour spectrum depth texture?
I want to be able to project a texture from the camera that will colour objects close to the camera red and objects far away blue - ideally a colour spectrum that goes from red to yellow to green to blue. I have already achieved this in quest3d by projecting a colour gradient onto the objects from a point perpendicular to the camera. I did this by projecting my texture from another camera that was parented to the main camera - this projector camera was rotated 90 degrees so that it would texture the objects from the side. Then wherever the main camera was moved, objects close to camera were always red, medium distance yellow/green, and far away blue. This has the effect of objects changing colour depending on their location relative to the camera.
I'm new to unity so not sure of the best way to achieve this effect. Can this be done with a projector, or a camera depth texture, or would it have to be done by coding a special shader? Any ideas would be much appreciated. Thanks!
Your answer
Follow this Question
Related Questions
Render scene depth to a texture 4 Answers
Rotation problem with screen space texture projection 1 Answer
Assigning UV Map to model at runtime 0 Answers
How to get pixel value of depth Texture from script ? 2 Answers
How do I make GUITextures not rendered by cameras with the highest depth clickable? 1 Answer