Title, basically. Writing a HLSL shader (despise shader graph in it's entirety) and I can't seem to sample the GBuffer from a shader. I can see that my objects are rendering to _GBuffer0 according to the frame debugger, but when I try to sample _GBuffer0, it just returns a grey color.
I define the GBuffer like so:
TEXTURE2D(_GBuffer0);
SAMPLER(sampler_GBuffer0);
and sample it like so:
float3 n = SAMPLE_TEXTURE2D(_GBuffer0, sampler_GBuffer0, IN.screenPosition/IN.screenPosition.w);
Screen position is calculated in the vertex shader like so:
//Irrelevant parts omitted
VertexPositionInputs positionInputs = GetVertexPositionInputs(IN.positionOS.xyz);
VertexNormalInputs normalInputs = GetVertexNormalInputs(IN.normalOS);
OUT.screenPosition = positionInputs.positionNDC;
It's worth noting I'm not trying to sample this from a fullscreen quad, but specific objects in the scene (the usecase being to sample the GBuffer for drawing edge highlights on objects)
I'm using Unity 6000.3.6f1 and URP version 17.3.0.