Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Random/Planned Color Selection and applying to 3D Model

Author
Message
L3mmy
17
Years of Service
User Offline
Joined: 19th Jun 2009
Location: England, Sheffield
Posted: 20th Nov 2012 22:52 Edited at: 20th Nov 2012 22:59
Sounds complicated(ish) right?..Maybe it is, Maybe it isn't

Basically, I want to set up a file, with numbers from say 0 - 20, and for each number, reference it to a RGB like 100, 50, 100.
I then want to beable to apply that color, Using the numbers to a certain part of a 3D Model, depending on part name? or hierarchy? I dn0...

It's a GTA Style and I find it to be rather useful if I can get it to work on my own car models. As it provides lots of different color varations and rarely makes two vehicles in an area the same colour.

Here's a half decent explanation:
http://www.gtamodding.com/index.php?title=Carcols.dat#GTAVC

And a little info with a File system Layout..
http://gta.wikia.com/Carcols.dat/gtaiv

It's really getting my head into a twist trying to figure out how to go about it, So even if it's not provided, a point in the right direction would be appreciated!

Tom

Edit 1* Looking at a GTA Car model, as the body colour has [prim] or [sec] at the end of the colour name for primary or secondry colour?

www.monsterwareltd.co.uk/imagehost <-- Image Hosting for your pictures
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 20th Nov 2012 23:52
Array, Much?

paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 21st Nov 2012 13:34 Edited at: 21st Nov 2012 13:36
Last time i tried to do something similar to this i basicaly set up the models uv data to reference a texture that was simply 4 different coloured squares aranged in a grid.I could then remake the image on the fly with bitmaps to change the colours to what ever i needed.I may still have the code somewhere if that helps.It was quite easy to do from what i remeber as the 4 the colours where simply
uv 0.0,0.0 to 0.5,0.5 - colour 1
uv 0.5,0.0 to 1.0,0.5 - colour 2
uv 0.0,0.5 to 0.5,1.0 - colour 3
uv 0.5,0.5 to 1.0,1.0 - colour 4
You could make the image into any number of colours really,just as long as keep track of uv positions.
Or if your making the models then could you split them into limbs and simply colour each limb if that would be simpler,it depends on the complexity of the models reaaly.
Mr909
14
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 21st Nov 2012 18:35 Edited at: 21st Nov 2012 19:38
I am pretty sure the Texture Max add on does exactly what you're describing, and is probably easier than any solution I could come up with.

...

Actually, I do have another method in mind. If you could get me a sample UV car skin, I could give it a try.

EDIT: Okay, here's a cut-down version of my layer painter, modified to get it to do what you want. It's only halfway done, but it should provide a useful framework. Just rip the image back and use it as a texture.

Here's the problems I know about so far:
-"mix" function doesn't work as it properly should
-Saving/loading layers as arrays have problems accounting for uncertainty (array dimensions x and y). This could be fixed with a more sophisticated save-load system, but it won't really matter if all your files have the same height and width, as you can set those up in advance.

Beyond that, have fun, credit preferred, please don't claim it's yours.
L3mmy
17
Years of Service
User Offline
Joined: 19th Jun 2009
Location: England, Sheffield
Posted: 25th Nov 2012 12:13 Edited at: 25th Nov 2012 12:15
@Paul, Painting the limbs! thats what I need but couldn't think of the name lol...I have all the limbs set up such as Body, Bonnet, Boot, Wheel, Door(1,2,3,4) Window etc...If I could apply a colour to each limb, I could set up the Colour data seperatly and apply it as the vehicle spawned...

And then I can move on to the shader not sure if I can do that per limb or by texture, But will be adding a reflective shader to the body when I get to that point. But thats not for now.

@Mr909, Thanks for the example, but looking through it, it doesn't seem to have the right approach I wanted..

www.monsterwareltd.co.uk/imagehost <-- Image Hosting for your pictures
Mr909
14
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 25th Nov 2012 23:38
You're welcome. What could I possibly do to adjust my system for your approach? Or have you already got what you needed?
L3mmy
17
Years of Service
User Offline
Joined: 19th Jun 2009
Location: England, Sheffield
Posted: 26th Nov 2012 01:04
Well, Like I said in the above post, I'd like to beable to texture the limbs, based on the name in the hierarchy, Like bonnet/body texture that with a colour, Wheel, Light, Grill etc would be image based textures...

The Random colour system can be implemented later after I get that sorted.

www.monsterwareltd.co.uk/imagehost <-- Image Hosting for your pictures
Mr909
14
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 26th Nov 2012 17:05
Ah. Yeah. Can't really help you there. Sorry. You ever need to put different color layers on a single image, there's an approach. Limbs.. bleh. I don't know no limbs.

Login to post a reply

Server time is: 2026-07-08 00:23:38
Your offset time is: 2026-07-08 00:23:38