Changing vertex color of terrain.
Changing vertex color of terrain.
Whats the best way to change the vertex color of the terrainscenenode , not the material color?
Tomi
-
- Posts: 23
- Joined: Sat Apr 17, 2010 3:36 pm
Re: Changing vertex color of terrain.
loadHeightmap allows you to set the vertex colour iirc.bonsalty wrote:Whats the best way to change the vertex color of the terrainscenenode , not the material color?
-
- Posts: 23
- Joined: Sat Apr 17, 2010 3:36 pm
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
The terrain node has dynamic lod, so the meshbuffer is constantly changing. You'd have to change the vertex color every time you moved to keep up with lod.Alastriona wrote:Iterrainscenenode->getMesh()->getMeshbuffer()->getVertices()bonsalty wrote:Thanks, I do it this way. I would like to change it without generating a new surface, but I guess its impossible.
And then modify the vertices in the array. Wouldn't that work?
-
- Posts: 23
- Joined: Sat Apr 17, 2010 3:36 pm
Hmm didn't think about that. I'm guessing that calling the loadHeightmap function every time you wantg to change it is the best then. Unless you can somehow access the vertex color atribute and change it directly. But I don't think its exposed via the API.Lonesome Ducky wrote:The terrain node has dynamic lod, so the meshbuffer is constantly changing. You'd have to change the vertex color every time you moved to keep up with lod.Alastriona wrote:Iterrainscenenode->getMesh()->getMeshbuffer()->getVertices()bonsalty wrote:Thanks, I do it this way. I would like to change it without generating a new surface, but I guess its impossible.
And then modify the vertices in the array. Wouldn't that work?