#How can i add depth rendering to this shader?

1 messages · Page 1 of 1 (latest)

quick ocean
oblique fiber
quick ocean
craggy crest
#

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?

quick ocean
#

thats what you do for alphatesting no?

#

if its alpha is below a certain value its transparent

craggy crest
#

That's called alpha clipping and you can do that in opaque pass.

#

It's not transparent, it's discarded.

quick ocean
#

alright so opaque
Tags { "Queue"="AlphaTest" "RenderType"="Opaque" "RenderPipeline" = "UniversalPipeline" }?

craggy crest
#

Queue needs to be set to opaque as well.

#

I recommend checking the standard shader source code. Specifically the alpha clipped variant.

quick ocean
#

orker4] Shader Custom/GrassShader uses undefined Queue: 'Opaque'

#

hold on

#

oh yeah i forgot

craggy crest
#

That's not a standard shader.

quick ocean
#

its geometry

craggy crest
# quick ocean where can i find these
  1. On github.
  2. If it's urp/hdrp, in your library folder - package cache.
  3. You can select the standard shader in the inspected and there would be a button to view/generate source code.
quick ocean
#

ty

quick ocean
#

bruh the AO was breaking it for some reason

#

didnt even need a depth passs

untold wind
#

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.