New Spring model system. Need feedback from modellers / devs
Posted: 13 Jan 2010, 08:39
BrainDamage and I have been working a new model importer for Spring. We have model loading and flat color (grey) rendering working for all major 3D formats (obj, 3ds, collada, mdl, md3, md5, etc...). Since I don't do a lot of modelling myself I thought I'd get some feedback here on how to proceed.
Textures
I'm currently working on texturing, which is a very tricky area. I'm going to lay down what i THINK i know so you guys can correct me where i'm wrong.
Spring's current texture loading is done in 2 ways. The 3DO format uses a texture atlas and the S3O format uses UV mapping. It's my understanding that UV mapping is the most common approach for modern games so I'll focus on that. It appears that S3O actually uses 2 textures, where the second texture contains teamcolor alpha, glow and shininess properties in the channels.
What is the relationship between a 'material' and a 'texture' in common 3d models? The import library exposes both as seperate (but possibly related) objects. If I understand correctly a material can be applied in most 3d packages and gives each face it is applied to a fixed diffuse, specular, ambient, emissive and shininess value. Presumably the combination of these things, particularly the diffuse value, creates the 'color' in the case where there is no texture. In the case where there is one or more textures these values affect the texture as well (kind of blended with the texture's actual color values). Does anyone actually need flat color (vertex colors) for modelling these days or can flat color materials simply be ignored?
A model with a texture presumably supplies a set of texcoords which opengl uses to work out which parts of the texture go where. What is the relationship between texcoords and mesh vertices? Are there always 4 texcoords per face or does it depend on the faces type (tri or quad).
I've made an S3O model using open-source tools (Wings / Gimp / Paint.Net) and I found the 4-channel second texture rather awkward to work with, largely because the 4th channel (teamcolor) is the images' alpha and messing with it makes the image look really odd and the process requires accessing channels directly. Since the import library exposes 'materials' how easy are materials to work with. Can any of the material channels be used for team color or would this require editing the geometry? How do other common model formats and games handle special cases like teamcolor?
Can multitexturing be used for this purpose? Is it supported by common formats? Is it difficult to render?
Do any modelling tools or formats support GL shader programs directly in the model? Is there any point supporting this or should it be left to mods to implement via Lua?
Hitboxes / Heights / Footprints
Now the whole point of the model loader is to use models 'as is' not passed through another tool (UpSpring). This has obvious benefits to workflow and cross-platform development. However it also removes the tools normally used to set the models dimensions for the purposes of selection, pathing and collisions. The options appear to be:
1.) Create a hidden node named 'hitbox' in the scene
2.) Set the values in the unit fbi/lua.
So thoughts on which is best for each required value would be useful.
Nodes and Meshes
The assimp library splits a model into nodes and meshes. Nodes can have 0 or more meshes and nodes can share meshes. I'm currently creating a 1-to-1 relationship between nodes and Spring's 'pieces'. Are there any issues with that approach? Are there any formats or modelling tools that would have issues naming or creating nodes (which is needed for cob/lua animations)?
Rotation
I've noticed one of the 3ds models loads with its 'front' facing the ground. I'm going to assume this model is actually the right way round in 3D Studio. Is this common? Is the model wrong or is Spring? Do we need a way to remap the axis in the unit fbi/lua?
Anything else?
Apart from asking for bones/animation support (which I personally won't be doing) are there any other requirements you need?
Can you help?
If you are a GL guru or can assist with testing let me know. All the source for this 'assimp' branch is pushed to my github repo regularly. I also have a test mod with units using various formats uploaded to my site. PM or post if you can assist.
PS. Just this once can we all stay on topic. These issues are complicated enough without dealing with all the usual bullshit. Also any 'support' posts telling me how happy you are, please keep it to yourself or PM. Thanks.
Textures
I'm currently working on texturing, which is a very tricky area. I'm going to lay down what i THINK i know so you guys can correct me where i'm wrong.
Spring's current texture loading is done in 2 ways. The 3DO format uses a texture atlas and the S3O format uses UV mapping. It's my understanding that UV mapping is the most common approach for modern games so I'll focus on that. It appears that S3O actually uses 2 textures, where the second texture contains teamcolor alpha, glow and shininess properties in the channels.
What is the relationship between a 'material' and a 'texture' in common 3d models? The import library exposes both as seperate (but possibly related) objects. If I understand correctly a material can be applied in most 3d packages and gives each face it is applied to a fixed diffuse, specular, ambient, emissive and shininess value. Presumably the combination of these things, particularly the diffuse value, creates the 'color' in the case where there is no texture. In the case where there is one or more textures these values affect the texture as well (kind of blended with the texture's actual color values). Does anyone actually need flat color (vertex colors) for modelling these days or can flat color materials simply be ignored?
A model with a texture presumably supplies a set of texcoords which opengl uses to work out which parts of the texture go where. What is the relationship between texcoords and mesh vertices? Are there always 4 texcoords per face or does it depend on the faces type (tri or quad).
I've made an S3O model using open-source tools (Wings / Gimp / Paint.Net) and I found the 4-channel second texture rather awkward to work with, largely because the 4th channel (teamcolor) is the images' alpha and messing with it makes the image look really odd and the process requires accessing channels directly. Since the import library exposes 'materials' how easy are materials to work with. Can any of the material channels be used for team color or would this require editing the geometry? How do other common model formats and games handle special cases like teamcolor?
Can multitexturing be used for this purpose? Is it supported by common formats? Is it difficult to render?
Do any modelling tools or formats support GL shader programs directly in the model? Is there any point supporting this or should it be left to mods to implement via Lua?
Hitboxes / Heights / Footprints
Now the whole point of the model loader is to use models 'as is' not passed through another tool (UpSpring). This has obvious benefits to workflow and cross-platform development. However it also removes the tools normally used to set the models dimensions for the purposes of selection, pathing and collisions. The options appear to be:
1.) Create a hidden node named 'hitbox' in the scene
2.) Set the values in the unit fbi/lua.
So thoughts on which is best for each required value would be useful.
Nodes and Meshes
The assimp library splits a model into nodes and meshes. Nodes can have 0 or more meshes and nodes can share meshes. I'm currently creating a 1-to-1 relationship between nodes and Spring's 'pieces'. Are there any issues with that approach? Are there any formats or modelling tools that would have issues naming or creating nodes (which is needed for cob/lua animations)?
Rotation
I've noticed one of the 3ds models loads with its 'front' facing the ground. I'm going to assume this model is actually the right way round in 3D Studio. Is this common? Is the model wrong or is Spring? Do we need a way to remap the axis in the unit fbi/lua?
Anything else?
Apart from asking for bones/animation support (which I personally won't be doing) are there any other requirements you need?
Can you help?
If you are a GL guru or can assist with testing let me know. All the source for this 'assimp' branch is pushed to my github repo regularly. I also have a test mod with units using various formats uploaded to my site. PM or post if you can assist.
PS. Just this once can we all stay on topic. These issues are complicated enough without dealing with all the usual bullshit. Also any 'support' posts telling me how happy you are, please keep it to yourself or PM. Thanks.