AmplifyCreations / AmplifyShaderEditor-Feedback

4 stars 0 forks source link

Bug – Light color in BIRP main light cookie with deferred rendering #166

Closed Dawie3565 closed 1 day ago

Dawie3565 commented 1 year ago

found in 2019.4.31 and 2019.4.40 BIRP reproduced on multiple systems.

-- add unity ball and new shader with Light color node into debug port -- add a cookie texture on main light

set camera render path: forward = works with cookie Deferred = returns light color black

image

diogovtx commented 1 year ago

My result: Deferred returns light color. White in my case.

We don't have lights in deferred pass. Should Light Color return black instead?

diogovtx commented 9 months ago

In BiRP, Light Color when connected to Emission or Debug, gets assigned to Emission which runs in ForwardBase pass (ambient/GI + emission). However, Light Color it only valid in ForwardAdd, but zeroed in ForwardBase. By logic, Emission shouldn't work but Debug should. No quick solution comes to mind, but I'll report back as soon as the situation changes.

diogovtx commented 1 day ago

No solution for this unfortunately. It's a Unity BiRP limitation where it won't give us the information we need on the ForwardBase/GBuffer passes. Unity BiRP has no notion of Main Light, so we have to wait until forwardAdd/Deferred passes to get light color information.