feature Proposal: skin files, defining sets of materials

What it says on the tin: a place to discuss proposed new features.
Post Reply
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

feature Proposal: skin files, defining sets of materials

Post by jonim8or »

In a project I'm working on, there are several vehicles, which have multiple materials. One for the vehicle, one for the driver, one for the glass. still, the whole shape is a single mesh.
For these vehicles, I want to have multiple "skins" ( like in Quake 3 the players had multiple skins ).
Using setMaterial on an entity will set it to every submesh of the entity, which is not what I want. But to call setMaterial on the submeshes, my code will require more knowledge on the structure of the meshes, which would lead to some hardcoded setup.

My solution would be the following:
The "material" in the mesh file is just an understandable name, like "truck_chassis", "truck_glass", "truck_driver".
a skin file links these to the actual materials, e.g.

Code: Select all

default_skin="Red"
[Red]
truck_chassis="Truck/Red_chassis"
truck_glass="Truck/Glass"
truck_driver="Truck/Driver"
[Blue]
truck_chassis="Truck/Blue_chassis"
truck_glass="Truck/Glass"
truck_driver="Truck/Driver"
Then I'd like to extend the entity with a setSkin(String skinName) method, which would apply the materials to the submeshes in the way defined in the skin file. This would allow a more user-friendly way of using multiple materials in a mesh.

I'd like to hear your ideas on this before I start out implementing it. Do you have alternative solutions? or suggestions to make this solution better?
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Re: feature Proposal: skin files, defining sets of materials

Post by Praetor »

All of this sounds great and very easily doable outside of the core. You can use whatever format you want for your skin files, you can just query the entity for its named subentities and set their materials accordingly.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
Post Reply