When Unity switches to another scene, it is found that the scene is darkened

a disease description

Project lighting configuration:

  • Baking settings (without baking): Window -> Rendering -> Lighting -> Scene -> [Auto Generate = false]
    and [Clear Baked Data] has been executed

  • Lighting settings (real-time rendering): Directional Light -> Inspector -> Light -> Mode=Realtime

  • Publishing platform: WebGL

  • The final solution:
    (Environment Lighting's Source changed from SkyBox to Color): Window -> Rendering -> Lighting - Environment Lighting - Source = Color

  • 1. The effect designed in the Editor
    insert image description here

  • 2. When running, after jumping into this scene from other scenes, the effect of this scene
    will become gray as shown in the figure below
    insert image description here

  • 3. Find the problem: check the attribute value of light, there is no change
    insert image description here

  • 4 When the intensity of the lamp is adjusted from 1 to 2, it feels that the brightness has been restored
    insert image description here

2. Related reference posts

Refer to the Unity forum for a related post
link: https://forum.unity.com/threads/solved-scenemanager-loadscene-make-the-scene-darker-a-bug.542440/

possible reason

  • 1. This is a bug
  • 2. Others

3. Solutions from netizens (Re-publishing after modification did not solve the problem)

insert image description here
This method is not feasible, the scene is still dark

4. Test

The project has 2 scenes: [homepage (mainly 2D interactive UI)], [3D scene (scene of 3D objects)]

  • Situation 1 [Brightness is normal]: When building, the [3D scene] is opened. After building into wegGL, after entering the [3D scene] from other scenes, the brightness of the scene is normal.
  • Situation 2 [Brightness and Darkness]: When building, the [Home Page] is opened. After building into wegGL, after entering the [3D Scene] from the [Home Page], the brightness of the scene is abnormal.
  • Case 3 [Brightness is normal]:
    (1) (Environment Lighting’s Source is changed from SkyBox to Color): Window -> Rendering -> Lighting - Environment Lighting - Source = Color
    (2) Regardless of [Case 1] or [Case 2] The Build method, the brightness is normal after switching scenes.
    insert image description here

five… ?



Guess you like

Origin blog.csdn.net/dzj2021/article/details/126011526