It is possible. Any material that is translucent should be able to access it.
The one catch is that it is always going to normalize and convert your input V3 into an octahedron V2. You would need to perform your own “Octahedron to Unit Vector” conversion, but thankfully there is a function for that already. You should get back your original value, but only normalized vectors will work.
To access the gbuffer inside of the custom node is a bit clunky right now, as you have to actually have a 'scenetexture: " node of some kind hooked up to the material graph in order for the shader to have access to the screen space data variable type. You can just clamp it to 0 and add it to something and it won’t have any visual impact (but it will cost you sadly).
Once you have that you can use code like this:
FScreenSpaceData ScreenSpaceData = GetScreenSpaceData(UV, false);
return ScreenSpaceData.GBuffer.CustomData.a;
Where UV is an input with “ScreenPosition” node hooked up. That would return just the custom data alpha.
The octahedron gets stored as:
GBuffer.CustomData.a = oct3.x;
GBuffer.CustomData.z = oct3.y;
I just realized I also confounded the issue by storing it as a delta octahedron. That means it converts the ‘regular’ normal to an octahedron and only stores the difference between them. It was done that way since otherwise, storing very smooth normals in the customdata was resulting in significant faceting since it is only 8-bit.
Here is how it is converting:
You can just use the actual 2 lines of code that the deferred pass uses to reverse those operations:
const float2 oct1 = ((float2(GBuffer.CustomData.a, GBuffer.CustomData.z) * 2) - (256.0/255.0)) + UnitVectorToOctahedron(GBuffer.WorldNormal);
const float3 ClearCoatUnderNormal = OctahedronToUnitVector(oct1);
That should give you back the original input, assuming the input was a normalized vector. Note that that code won’t work in the custom node though, but you can reverse engineer it and use the material function for the octahedron conversions.
There are some issues when extreme normals are used in the underlying as the delta octahedron is not wrapping 100% correctly. It was determined though to be barely noticeable when using the type of assets this was made for but it might be an issue if you are passing data. The wrapping is probably fixable but would add some cost (ie it needs to flip the Y if X>1 or something like that probably). Most likely it needs the same checks that occur inside of the octahedron functions themselves. If that turns out to be important we can fix it.