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.

3 Dimensional Chat / .x format models and basic colours?

Author
Message
SpyDaniel
16
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 31st Dec 2013 12:21 Edited at: 31st Dec 2013 12:22
I was wondering if the .x format contains the basic RBG colours you assign to models in an editor and if you can have the colours rendered within a DBP created engine or in another game engine by default?

Example of the basic colours assigned to one of my models (The polygons at the bottom of the sails will be alpha mapped or replaced. Also its still very WIP)

Attachments

Login to view attachments
Dia
17
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 4th Jan 2014 02:28
Are the different colours assigned to different materials within the editor? Most .x exporters (if not all!) export the material data along with the object, noting that at least 1 material is mandatory

If you open your .x file in a text editor and look through it for the "MeshMaterialList" header you should see something like



what this says is that there are 3 different materials, spread across 24 different faces, and then lists each face index along with its material reference. The material references are then linked to each of the "Material {" declarations, in this case my three materials are blue [0,0,1,1], green [0,1,0,1] and red [1,0,0,1] - this is the material set from the cube object pictured in the attachment.

This is not the sig you are looking for....

Attachments

Login to view attachments
Dia
17
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 4th Jan 2014 02:37 Edited at: 4th Jan 2014 02:45
just had another thought too, if your 3d program also supports vertex colouring, and if your .x exporter also supports use of vertex colours, the "MeshVertexColors" declaration inside your .x file can also be used.

In this case, it appears as



Basically here, each vertex has its own individual colour assigned, (i.e. all of them are blue except for vertex 6,7,8,38 and 39 - they are coloured red) and when it comes to runtime there is a smooth gradient across faces between each of the different colours as shown in the attachment

Only problem with this method is that I am not sure how many 3d programs/exporters support vertex colouring

both of these methods are supported by default, I didn't use any object or appearance commands within DBPro to make either of these images, just the Load Object command

(edit: oops, just noticed I turned lighting off for this picture, so it is ambient only, but you get the idea)

This is not the sig you are looking for....

Attachments

Login to view attachments
SpyDaniel
16
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 4th Jan 2014 17:46
Thanks for the information Dia, would you know if a shader could make a model show the mesh material's? Asking because I'm using an engine I believe is written in DBP.
chafari
Valued Member
16
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jan 2014 22:29
Quote: "Thanks for the information Dia, would you know if a shader could make a model show the mesh material's? "


The objects that we export from Dbpro, use to be wrapped even not having any texture. If we make mesh from any object and export to .x, when we open the object again into Dbpro, we just need to add a texture to the object. There is a good example of Evolved "Automap", that can give a map automatically to our object.

I found it here.
www.evolved-software.com

I'm not a grumpy grandpa
SpyDaniel
16
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 4th Jan 2014 23:11
@chafari

I'm not talking about UV maps, I wanted to know if I could have the mesh materials rendered, as in the colours you can assign objects/faces in an editor, I wanted to use those within an engine coded in DBP, if it makes sense?
chafari
Valued Member
16
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Jan 2014 23:18
What I'm sure, as Dia commented most 3D program can export objects with differents colour faces, and of course we can asign textures to our object and get it rendered into Dbpro. Problably you will have to put all textures in same folder as your object unless you texture it manually.

I'm not a grumpy grandpa
Dia
17
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 5th Jan 2014 00:45 Edited at: 5th Jan 2014 00:59
Hiya SpyDaniel,

Not entirely sure what you are asking for now. The mesh in the attached pic has no uv map or textures applied, just three different materials. The yellow armour material has red vertex colouring, the grey suit material has blue, erm... stuff, and the face/skin material has a bit of face shading and the eye colour.

The top two images in the attached show the mesh in my editor (I use lightwave, just because that's what I am used to) and the bottom one shows an in-engine screencap, using the following code only:



(woah, the ambient washout on the colour vibrancy is brutal using the default display )

Are you talking about using procedural textures from your editor, or is it just diffuse colour? AFAIK the only way to get procedural or node-based materials to work is to bake them to a texture and apply them as a texture map (requiring UV mapping as chafari mentioned)

The .x format does support specular power, specular colour and emissive colour data as well as the diffuse, although the DBPro default shader doesn't utilise this extra data (it can handle vertex alphas though, which is cool). I am no expert on shader coding, so I am not sure how a shader would access this info

If you could give me an idea of what sort of materials you are trying to apply and what editor you are using, I might be able to get a better handle on what you are trying to achieve. (also, any specifics of the engine you are free to share would help too)

This is not the sig you are looking for....

Attachments

Login to view attachments
SpyDaniel
16
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 5th Jan 2014 03:15
Basically what vertex colouring does, but for faces and I am uncertain if the editor I am using will render this data. I have tried, but comes out white. If you need to know the engine I am using, it is the Shoot em up kit.
Dia
17
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 5th Jan 2014 05:45
Ah ok, haven't used the Shoot em up kit, but I *think* it forces you to use a diffuse texture map for each object, so you may have to go down the baking/uv mapping path

This is not the sig you are looking for....
SpyDaniel
16
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 5th Jan 2014 17:14
I'm thinking that also now.

Login to post a reply

Server time is: 2022-12-02 20:28:41
Your offset time is: 2022-12-02 20:28:41