Game Development Community

Vertex Colors for blended textures

by Ken Johnston · in Torque 3D Professional · 09/21/2009 (6:36 pm) · 12 replies

Are vertex colors supported in T3D? I didnt have much luck in searching around but would be very nice indeed if they were supported for Torque. And if they are what is the correct method for setting it up for a static? My main reason is I have a cave i have been modeling for sometime that i started to texture with vertex coloring and blending, and i need to know if i am going to have to go back and start over.

#1
09/21/2009 (7:17 pm)
Yes, it's supported if you use Collada. You'll need to write custom materials, or add the blending features to shadergen. You could use the terrain shaders as example.
#2
09/21/2009 (7:22 pm)
awesome thanks for the pointing me in the right direction
#3
09/21/2009 (7:32 pm)
T3D supports loading vertex colors from collada models.

Quote:And if they are what is the correct method for setting it up for a static?

A TSStatic object? Just setup the vertex colors in your 3d app and export to collada.
#4
09/21/2009 (7:36 pm)
@ chris, to clarify what I am asking in the quote above is more on how to set up the custom material correctly to achieve the same result as seen in the3d app. I will play with it a bit though and see what kind of results i can get.
#5
09/28/2009 (5:11 am)
You probably want to extend shadergen by adding a feature that does what you want with the vertex color rather than writing a custom material.

Because this way you would get automatic support for normal/spec maps shadows etc.. all that stuff that Material does for you that CustomMaterial does not ( unless you write it into your shader ).
#6
09/28/2009 (7:16 am)
Just wondering if exists any tutorial or example for extending the shadergen features?
#7
09/28/2009 (11:54 am)
Yep, they do:
http://gameclay.com/documentation
#8
09/28/2009 (2:05 pm)
That's a beautiful tutorial, and it's pretty important too, since creating new shaderGen features is incredibly powerful.
#9
09/28/2009 (2:15 pm)
Shadergen gets a bad rep. Some of it is deserved, but it is (essentially) an Uber-shader, which is controlled via string-concatenation, instead of #defines.

That does remind me, I need to fix the CSS on those codeblocks so it looks nice with the GameClay colors.
#10
09/28/2009 (2:46 pm)
Thank you for that link Pat. ..and for taking the time to write those docs.
#11
09/28/2009 (2:48 pm)
wow this is awsome, thanks Pat
#12
05/10/2010 (1:43 pm)
I'm resurrecting this thread in hopes that Pat will look in. @Pat: I tried your exact tutorial implementation on a material used for a light. Obviously, this material was both emissive and has glow. Unfortunately, the light did not turn red when I plugged the magic line into the material definition. I put a breakpoint on the line under the "if" statement in the ProcessedShaderMaterial::_determineFeatures() functions, and sure enough the new feature was being added.

How can I debug this further? I figured that this since the code would modify the color output of the shader as the last step, then it should just work for what I want (which is actually to be able to dynamically "dim" the geometry the renders the light), but alas, no cookie.

Help me Obi-Pat-Kenobi, you're my only hope.

= Ed =