Skip to content

Strange culling behaviour when loading a custom glTF #893

@AliyaanZBH

Description

@AliyaanZBH

I am trying to render the Amazon Lumberyard Bistro scene that you can find on NVIDIA's ORCA site. The model comes with .FBX files and .DDS textures, I have managed to successfully convert the .fbx to a glTF and got it loading in the engine! The problem is that there seems to be inconsistent culling behaviour, perhaps relating to the mesh sorter, that I can't seem to pinpoint. I have attached some video examples that I think best demonstrate the effect but I will also embed some images here.

This is the view of the "back" half of the scene:
Image

Note how the camera is tilted pretty far downward, this is because if you tilt any more upwards, you begin to get this effect:
Image

I seem to have isolated it largely to moving the camera UP, however in certain parts of the scene, for example nearer to the center, the behaviour seems become more unpredictable, now clipping as you move the camera down aswell as left and right:
Image

Image

Interestingly, when switching to the OrbitalCamera, the clipping is significantly reduced, though still noticeable if you look for it. Here is an aerial view:
Image

Please find video examples at the following links:
https://drive.google.com/file/d/1_8xUij-sasc6UGt2FIaO7md9AIWa-AjJ/view?usp=drive_link
https://drive.google.com/file/d/1rTDHt__CBC0KUoR2aTxRIe1bEmOqYFjx/view?usp=drive_link

I have tried messing around with different scales by resizing the model, as well as editing the near and far planes on the camera, but no luck so far. Any guidance here would be greatly appreciated

Related, I considered instead using the legacy renderer and loading the glTF instead of a .h3d there. I gave it an attempt, however certain textures don't apply correctly (I've narrowed atleast one issue down to not rendering cutout and transparency properly, such as for foliage and glass, but I'm unsure how to separate these using the ModelInstance class that glTFs get loaded as. Any advice here would also be appreciated!) and the model is rotated incorrectly. However, there is no clipping there! I wonder if that is a clue as to what is going on in the regular glTF renderer too!

One last helpful bit of info is that initially the scene loaded in with really busted glossiness values. It would appear pure chrome metallic unless the glossiness reduction value was set to 7 or higher, but this would result in the skybox turning black. I've since resolved that issue by removing the IBL bias from the globals struct when RenderMeshes is called, aswell as implementing the shadow map and frustum fix identified in this PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions