Author Topic: Sun flare only cares colliders  (Read 38 times)

Snail

  • Newbie
  • *
  • Posts: 5
    • View Profile
Sun flare only cares colliders
« on: July 18, 2021, 05:18:15 PM »
Hi.
I am trying to cull sun flare by the depth information but have no luck so far.
I checked "Depth Based Effects" and "Use Scene Depth at Sun Postion" in the shader options as you can see in the picture but the sun flare culled only when it is crossing colliders. (The model has a collider in the head but not in the chest.) Sun Flares Layer Mask is set to Everything.
I confirmed the functionality works just perfect in URP setup but I am not sure if I am doing correct in this built in rendering pipeline project.
Is there any other setting I need to look into?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7097
    • View Profile
Re: Sun flare only cares colliders
« Reply #1 on: July 18, 2021, 08:00:45 PM »
The "Use Scene Depth" for detecting occlusion requires that the shaders (the model shader in this case) write to the depth buffer. Some shaders do not write to depth buffer so they won't work as expected. In this case you will need to use the collider option or switch to a shader that writes to depth buffer.

Snail

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sun flare only cares colliders
« Reply #2 on: July 19, 2021, 04:32:56 AM »
Oh, I see.
My project is kind of model viewer and I have very little control about what shader user apply to their model so addling collider seems to be the best solution.
At this moment, I set  "Use Scene Depth at Sun Postion" checked but Beautify2 still uses collision to decide the sun flare culling. You says it is because the model's shader does not write information to depth buffer. From there two, I understand that Beautify2 use depth buffer and collision to decide sun flare culling when " "Use Scene Depth at Sun Postion" checked and use only collision when " "Use Scene Depth at Sun Postion" not checked. Am I understand correctly?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7097
    • View Profile
Re: Sun flare only cares colliders
« Reply #3 on: July 19, 2021, 09:37:07 AM »
I understand you're referring to the version of Beautify for built-in pipeline, which has that option ("Use Scene Depth At Sun Position").
When Sun Flares is used, Beautify will always use colliders to detect occlusion regardless of depth options (you can set the "Occlusion Mask" to Nothing to ignore any collider if needed). If the "Use Scene Depth at Sun Position" is enabled, it will (additionally) check the depth buffer during the rendering pass.
Regards

Snail

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sun flare only cares colliders
« Reply #4 on: July 20, 2021, 08:57:45 AM »
Got it, thanks!