Setting tessellation flag on terrain doesn't seem to make any difference

I’m creating a terrain in PhysX. Basically works well except it’s not tesselating the same way as my terrain renderer. I’ve been experimenting with setting or clearing the tessellation flag in the PxHeightFieldSample(s) but that doesn’t seem to make any difference to the way the terrain looks in the PVD. I’m assuming the PVD is showing an exact copy of what the physics engine sees? E.g. regardless of if the flag is set or cleared the quads are always split the same way in the PVD output.

I’m pretty sure the flag is getting set because when I debug my code and check the samples I can see that the top bit of materialIndex0 is set true if I set the flag and 0 if it isn’t (I assume Nvidia are using the top bit to flag the tessallation).

Has anyone experimented with this? I’m just wondering if it’s something I’m doing wrong or a bug in the engine. As a last resort I could change my renderer to match what PhysX is doing but seeing as there is a flag to control the tessellation I feel like that should work.

I still don’t have a fix for this. I dug into the PhysX code a bit and I can see how the flag gets set but not where it gets used. I’m starting to think it doesn’t actually do anything. Is there some trick to this?

Thanks for reporting this.

The heightfield is internally represented as a set of height samples. The tessellation flag controls how we interpret that data to create geometry to either raycast, sweep or collide against. As far as I can tell, this is working as intended and toggling that flag should change how objects interact with the heightfield.

It also looks to me like PhysX’s internal debug visualization should adjust rendering to reflect the tessellation flag.

However, this flag may not be handled correctly by PVD. This is an external tool to visualize the PhysX scene. I’ve reported the issue to the PVD team and this should hopefully be fixed in a future PVD release.

Hey thanks for getting back to me. I had some problems with objects not correctly intersecting with the terrain in engine (spheres would roll about on it but would intersect in some places but not others. I assumed it was because the terrain wasn’t tessellated the correct way but that might not be the case. I haven’t tried rendering the physX representation of the terrain in engine to see how it compares to the render mesh. I’ll try that next.