Q for the shader gurus

Technical questions, etc..
Post Reply
Peter
Senior Chief Petty Officer
Posts: 170
Joined: 18 Apr 2010, 15:18
Type the number ten into the box: 0
Location: Texas

Q for the shader gurus

Post by Peter »

Is it possible to build a shader from components in the library that blends an object's existing vertex colors with a diffuse mapped texture?

Any help would be appreciated.
a day without orange juice is like... a day without orange juice
User avatar
Prodigy
Site Admin
Posts: 955
Joined: 21 May 2009, 14:46
Type the number ten into the box: 0
Location: Uruguay

Re: Q for the shader gurus

Post by Prodigy »

can you please share exactly the shader that you want to merge with the texture? i don't understand what you mean with "existing vertex colors "
๑۩۞۩๑ prodigy ๑۩۞۩๑
Peter
Senior Chief Petty Officer
Posts: 170
Joined: 18 Apr 2010, 15:18
Type the number ten into the box: 0
Location: Texas

Re: Q for the shader gurus

Post by Peter »

Sure,
Here is a cube with one vertex colored red (imported from another 3D program).
Clip01.jpg
Clip01.jpg (22.04 KiB) Viewed 5298 times
When you switch from Model to Workspace, here's the shader it provides.
If you set VertexColorStrength as shown you can see the red vertex mixed with the DiffuseColor in the image above. (I picked a gray shade but it looks white for some reason)
Clip02.jpg
Clip02.jpg (32.92 KiB) Viewed 5301 times
I would like to do this with a texture map instead of just the plain diffuse color.
That's the reason for my question.
Is it possible with some other shader?
a day without orange juice is like... a day without orange juice
User avatar
Prodigy
Site Admin
Posts: 955
Joined: 21 May 2009, 14:46
Type the number ten into the box: 0
Location: Uruguay

Re: Q for the shader gurus

Post by Prodigy »

can you share that cube?? i never seen a vertex color on workspace side :shock:
i think is totally possible.. let me try
๑۩۞۩๑ prodigy ๑۩۞۩๑
Peter
Senior Chief Petty Officer
Posts: 170
Joined: 18 Apr 2010, 15:18
Type the number ten into the box: 0
Location: Texas

Re: Q for the shader gurus

Post by Peter »

Ok, Prodigy.
here it is...
VertexColoredCube.zip
(63.79 KiB) Downloaded 283 times
How I made it:
In Blender I painted the one vertex and exported it as a .cob.
Then I loaded it into model-side in TS7.6.

This can potentially allow us to bake fake AO to vertices in Blender or Wings3D and import this as a model with dirty or stained coloration that you can mix with textures!

I couldn't figure out how to paint vertices in TS.
a day without orange juice is like... a day without orange juice
User avatar
Prodigy
Site Admin
Posts: 955
Joined: 21 May 2009, 14:46
Type the number ten into the box: 0
Location: Uruguay

Re: Q for the shader gurus

Post by Prodigy »

Wow, that's weird! i never seen something like that before..
also i don't know how to paint a vert on workspace side, i remember that feature on model side but not on WS.

To get a mix between VP and a texture first we need to find how to duplicate that with another shader..
far as i know is not possible to merge 2 shaders but you can mix on a new one.. so we must find first a way to paint a vert first..

Great find Peter :worship:
๑۩۞۩๑ prodigy ๑۩۞۩๑
Peter
Senior Chief Petty Officer
Posts: 170
Joined: 18 Apr 2010, 15:18
Type the number ten into the box: 0
Location: Texas

Re: Q for the shader gurus

Post by Peter »

Well...
If I'd been more observant I would have noticed a "paint vertices" on model side.
This is in the material widget panel. When you paint some vertices and switch to WS you can only see the colors you painted when you set VertexColorStrength to 1.

-Don't see a "paint vertices" icon in WS.

-Colors from vertices don't seem mix with texture colors in MS, either.

-Sounds like a script is needed, I couldn't find any components in the library that would help.
a day without orange juice is like... a day without orange juice
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Q for the shader gurus

Post by clintonman »

I think that information is stored in the mesh vertices, not the material. If you sample the cube material and apply it to another cube you don't get the vertex color applied.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Q for the shader gurus

Post by trueBlue »

Fooling around with a D3D Vertex Shader on the right
DX Vertex shader.png
But... oddly in Model
Model.png
Attachments
Record.RsRcd
(124.71 KiB) Downloaded 200 times
Post Reply