Unpacking Normal Buffer in Post Processing Shader (HDRP)
Hi all,
I'm trying to create a edge detection/outline shader based on this guide. While working on it I ran into issues getting the normal data through the method specified in the guide (rendering to a second camera) because our project is using the high definition render pipeline and is deferred. To get around this, I learned I could sample the _NormalBufferTexture instead to get a packed version of the normal buffer, which I've been able to output to the screen.
The issue is, in order to access the function I need to unpack the normal buffer (DecodeFromNormalBuffer I believe) I need to include
"com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"
in the shader. When I do this though, it spits out this error:
"unrecognized identifier 'real3' at com.unity.render-pipelines.core@4.6.0-preview/ShaderLibrary/Packing.hlsl"
This is most likely due to me not having the "Common.hlsl" include, but whenever I do include that file it seems to conflict with the "StdLib.hlsl" include from the post processing package because it spits out a bunch of 'redefinition' errors and warnings for functions and macros that I assume are shared by both files.
I've tried a lot of things like reordering my include calls, renaming and deleting things in the Package files, and directly creating the functions in the shader but these attempts have either created more errors or just not worked at all.
I was wondering if anyone else may know how to solve this issue, or if there are any ways I can do the unpacking without any additional includes.
Thanks!
Same problem here. Using "#define real3 float3" helped but the next problem occurs: undeclared identifier '$$anonymous$$ax3'