Advertisement

Different outfits for a character? (low poly)

Started by March 23, 2012 02:46 AM
13 comments, last by glhf 12 years, 7 months ago

"Greyscaling" isn't a technique you would look up with a Google search and find tutorials for...

The idea is that you create your textures in greyscale (or black & white), and the game would then apply your different colour selections through code. So you create one asset, that is then displayed in whatever colour the player has chosen.


Does that make sense?


Yes, Thanks.
But I still wish there was some kind of tutorial on this because it sounds mega complicated to know what level of black/white/grey you should use in the grayscale image at what parts. Like if you wanted to make an rainbow with some specific colors in mind.. how would you draw that in grayscale?

Also are you supposed to fit all unwrapped parts (Eyes, chest, plate armor, headband, hair, sun glasses and a 100 hundred things.. on just one UV Map?
I don't see how? And if you make more than one texture then it's going to cost performance.

And you can't stack unwrapped parts ontop of each other since you've done the grayscale for specific parts.
Mapping a greyscale value to a color value is as simple as using a color curve or a color scale. You set up some sort of gradient, with as many colors in it as you need, arranged in a texture like so:
4rAjE.png

Then you set up the shader such that the greyscale color is obtained from the model's texture, and used as the v-component of the texture coordinate used to index the above colorscale texture, with the u-component as 0, in order to obtain the color to draw. A greyscale value of 0 would draw color from the left side of the colorscale, while a value of 1 would draw from the right. Values in between, of course, would draw from the inbetween scales.

And no, you don't necessarily have to put all the unwrapped components onto a single texture. Some state change such as a texture swap here and there isn't going to kill you.
Advertisement
Do I understand correctly that you are restricted to 256 colors (probably enough for normal clothes), unless you are using HDR texture for model or encode grayscale in two channels?
Also - should texture compression be turned off for grayscale textures? Compression noise that would otherwise be tolerable for normal texture can result in visible color changes unless the color texture is very smooth?
I myself have taken simpler approach and use color transform matrix - but this allows much smaller variability in textures. Basically just replacing one base color with another (like changing red T-shirt to blue one).
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

Mapping a greyscale value to a color value is as simple as using a color curve or a color scale. You set up some sort of gradient, with as many colors in it as you need, arranged in a texture like so:
4rAjE.png

Then you set up the shader such that the greyscale color is obtained from the model's texture, and used as the v-component of the texture coordinate used to index the above colorscale texture, with the u-component as 0, in order to obtain the color to draw. A greyscale value of 0 would draw color from the left side of the colorscale, while a value of 1 would draw from the right. Values in between, of course, would draw from the inbetween scales.

And no, you don't necessarily have to put all the unwrapped components onto a single texture. Some state change such as a texture swap here and there isn't going to kill you.


Ok I think I understand the greyscale thing, ty for that.
Will have to look into it a bit more though but I'm sitll a bit unsure about the unwrapped components.

Like in WoW for example every character can equip like a billion different clothing items..
And I dunno but i think you can only use 1 texture map at a time? maybe you can use more than 1 texture map at a time but then it would cost performance.. a lot.
So you would have to fit all those millions of different clothings onto one texture map.
Which is perhaps possible with show/hide and stacking them ontop of eachother.. still mega complicated though.
but then you can't have complicated textures where you just assign a color to the object.
WoWs textures are customized for each piece of clothing they dont have same colors.

and if you can only use 1 texture map at one time then how would you do swaps because if you are wearing boots that exist on texture map 2 and you're wearing a cape from texture map 7 then what??

I just cant believe theres no guides out there for this?
How did everyone learn this stuff?
Ok i think maybe if we split a character into many meshes.
Like for example.. torso in 1 mesh where you hide/show the diffrent torsos for example to switch between naked torso to leather armor or a shirt etc and when you switch mesh it also switches the texture map.

So a character is made up of like many meshes: legs, feet, torso, head, hands, arms.
Would this be very high cost in performance in mmorpg? How did ultima online do it for example or world of warcraft?
And how do you rig and animate something like this?

This topic is closed to new replies.

Advertisement