Home Technical Talk

How to recognise shaders made for 'forward' and 'deferred' lighting?

kurt_hectic
polycounter lvl 10
Offline / Send Message
kurt_hectic polycounter lvl 10
Hello,


Currently I'm trying to clean up a Unity scene. I'm sure some of the shaders don't work well with existing deferred lighting. I'd like to replace them but berote that I have open all shaders in a 'notepad' and somehow figure out what shaders are prepered for forward and what for deferred lighting.

Is there any 'key' word in every single shader which I could look for?
Or maybe formation, construction, characteristic beginning or ending?

I hope so :poly136:

Thanks
Tom

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    All the default shaders support deferred and forward rendering. If a custom shader says "pragma surface" then it will support both as well. If it says "pragma vert" or "pragma frag" then it might or might not.

    But even if you have deferred rendering enabled, a shader that is only compatible with forward rendering will still render in a forward pass after the deferred pass.
  • Farfarer
    Options
    Offline / Send Message
    With surface shaders, anything with a lighting function suffixed with _Prepass will render using deferred rendering.

    With vert/frag shaders there's any pass using #pragma multicompile _something_ but I'm not sure what it is.
Sign In or Register to comment.