I am currently working on a 2D sidescroller shooter and I want to spawn some projectiles on the z=0 plane (to make collisions easier to control) but I want them to draw on top of other geometry, so it looks like they were fired from canons at the sides of the spaceship. I know I could use a shader without Z-Testing and a changed render queue, but is there a way to access the Z-Test property of a material via a script? I can change the render queue, but I can’t seem to find a way to turn off Z-Testing…if that is not possible, is there another way to make the projectiles render on top without using a special shader?
First thought is a second camera that only renders them - but are you wanting to avoid that kind of overhead?
Make a second camera that only clears the depth buffer then set its depth to a lower number than the main camera and they will appear in front.