Game Development Community

Models - Vertex Painting

by Tim · in Torque 3D Professional · 01/18/2014 (12:23 am) · 9 replies

I'm currently looking at how to improve the texturing of architectural models in Torque and am interested to know if anyone has progressed Vertex Blend Painting with Torque yet. I know that there were a number of forum posts where people have experimented with achieving it but I've not yet seen anyone complete it

Here is UDK Engine doing it http://eat3d.com/free/vertex_painting

Has anyone progressed it? If so I'd be interested in talking to them about it. If not, but feel that they know how it can be achieved in Torque, I'd also be interested in having a conversation with you about it.

Please drop me an email at tim.watton [at] winterleafentertainment.com

Tim

#1
01/18/2014 (7:51 am)
Ive always wanted to give this a try in torque. I wonder how unreal handles saving the information. Do they save it out in a cache of the model maybe.

Edit: actually they probably save it out separately as part of the material maybe.
#2
01/18/2014 (7:52 am)
well why not lookin up idtech
it is open source (well gpl)

but it might give pointers on what could be done to achieve this in T3D
#3
01/18/2014 (10:00 am)
The videos show how to setup the shader. The big work in putting this into T3D will be creating a vertex painting editor. Once that is done, it just a matter of hooking up some vertex painting shaders to do what you want.
#4
01/19/2014 (12:01 am)
Cheers guys. creating gui editor is not so much of a problem but any ideas on how to set up the shader? We'd be happy to talk to anyone that does know how to achieve this.
#5
01/19/2014 (7:22 am)
As far as the shader goes, the basic idea from what I gathered from the video is you want to look up the main texture and get the color, then grab the color from the texture the vertex color should blend in and lerp it by the vertex color channel your using. Obviously if you want more advanced techniques like using a heightmap to fill in cracks before surfaces, then you need more shader code but that's the idea. So when, for instance red channel of the vertex color is 0, you get the base texture only, when its 1 you get the alternative texture only, and lerped blend between. i.e.

//diffuseColor is from the texture lookup on the main texture, modColor is from the texture lookup on the alternative texture lookup
diffuseColor.rgb = lerp(diffuseColor.rgb, modColor.rgb, vertexColor.r);

That's why I said the editor is the hard part, because it has to grab and update the vertex color of what you are painting on in the editor. The shader is just a matter of using that vertexColor in an interesting way.
#6
01/19/2014 (9:28 am)
Tim - thank you for this - i will look into this in more detail on this basis. Thank you

Tim
#7
01/19/2014 (10:22 am)
No problem. We do something similar (shader wise) to color our mechs in Dark Horizons: Mechanized Assault Vehicle. Instead of using the vertexColor to pick between two textures, we use a special Mask Texture to shade a greyscale texture the color the user picks. This allows the user to make their mech any color they want and have it only affect the areas of the mech that would be painted.

You can see it in action around 3:15 in this video if you have not seen it before - https://www.youtube.com/watch?v=PPWOijjsI8E
#8
01/19/2014 (11:10 am)
Thats really interesting Tim and a nice use of the shader. Nice video.
#9
01/19/2014 (1:53 pm)
or you could use Sahara
it provides already a base for some more advanced things