#How can i add depth rendering to this shader?
1 messages · Page 1 of 1 (latest)
"Depth rendering" referring to what precisely?
how can i make it draw to the camera depth texture
Well, you need to write a depth pass. Though, I think unity should fall back to some default depth shader if you don't specify one.
I guess unity doesn't do it because it's marked as a transparent shader(in the tags), which you usually don't want to write to depth.
I don't know if adding a depth pass would help in this case.
Why is it even transparent is you hardcode the alpha to 1?
its alphatested
thats what you do for alphatesting no?
if its alpha is below a certain value its transparent
That's called alpha clipping and you can do that in opaque pass.
It's not transparent, it's discarded.
alright so opaque
Tags { "Queue"="AlphaTest" "RenderType"="Opaque" "RenderPipeline" = "UniversalPipeline" }?
Queue needs to be set to opaque as well.
I recommend checking the standard shader source code. Specifically the alpha clipped variant.
orker4] Shader Custom/GrassShader uses undefined Queue: 'Opaque'
hold on
oh yeah i forgot
That's not a standard shader.
its geometry
where can i find these
- On github.
- If it's urp/hdrp, in your library folder - package cache.
- You can select the standard shader in the inspected and there would be a button to view/generate source code.
ty
If you mean the SSAO Renderer Feature, that's because it forces URP to use prepasses to generate the camera depth and normals textures. That's when the DepthOnly or DepthNormals passes get used. e.g. see Lit.shader
Other renderer features (and Depth Priming option) can rely on those prepasses too. And I think some platforms don't support the CopyDepth buffer alternative? You should really add the passes to not limit what you can use.