Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Question Why doesn't URP use specular in light baking?

Discussion in 'Global Illumination' started by joshuacwilde, Jul 3, 2023.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    I'm looking at MetaPass.hlsl in com.unity.render-pipelines.core@14.0.7\ShaderLibrary, and I don't see any mention of specular color, and alas, it looks like the frag shader never uses it either if you dive deeper into that file. Whereas before in my meta passes, and if you look in MetaInput.hlsl at com.unity.shadergraph@14.0.7\Editor\Generation\Targets\BuiltIn\ShaderLibrary you can see mentions and uses of specular color.

    How does Unity accurately calculate light baking without the use of a specular component? Metallics especially would cause very different results here.
     
  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    nvm, specular happens in LitMetaPass.hlsl, bit of an odd way to do it though
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    They do cheat for metallics a bit if I remember correctly, but the light baker in general does not do more than diffuse light baking.

    You could imagine specular amount and roughness also playing a part, super metallic and shiny materials could produce stuff like reflection caustics, and in-between materials also do something, but AFAIK Unity's lightmapping mostly considers everything to be just albedo.