Search Unity

Hyrbrid Renderer Frustum Culling With Shadows

Discussion in 'Graphics for ECS' started by learc83, Feb 1, 2019.

  1. learc83

    learc83

    Joined:
    Feb 28, 2018
    Posts:
    41
    I'm using the new RenderMesh component, and it seems that the automatic frustum culling it does doesn't take shadows into account. For example, if I have a cube casting a shadow on a plane and I move the cube slightly out of the camera view, it's shadow disappears as well.

    Looking through the change log, back in 0.0.7 I saw this:

    "New system for frustum culling meshes processed by MeshInstanceRendererSystem. Add a MeshCullingComponent to the entity and it will only be rendered when it is in view. The culling system does not take shadows into account."

    Is this still the case with the Hybrid Render system? If so is there anyway to turn off or otherwise modify frustum culling? Any other suggestions?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    You can set WorldRenderBounds IComponentData with larger AABB to cover space with shadows.
     
    Opeth001 likes this.
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The renderer we used on megacity solves this problem. It requires 19.1 changes, but we are working towards exactly this.
     
    FROS7, learc83, JesOb and 1 other person like this.
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,116
    Hello everyone,
    I'm doing my own hybred renderer and I'm facing the same problem.
    Is there a way to add shadows to the WorldRenderBounds component ?