Vertex Painting Alternatives? / Or fix this limitation.

Hey guys, okay I’m getting really fed up with vertex colors.

Is there any way possible to get more than RGBA??? Like there’s millions of colors,
and being limited to just (R,G,B,A) is quite limiting. I need roughly 8 colors (So I can replace the colors with a texture)… So using colors isn’t the issue, it’s getting a texture to place on a color of choice.

I just can’t quite seem to understand how to get passed the 4 color limit of (Red,Green,Blue,Alpha). I know there’s got to be a way, but like most things with Shaders, there’s not much info online about it.

I don’t need any normals, etc. Just Diffuse textures.

There’s a reason this is not posted on the Shaders section.
Because it’s not about shaders, it’s about is there a limitation to this process and 4 colors is the maximum period.
Or is there some other process that I can research into that is newer and better way of doing Vertex Painting.

Hoping there is a newer and better way. I’d do splat mapping, but that kind of defeats the purpose for big levels, a 4096 x 4096 texture is quite a bit of detail to cover E.G. 30 x 40 meter piece of terrain and then doing that with 20 more of them on the level, seems like way to much data for something like like…

Think of games like Banjo Kazooie, I noticed they did some vertex painting on some parts.
So I am trying to paint in walk paths,grass,snow,dirt, stone, etc. But being limited to 3 colors + alpha isn’t much in choice of options. And likewise breaking the mesh into smaller pieces still doesn’t help much if I want to blend it an assortment of textures. As again, 3 textures isn’t much to work with.

So is there something better than 3 color + alpha vertex, can I extend it to 7 textures + alpha some how?
Or is there some newer process that I can research into.

Vertex colour was created to carry colour information in vertices 4 channels is enough to do that. If you are using the channels to paint masks, you can get by the limitation, by being smart about your materials, and have one ones that let you transition between one set of masks to the other.

Other wise you could just use splat maps, and use as many as you need.

Well I’m modifying one that was free on the Asset Store, so I’m not 100% on every detail into it.
I mean I got it kind of working, but not really.

Like if I choose magenta to be the color for my 5th texture (including alpha as one). Then, it blends in with whatever texture is closest to the RGBA Scale and makes it pretty transparent.

I would again - use splat maps, but having 20,000 256 x 256 textures isn’t going to help lol. or 20 4096 x 4096 textures isn’t going to help either. Trying to stick to low graphical quality like N64 games, so don’t want 20 gigs of texture data. But just to even show the details of N64 graphics I’d still need to do a 4096 x 4096 texture, or 20,000 256 x 256 textures…If using splat maps…

I really wish I knew how ZBrush did it’s poly paint or whatever, that seems like the way to go haha.

zbrush poly paint is just vertex colour, it just has so many vertices to work with, that it looks high quality.

you just have to get creative with what colours mean when using vertex colour for masking. Also what you might want to do, is blend using a heightmap to influence your vertex colour, so you can tighten up things, and reduced the gradients.

1 Like

Yeah, this is why I hate using external assets. When it comes time to add/change something, gotta dissect what they put haha. Was just hoping there was some other way to go about doing this. Drives me to the point that I should set everything aside and invent a new texturing method lol.

Still confused about what you are talking about, you can write any colour to a vert you want, it is up to you what your shader does with that data. You could treat the 4 channels, as 4 masks to feed into lerps, or you can treat it as a colour, and based on what range a colour it is in do something.

Instead of using each channel as it own mask, you could simply check if say both red and blue are nearly 1 which == magenta and do something with that, can do the same if they are at their half values, and do the same for every other combination.

2 Likes

Download Ikari on the Asset Store, it’s a free Vertex Painter…
Then create a new texture slot in the shader, set it for a specific color, etc.

Modify the Ikari scripts to support a new color, and you’ll see that no matter what color you put,
it will bleed into the nearest Solid RGB color. So for example.

if I have Snow on R.
Cocrete on G
Grass on B

Set up a new texture slot and put Lava on it and set it’s color to Magenta.
It will find the nearest solid color (R,G, or B) and make it transparent because it’s not a solid 255 strength rather a blended color with low transparency because it’s not a solid 255 absolute R G or B.

I use a similar setup in my game, I am also composite painting the textures using color channels as a mask as you want to do.
To overcome the limit I use multiple UV maps, this way you can have 4 masks per every UV map(I actually use 3 as Maya handling of alpha channel suck). Since Unity 5, you can use up to 4 uv channel so plenty of combination possible.

Be careful that Unity also compress vertex color to fixed decimal format, so some gradient doesn’t look so nice as in the 3d modeler. Tried disabling vertex color compression in the player setting but didn’t see any difference.

1 Like

That is how vertex colour works, its per vertex not per face. The colour for each vertex is interpolated across the face. shares.

