Vertex color for Node material?

(Ranstone) #1

Hello, I’m trying to use vertex color within a nodes material to dictate which areas of the map receive which texture. I want the ability to “spray” the desired grass over the rock for cliffs and such.

This is an entry level procedure in Internal, or Cycles, but for a reason I don’t understand, I can’t achieve it in BGE. In the viewer, the cliff looks fine, but when I run the game, only one or two areas have the desired grass texture, and the rest is rock, as if the vertex map’s contrast spiked.

I’ve included a blend if anyone want’s to take a look.cliffA.blend (852.4 KB)

(edderkop) #2

this is properly what you are looking for.
just switch the splatcolor input from the texture to vertexcolor

http://15b.dk/blendfiles/simple_texture_splatting.blend

1 Like
(Ranstone) #3

Definitively an option, and I very much appreciate the blend link, but I do apologize as I should have mentioned earlier that I’d not looking for a stencil image, as it’s not efficient for large environments. If there’s no practical way to use vertex color, then I’ll definitively use this, but vertex colors just seem so much more efficient at the moment.

Any way to achieve this with vertex colors?

(edderkop) #4

i wrote switch it to vertex it can do that to

(Ranstone) #5

Oh, I apologize. XD
You very clearly said that, and I completely missed it.
A very simple solution, and one quite appreciated. Thank you for your time!

(Ranstone) #6

So, the solution was not as simple as I thought. I’ve tried working on this and I still can’t get it to render the image when I use vertex color. Even in your original file, when you run the game using vertex color as your input only one texture shows up. This is the same problem I started with.

(edderkop) #7

check if you have a tick her, if so uncheck it

image

(Ranstone) #8

Thank you again for taking the time to look into this.
I double checked to make sure all materials are disables in the material texture tab.
For debugging, I’m using the exact file you sent me, just hooking up the first geometry node’s vertex color output into the first color node of the node called “texturesplatting”.

It actually occurred to me this might be a hardware issue. BGE is known to be a little buggy in that way. To test, I’ve included the updated blend.
simple_texture_splatting B.blend (2.2 MB)

On my PC without editing anything in the above blend, it looks like this in the viewer…
Texturesplat_Run_1

and looks glitched like this when you run the game.
Texturesplat_Run_B

If you chose to download the above blend and it works for you, (looks like pic A when you run the game) then It’s just a hardware issue on my end.

Not much else I can think of at this point… Unless I hooked up the nodes wrong, which is entirely likely.

(edderkop) #9

works fine on my computer , you should try another version of blender.

(Ranstone) #10

Hmm… Might be blender version, or might be hardware. My last computer couldn’t run GLSL and it took me a long time to figure out it was a hardware issue. :\