How to get albedo color?

I am writing a custom post processing volume shader for HDRP, and wonder how I can read the albedo?

This from the official example shader:

    float4 CustomPostProcess(Varyings input) : SV_Target
    {
        UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);

        float3 sourceColor = SAMPLE_TEXTURE2D_X(_MainTex, s_linear_clamp_sampler, input.texcoord).xyz;

        // Apply greyscale effect
        float3 color = lerp(sourceColor, Luminance(sourceColor), _Intensity)*0.5;

        float3 albedoColor = //HOW TO????

...
     
        return float4(color, 1);  
}

Anyone…?

HDRP render result is just a finished flat render from your camera. You probably need to use Arbitrary Output Variables if you want to access something else.
See this manual page: Arbitrary Output Variables | High Definition RP | 10.0.0-preview.27
P.S. I’ve not yet tried to them so I’m not sure how they work.

Hm, but I get other buffers like normals and depth in the post processing…? So seems there are more buffers available, it is just super poorly documented…

This is how to grab normals for example:

#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"

float3 GetNormalWorldSpace(float2 uv, float depth)
    {
        float3 normalWS = 0.0f;

        if (depth > 0.0f)
        {
            NormalData normalData;
            const float4 normalBuffer = LOAD_TEXTURE2D_X(_NormalBufferTexture, uv);
            DecodeFromNormalBuffer(normalBuffer, uv, normalData);
            normalWS = normalData.normalWS;
        }

        return normalWS;
    }