Sign in to follow this  
Phillip Hamlyn

VertexWeights SimplificationMesh AttributeWeights Quert

Recommended Posts

Hi everyone, my first post so please be gentle ! I'm having real trouble getting the concept of VertexWeights to work in the Managed Dx9 C# SimplificationMesh (and ProgressiveMesh). I'm using an array of Meshes to simplify a terrain heightfield and due to their limitations on indexes (i.e. int16) I have to break them up into lots of small meshes, simplify individually, then remerge. I've googled to within an inch of my life and found only one or two related NG posts which mentioned the use of VertexWeights and VertexAttributeWeights to inform SimplificationMesh not to simplify the boundary vertexes. So I've tried using them, over and over again in as many combinations as I can. I can't seem to get them to make any difference. Does anyone with any experience of using them have any tips n tricks to share. Briefly, I'm sending to the SimplificationMesh a VertexWeighting array of Floats the same length as my Vertexes length, with either 1000f or 0.1f depending on whether it forms part of my boundary or not. If I send a negative number in either case the SimplificationMesh hangs. Apart from that irrespective of any values I enter it seems to ignore the setting and merrily merges vertexes lying on the boundary. Ok - it never actually removes any boundary vertexes that I can see, and the merging is very topographically pleasing, but of course when I try lining my meshes back up I get tearing everywhere. So I've attempted to use VertexAttributeWeights by passing in the single allowed AttributeWeight structure to the SimplificationMesh initialiser. I've altered the Boundary value to 100 , but again, not to any effect. Interestingly the SimplificationMesh has a property "VertexAttributeWeights" which you can use to return an array (one per vertex) of the weights used in the simplification - but you cannot set a AttributeWeights per vertex and the arrays first item is the value sent in on the initialiser with the rest set to zeros. Has anyone any idea how all this is supposed to work ? Thanks in advance, Phillip Hamlyn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this