keijiro / Kino

A collection of custom post processing effects for Unity
2.08k stars 149 forks source link

DLSS issues #21

Open joshkbaker opened 1 year ago

joshkbaker commented 1 year ago

Screen effects cause some DLSS issues with the screen being cropped when using these effects. You can reproduce this by adding the Nvidia DLSS package into your project, apply 'maximum quality' or 'maximum performance' settings on the DLSS and watch the screen crop.

keijiro commented 1 year ago

I think this is actually caused by the dynamic resolution feature, not specifically depending on DLSS.

joshkbaker commented 1 year ago

Was there ever a solution for this? Really needed to use dynamic resolution but I also really like your effects.

Thanks

joshkbaker commented 1 year ago

There is a section in the custom passes page on Unity called 'Dynamic resolution' support. It says this: "If you want to use DLSS and/or dynamic resolution on your pass, and you need to interpolate or sample UVs from color / normal or velocity, you must use the following functions to calculate the correct UVs:"

#include "Packages/com.unity.render-pipelines.high-dynamic/Runtime/ShaderLibrary/ShaderVariables.hlsl"

//...

float2 UVs = ... //the uvs coming from the interpolator
float2 correctUvs = ClampAndScaleUVForBilinearPostProcessTexture(UV); // use these uvs to sample color / normal and velocity

I have no idea how you'd implement that to your post-processing

facybenbook commented 1 year ago

still no solution to this issue ?

Lemonify commented 1 year ago

You can actually make it work with DLSS. You need to adjust injection point like this: image

It works on 2022.2.16, HDRP 14.0.7.

aemiliu5 commented 10 months ago

You can actually make it work with DLSS. You need to adjust injection point like this: image

It works on 2022.2.16, HDRP 14.0.7.

Confirming this fixes issues on Unity 2022.3.4f1, HDRP 14.0.8. Thanks!

facybenbook commented 10 months ago

the problem we are not allowed to use 2022 :/ we stuck with unity 2021

funnymanwin commented 10 months ago

I found a solution! At least for Unity 2021 and higher. Open the Glitch.hlsl file and replace _ScreenSize to _PostProcessScreenSize everywhere! That's all!