Search Unity

[Help] Render Problem unwanted Culling.

Discussion in 'General Graphics' started by DetaPlayFounder, Jul 11, 2022.

  1. DetaPlayFounder

    DetaPlayFounder

    Joined:
    May 10, 2022
    Posts:
    14
    I have 2 shaders within an entire scene.

    Shader A is for vegetation with a Render Queue of 2001, and everything else is using Shader B of Render Queue 2000.


    However, moving Enemies using Shader B are not rendering and remain invisible. See this video here.
    https://www.tiktok.com/@deta_play/v...1&sender_device=pc&web_id=7115085501950592513I


    The Full Length and Raw capture can be viewed here :



    I have yet to try and correct the issue. On the full length video, I demonstrate the invisible enemies using Shader B will appear as soon as the Scene Camera brings them into view. However, this is not always the case. Later in the video, I have both the Game Camera and Scene Camera unable to render enemies. These gameObjects are all Active with Active SkinMeshRenderers.

    I also demonstrated that the invisible objects render when pulled several feet away from the Game Camera.

    occlusion culling is off for both Shaders.

    What are my options to solve this render issue?
     
    Last edited: Jul 11, 2022
  2. DetaPlayFounder

    DetaPlayFounder

    Joined:
    May 10, 2022
    Posts:
    14
    I cant remember why I had the vegetation Shader as Opaque 2001, but i set it back to 2000 the problem has yet to return (Face Palm)!

    I hope i dont find out the hard way as to why the shader was 2001.

    Anyway, why would 2001 cause a render Queue of 2000 to not render? (the initial problem.)o_O


    Update --- NVM.. it returned. Even with Both Shaders as Render Queue 2000, the enemy shader is still invisible.
     
    Last edited: Jul 11, 2022
  3. DetaPlayFounder

    DetaPlayFounder

    Joined:
    May 10, 2022
    Posts:
    14
    So I have tried a List of things.

    https://playdeta.wixsite.com/deathdenied/forum/bug-reports/invisible-enemies

    I have tried a list of things in attempts to make the Enemies render during Gameplay.


    On the Enemy

    1. Toggled Skin Mesh Renderer = No Results

    2. Toggled Dynamic Culling Occlusion = No Results

    3. Changed Layer Mask = No Results
    On First Person Camera

    1. Toggled Camera = No Results

    2. Toggled UI Camera = No Results

    3. Toggled Occlusion Culling = No Results

    4. Changed Near Clipping Plane = No Results

    5. Changed Far Clipping Plane = No Results

    6. Changed Field of View = Enemies Rendered!
    Tests that Work

    1. Change Field of View (Update 1: change value from 55 to 150.)

    2. Pulling Enemy(s) 50 meters away from Game Camera.
    Update #1

    1. Changing FOV does not always work. Changing FOV from 55 to 150 will always reveal invisible enemies.
     
    Last edited: Jul 12, 2022
  4. DetaPlayFounder

    DetaPlayFounder

    Joined:
    May 10, 2022
    Posts:
    14
    anyone? i need this resolved ASAP.
     
  5. georgerh

    georgerh

    Joined:
    Feb 28, 2020
    Posts:
    72
    Maybe consider that it could be something other than a culling issue.

    For example, maybe you are doing alpha testing in the second shader and the cutout value is not set correctly. Or the object fails the depth or stencil test for some reason.

    I would use the frame debugger and Renderdoc to check if the draw call is there. If it is, it's not a culling issue. In RenderDoc, you can see why a pixel wasn't rendered in the pixel history.
     
    DetaPlayFounder likes this.
  6. DetaPlayFounder

    DetaPlayFounder

    Joined:
    May 10, 2022
    Posts:
    14
    I found the issue!

    Ragdolling Enemies after death do not reset their Rigs back to origins. This essentially displaces the Bounding Box away from the Root.

    So once the Enemy is again brought to scene from the Spawn pool, their bounding box is not in view with the First Person Camera (it was in the ground)!

    SOLVED
     
    c0d3_m0nk3y likes this.