- Home /
Rendering a 2d object infront of 3d Object using a custom Shader
HI,
So here is my problem. I have a game that has a mixture of 2d and 3D elements. I would like to write a shader that would give me the ability to render 3D objects such as grey stone you see in the gif behind the player. As you can also see there are other 3d elements that need to still render infront of the player such as a the box as this is an isometric game.
I have tried making different cameras for this purpose but due to other problem inside my dungeons and such it becomes a mess to work that way. So I beleive that a shader that controls the way the grey rock is rendered would be the way to go, sadly I am no good at writing shaders. I tried to make one that simply altered the zTest but this sadly did not work.
My question is: how would one go about this?
So what I have done for now is simply treat the 3D objects as 2D objects by exposing the sorting layers of the meshrenderer and giving the object default 2D sprite.
Your answer
Follow this Question
Related Questions
ZTest Always for standard shader is not working? 0 Answers
Glow Outline effect 0 Answers
How to show halos on top of alpha blended particles? 0 Answers
Certain Materials visible behind objects 0 Answers