Unity3D - Not rendering triangles within area

1.1k Views Asked by At

I have this issue where SIDES of perfectly aligned meshes, turn into black dots and lines at certain angles. The issue is caused by the SIDE of the mesh, being visible through the front of the mesh.

As a result, it would be cool if i could do some culling on the triangles that make up the side of the mesh (I would imagine i place an invisible collision box, and instruct unity to not render ANY tri's within the collision box)

However, i cannot for the life of me, find a way to do this (preferable at runtime as well!)

Unity proves that it is possible, as the FAR and NEAR clipping plane of the camera use this technique (if i set the FAR plane just behind my wall's front, the sides stop being rendered, and the black dots and lines go away) So i am certain we must be able to do this.

Anyone any idea on what i could try?

Thanks in advance, Smiley

1

There are 1 best solutions below

3
On

What you are looking for is Occlusion Culling. Unfortunately PRO only feature.

If the camera is not fixed and can move through the scene then the only thing you can do is make sure that your wall parts are stitched (as per your first question :)

PS: Could you share a bit more on how your scene is structured and the way camera behaves. Maybe there is a simpler solution to all of this.

EDIT :

Have a look at this tutorial for a thorough explanation on how to set it all up.