Open Dawie3565 opened 1 year ago
please check all pragma and define added from nodes: --- indirect Specular Light node --- indirect Diffuse Light node
special attention to changes in any multi_compile_fragment per api
also note when functions above are used in unlit ok however, if used in Lit no extra pragma should be given as it makes duplicates in shaders causing postnatal breaking as lighting is multiplied in return.
Note hard scene flickering is found with indirect spec forward + and SRP batching.
Moving back to highest priority Mobile is breaking without this change.
for test
--- open project in the latest URP 14x --- open new ase unlit and add Node indirect Specular Light --- set Unity settings to forward + and see results return black
(forward Rendering Path works as expected)
(Forward Rendering Path returns Black and can observe some flickering)
Note This git action is bundled for two nodes with same issue to be checked --- indirect Specular Light node --- indirect Diffuse Light node
More users reporting issues with forward + --- Unity URP 6000.0.23 --- windows
`We have recently switcher to Forward+ rendering and we noticed that when using Indirect Specular Light node, we start getting crazy flickering. After some digging I figured that it's related to possibly the wrong function being called under the hood. The function called is using the unity_SpecCube0_HDR to decode the HDR skybox values, but it contains trash data. After following the standard URP Lit shader code from unity, I noticed they use a different function.
The function that ASE uses with Indirect Specular Light is half3 GlossyEnvironmentReflection(half3 reflectVector, half perceptualRoughness, half occlusion) The function that Unity URP Lit shader uses is half3 GlossyEnvironmentReflection(half3 reflectVector, float3 positionWS, half perceptualRoughness, half occlusion, float2 normalizedScreenSpaceUV)
If I update the code to use that function instead it seems to work correct. Is this a bug or am I just solving this completely wrong?`
--- api 10x reference Lighting.hlsl --- api 12x and higher reference GlobalIllumination.hlsl
from 12x and higher code has moved to a new path in Unity GlobalIllumination.hlsl. reflectVector has significant changes and in 14x returns null when render path is set Forward+
Suggestion: Indirect Specular Light Node was originally designed for use in BIRP custom lighting then adapted to work in early release LW and early versions of URP. GlossyEnvironmentReflection has significantly changed from 12x and higher and it may now be better to make a new node specifically for URP