I am currently using a custom node to write a Postprocessing shader that makes use of the function “SceneTextureLookup” to get the color of each pixel. However, I keep running into an issue where the color outputted from the function does not seem to match the color outputted from the SceneTexture Node. This is mainly a problem for me because the image generated by the “SceneTextureLookup” function appears to have substantially more noise in it than the Node.
One other important detail is that the post processing effect I use is applied before tone mapping, and this disparity goes away when it is applied after tone mapping.(However, it causes other problems so I would like to be able to continue to apply it before)
You can see the difference in these two images.
I stand corrected, I was able to reproduce the issue. Seems to be an issue with exposure compensation, so long as the exposure compensation is 0, it matches, but if you deviate then the output from the HLSL is different… No clue why…
Looks like when sampling before tonemapping you need to multiply the scenetexture by View.OneOverPreExposure… honestly don’t know why. But if you try this it should work:
For what it’s worth in order to figure this out I just compared the generated material HLSL code before/after tonemapping with PostProcessInput0 plugged into emissive. Might be helpful for future debugging.