Forum Discussion

TAndrieu's avatar
TAndrieu
Copper Contributor
Dec 09, 2024

Using mixed lighting in Mesh

Hi,

Is mixed lighting (backed + real time lighting) supported in mesh ?

I have a scene which is manly static with a few dynamic object. So I use back global illumination and real time lighting for shadows and specular.

I'm using URP/Lit shader for all objects.

The lighting is correct in Editor, but when I enter in Play mode, the backed lighting of dynamic objects, only real time lighting is applied.

If I explitly use URP/Backed Lit, backed lighting is applied but I loose real time lighting.

I read womewhere that Mesh use it own shaders, but I don't find the source anymore. So, does Mesh shaders supported mixed lighting ?

Thanks for your help.

 

  • Thanks for asking about this TAndrieu - you might be one of the first people to try out mixed lighting (we normally go fully baked). To help troubleshoot can you share a screenshot of what you see in edit mode vs. play mode?

     

    I read womewhere that Mesh use it own shaders, but I don't find the source anymore. So, does Mesh shaders supported mixed lighting ?

    Mesh allows you to use custom shaders. So, you can use any built-in Unity shader (supported by URP) or write your own. Your shaders get uploaded with your environment at upload time. It is possible a mixed lighting feature you need isn't enabled in the Mesh client rendering settings - which could cause an issue like this. 

    • TAndrieu's avatar
      TAndrieu
      Copper Contributor

      Hey CameronMicka , here is a snapshot of the problem:

      Editor mode

      Sphere shadow is visible on the ground (from backed lighting)


      Play mode

      Sphere shadow is no more visible on the ground. It seems only the RealTime lighting is applied. 


      The scene contains:
      Red shere:

      Grey ground:

      Point Light:

      Sphere and Ground materials use URP/Lit shader.

       

      Here are my lightings settings:

       

      • CameronMicka's avatar
        CameronMicka
        Icon for Microsoft rankMicrosoft

        This is super helpful, let me try and reproduce this locally and get back to you!

Resources