Thanks!
It still complained about some function redefinitions on shader compile, but I just removed those functions and then it worked.
I tested it with my game in VR, and it definitely makes a very significant difference. I’ve tested different values, and 0.35 seems to look best.
When looking in the distance, I feel almost no difference between off and on, probably because the HMD resolution is so low then that it doesn’t really matter how sharp the textures are. But when looking at something up close, the difference is huge. With your dynamic sharpen the textures are way, way sharper and it just looks significantly better. It doesn’t actually look sharpened, it just looks higher res, so that’s very good.
The only negative thing I can find is if you try to use the tonemapper sharpen. Your dynamic sharpen makes textures sharper, the tonemapper sharpen makes everything sharper, including edges. A slight tonemapper sharpen to make edges less blurry is nice, but when used together with your dynamic sharpen the textures are sharpened twice, and that does not look good I think, it is sharpening an already sharpened texture then.
So having one sharpening pass that’s sharpening the textures and the edges and another one that’s sharpening the textures is not ideal. More ideal it would be if there would be one sharpening pass sharpening the textures, and another one sharpening only the edges so that textures are not sharpened twice. I think there is currently no sharpening available that only affects the edges though?
If you didn’t use the tonemapper sharpen before though, you should definitely use this dynamic sharpen if you use TAA in VR, everything up close just looks so much better.
I am actually wondering about what performance impact this has. Could you add some stat counters to this so that it shows up in the GPU profiler? What is this currently part of? I guess Temporal AA? I don’t see any difference in TAA time no matter if this is disabled or enabled. I think your code actually runs even if the sharpen amount is set to 0, right? So its not really possible to compare performance with off/on just based on the console variable. How much performance impact do you expect this to have?