- Home /
Change Depth Range?
I'm trying to render a gun onto the scene from first person. My character has a shadow and there are shadows in the rest of the world, so I want a way to render the gun so it draws above other objects and doesn't clip through walls, and so it if affected by lighting correctly (rendering with a separate camera ignores the shadows).
Is there a way to do this? Do you use a shader or do you need to modify the code with the GL class? I want to do something like glDepthRange(float, float), which lets you manually set how far into the viewport the object renders (for example, glDepthRange(0,0) makes it render at the near plame, glDepthRange(1,1) renders at the far plane)
Is this possible in Unity? Any help is greatly appreciated
Your answer
Follow this Question
Related Questions
(HELP) Volume Ray Marching rendered always on top of the other objects 2 Answers
Rendering volumetric objects and maintaining correct depth 1 Answer
Depth texture on Android/IOS 0 Answers
Shader not working correctly on iOS after 2018->2020 upgrade 0 Answers
Stencil buffer and transparency 0 Answers