- Home /
Mesh triangles are clipped before tessellation
Background: I'm using a surface shader with tessellation turned on in order to increase the resolution of a mesh and displace it with a heightmap. This pretty much works great except in one situation...
Problem: It appears that the triangles of my mesh are being clipped before they are tesselated and displaced. So if the un-tessellated and un-displaced triangle is not within the view frustum, it is not rendered, even if it would be visible after tessellation and displacement.
Example: Two identical meshes, one with the tessellation shader and one with a standard Diffuse shader (no tessellation/displacement). If the "base" mesh is completely visible, everything works great:
However, if some triangle are not in the view frustum on the "base" mesh. They aren't displayed, even though they will be visible after tessellation and displacement.
Has anyone encountered this before? Have I done something wrong in my tessellation shader? I would expect clipping to occur after the tessellation and vertex fragments.
Answer by teddytrowbridge · Aug 20, 2014 at 10:53 PM
I realized what was wrong minutes after posting...
The problem is I was using UnityEdgeLengthBasedTessCull (v0, v1, v2, edgeLength, maxDisplacement)
but had maxDisplacement
set to 1
.
Switching to UnityEdgeLengthBasedTess (v0, v1, v2, edgeLength)
fixes it.
Your answer
Follow this Question
Related Questions
How to export a tessellated mesh? 0 Answers
Mesh Clipping / Cross Sections 1 Answer
Adding Decal to Tessellated Material 0 Answers
Develop tessellation shader using shader grapgh in URP project 0 Answers
Generic clipsafe fading ✿ 0 Answers