Hi,

As OSG newbie, I'm working on a terrain texture brush task.

My goal: 
Use mouse controlled brush paint grass area on a prebuild terrain(has original 
texture)

Progress:
Now I successfully complete a demo, but the method I use seems unattractive.

My implementation now:
(Use OverlayNode method)
1. Load prebuild terrain(T1) and it to scene.
2. Duplicate the terrain node(Terrain T2).
3. Change the texture of T2, make is full of grass texture.
4. Use T2 as OverlaySubgraph, T1 as child to OverlayNode, so now, in the scene, 
I can see a single terrain full of grass.
5. Set color of each vertex in T2, make it complete transparent.
6. handle my mouse brush area, calculate effected vertices of T2 in brush area, 
and raise the transparent value of those vertices.
7. now the brush area will gradually show grass texture.

I did some search about the question, seems multi-texture is another way, but I 
didn't figure out how. As I need control blend on individual vertex(brush 
area), I only found functions to change the blend of whole texture units.

 Any tip of a smart way will be grateful :-)


Thank you!
CaoWenjie

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45773#45773





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to