4 Likes

By the way, In case it wasn’t clear you need a custom shader for everything if you go this route and it’s a nightmare to work with outside Unity, I had to recreate the shader inside Maya and not many 3d software allow custom shaders.

1 Like

This is a rather complicated thing I’m starting to notice…

On the W3D Engine you could you any number of colors, each representing a texture…

So I could use 0,0,255, 203,109,0, 80,0,1, 88.77.66 and the engine would know what texture to put.
This is why I’m not throughly understanding this I believe.

Yes, you can do this in a shader. This is absolutely an issue that a well put-together shader can handle. Hell, I’ve even made sloppy versions of this in Shader Forge before.

2 Likes

So you think this is a shader issue rather than the Asset it’s self? I mean I definitely got it painting, but it’s not paintign the correct texture, just the closest one on the 3 original textures (R G or B) and being it’s not solid 255,0,0---- 0,255,0 or 0,0,255 the other 2 numbers are acting like transparency.

@N1warhead_1 - A picture of the result that you want to achieve would help a lot. The N64 had games using all kinds of techniques.

You are using an existing asset so you are also stuck with the limitations of the asset. This is exactly the type of problem that you would solve by creating your very own, custom Shader. You can then paint vertices with all colors (still RGBA) and have a system in the Shader that figures out the texture(s) that you want to use from maybe even several texture atlases.

Old and new games have to balance many small textures against a few big ones because of memory constraints. People use different tricks to solve this that are based on the artistic style of the game and the content.

@00christian00 - Most of the serious 3D packages have something like a node based Shader editor these days. Even Blender got it, it isn’t a nightmare… just different.

@Deon-Cadme - Well that was the thing, I wasn’t sure if it was the Shader or the Asset with how it paints it.
I normally don’t use external assets for anything, I just never made a Vertex Painter inside Unity before.

So it was more a hope it worked the way I wanted kind of thing, I mean it does work the way I want, just didn’t realize it was limited to 3 colors haha.

I’d love to have access to the millions of colors if I so wanted them.
So you think it would be better to vertex paint inside 3d app and then just make a shader read the vertex colors? I could do that.

@N1warhead_1 - Sounds like your asset is already made up of a code and Shader part that basically does what you described. What you need to do is to change the Shader so that it can detect different RGBA shades and/or combinations and translate them into separate textures or a positions one or more texture maps.

How this should be done in the end completely depends on your needs and art style etc…

Paint the models in Unity or Blender, I would recommend the place that got the best tools, that you are mors familiar with and that solves your problem with the least amount of work.

1 Like

@Deon-Cadme : Yeah I’m going to do it in 3ds max… Sense the painting is already setup, so I can just make a shader and good to go…

Rather do my own shader than try to keep changing one.
I appreciate the guidance buddy.

1 Like

Am I the only one who is getting the impression that the OP is confused about RGBA and how to use RGBA values to produce 16 million colors?

“Is there any way possible to get more than RGBA??? Like there’s millions of colors,
and being limited to just (R,G,B,A) is quite limiting. I need roughly 8 colors”

Aren’t you sort of saying, that you’re assuming a vertex can only have one of 4 colors? Like solid red, solid green, solid blue ? ie do you not understand that RGB are all combined together with math: (Red65536)+(Green256)+Blue to let you choose from a 24-bit palette (16777216) colors? Is it that you don’t understand how RGB colors work and are assuming that each color component creates a whole separate color? That’s at least how I read it when I read your opening sentences.

Might be wrong.

1 Like

@imaginaryhuman_1 : I know exactly how the colors work.
The problem I was running into, I’ve only used Vertex Paint for the old W3D Engine nearly 12 years ago.

And I would give it any color I wanted, I’d paint it, and the Engine would load it.
However, on Unity. That isn’t the case (for obvious reasons) - no shader for it.

So I go to asset store and see there’s a free one, so I’m like omg free vertex painter. So I download it, and import it.
Try it out, does what I want, so I then decide to add another color slot to the Shader + to the Editor Scripts, etc.

Okay, click the button for the new color, and paint. Well, didn’t do what I am used too. (Any color = any texture I set it up for).

Well not with this. Just to make the example easier to explain.
Lets forget completely that the Alpha channel don’t exist for the example.

Right, so we got R G and B (Excluding A).

So lets say I set up my new custom color for 100,0,0 (For simplicity sake).
I make that texture Lava.

So lets say Grass = 255,0,0.

Alright, so lets say I make the color 255,0,0 - okay paints great.
well if I do 100,0,0, (to paint the lava), well then it just does a semi-transparent barely visible grass texture, rather than the new lava.

It all depends on how you write your shader. You have to write your shader to look for complete colours, and create a mask of it for them. This should be fairly easy to accomplish with if statements in your shader.

1 Like