Difference between revisions of "OXP howto model"
m (→Export the model) |
Cholmondely (talk | contribs) (Added a_c's comments) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[File:Untextured Odyssey.png|thumb|right|400px|Maaarcooose's finished model of the Odyssey, prior to texturing]] |
||
+ | [[File:U31 odyssey.png|thumb|right|200px|Textured Odyssey]] |
||
== Create your model == |
== Create your model == |
||
in [http://www.wings3d.com/ Wings3D] or a similar program. |
in [http://www.wings3d.com/ Wings3D] or a similar program. |
||
+ | |||
+ | *For Blender specifically see [http://aegidian.org/bb/viewtopic.php?f=4&t=10041 Blender 3d Modeling Tutorials] (2011) - and see also [https://cgcookie.com/learn-blender cgcookie.com] |
||
How you do this is up to your creativity, but [[User:Aegidian|Aegidian]] has created the following tutorial for Wings3D. |
How you do this is up to your creativity, but [[User:Aegidian|Aegidian]] has created the following tutorial for Wings3D. |
||
Line 113: | Line 117: | ||
One important thing to remember is that [[Shipdata.plist#frangible|frangibility]] is defined for the main entity, not seperately for every SE. |
One important thing to remember is that [[Shipdata.plist#frangible|frangibility]] is defined for the main entity, not seperately for every SE. |
||
+ | |||
+ | [[File:Lib MatFinder Pos01.png|right|320px]] |
||
+ | [[File:Lib MatFinder Pos02.png|right|320px]] |
||
+ | [[File:Lib MatFinder.png|right|320px]] |
||
+ | == Tool: Library MatFinder == |
||
+ | Svengali wrote a special add-on for Library - "a helper to set and test materials entries" - which inter-alia enables locating the exhaust and weapons on your ship model. |
||
+ | |||
+ | You need [[Library]] loaded as well. A new '''development''' sub-heading will appear on your docked F4 screen which will allow you to choose any ship model loaded and to analyse it. |
||
+ | |||
+ | '''Warning''': this was cut and pasted here by an ignoramus who recognised its importance, but does not understand any of it! |
||
+ | |||
+ | === Version 1.0 === |
||
+ | "It only works with the plain materials thing at the moment, because I wrote it to migrate from custom shaders to the default shader (as much as possible). Reason is that shader swapping is a 1st class performance killer and getting rid of a few custom shaders is surely a good thing. The tool also disables shaders in use to force use of Oolite's default shader, when the model gets shown on the main screens. It shows the shadered versions though when you can enter values. This is simply to show the difference between both version to give users a chance to get your material as close as possible to the 'original' version." |
||
+ | |||
+ | Multiple weapons are already supported, positions and orientations of subentities is on the to-do list. |
||
+ | |||
+ | === Version 1.1 === |
||
+ | :- Added note by a_c about gloss+specular |
||
+ | :- Choices left aligned |
||
+ | :- Handling for disallowed models via conditions |
||
+ | :- Added Mode: Positions. Handling and logging for aft_eject_position, exhaust, missile_launch_position, scoop_position, view_position_aft, view_position_forward, view_position_port, view_position_starboard, weapon_position_aft, weapon_position_forward, weapon_position_port, weapon_position_starboard. The Positions mode requires shader support to visualize them. |
||
+ | :- Testmode for view_positions |
||
+ | :- Search for entity |
||
+ | |||
+ | For details & download link see the BB thread for his Library.oxp [http://www.aegidian.org/bb/viewtopic.php?p=265554#p265554 here] |
||
+ | |||
+ | == Important comment from a_c == |
||
+ | Decide what your ship should look like early on. Decide on the type of materials you need for each single part of it. Don't just go with it thinking that you just need to "dress it up" with a texture. If you do, it will most likely end up looking like the texture is a piece of coloured paper wrapped around a model. [http://www.aegidian.org/bb/viewtopic.php?p=271594#p271594 Some lighting and material tips] ([[User:Another_commander|Another_commander]] 2020) |
||
== Links == |
== Links == |
||
Line 118: | Line 150: | ||
* [[Oolite_Converters|Converter scripts]] - helpers for models and plists. |
* [[Oolite_Converters|Converter scripts]] - helpers for models and plists. |
||
* [[Materials_in_Oolite]] - further infos about textures in Oolite. |
* [[Materials_in_Oolite]] - further infos about textures in Oolite. |
||
+ | * [[Quaternion]] |
||
+ | |||
+ | * [http://aegidian.org/bb/viewtopic.php?f=4&t=15156 noob: my own ship] (2013+) - getting started! |
||
+ | * [http://www.aegidian.org/bb/viewtopic.php?p=30982#p30982 Some tips] (2007) by [[User:Arexack|Arexack]] |
||
+ | * [https://www.youtube.com/user/MrDertien/videos YouTube classes in Wings3D] (2013-4) by [[Dertien]] |
||
+ | * [http://aegidian.org/bb/viewtopic.php?p=264830#p264830 Putting it all together] (2018) by [[User:Phkb|Phkb]] |
||
+ | |||
+ | * [[OXP howto texture]] - texturing your new model |
||
− | [[Category:Oolite]] |
+ | [[Category:Oolite]] [[Category:Factual]] [[Category:Oolite scripting]] |
Latest revision as of 01:41, 3 December 2021
Contents
Create your model
in Wings3D or a similar program.
- For Blender specifically see Blender 3d Modeling Tutorials (2011) - and see also cgcookie.com
How you do this is up to your creativity, but Aegidian has created the following tutorial for Wings3D.
If you've read the tutorial above it's time to think about a few more things.
Optimize
Optimizing models and textures for a game is no fun, specially if it's a model with lots of greebles and funny details.
Simple example
So let's stick with a simple example - a simple cone combined with a cube. When creating the UV-Map in Wings3D this map is really in no way optimized. Doing optimizations as postprocess is a real pain, believe me .-)
Let's say you have created a model in Wings3D (pic 1) and created the UV-Map (pic 2). You can see that Wings3D does some preparations for you, e.g. the UV information is taking place in the maps area and the polygons are separated (in chunks), based on the method you've used to create the UV-Map. It's a good starting point but far away from a optimum for a game.
Wasted texture informations
You can see in a few OXPs background images in the UV-Maps (pic 3). This is just wasted texture information, results in bigger filesizes and and makes optimization tools pretty senseless. These tools are using Deflate, LZ77, RLE (Run-length_encoding) and other algorithms to optimize the texture information streams in the maps. Better use a solid color (black, grey or white).
Wasted faces
Wings3D is a box-modeller and creating objects in Wings3D always results in closed objects. Result is that quite a few faces are just wasted (pic 4), because they are not visible at all, but still eating memory and processing time. This can easily go in a few thousands of faces when a lot of models are used in installed OXPs. Luckily there's a way as Wings3D provides a hole material. This is a special feature to reduce the amount of data when exporting the model as .obj as the faces won't appear in the exported model and UV-Map.
Resort the map
The next step is to resort (and sometimes scale) the polys in the UV-Mapper. Best practice is to leave a little bit space between polys (pic 5). This is a lesson I had to learn with my models. I was always wondering why some artifacts appeard at the edges and why the mipmapping doesn't work properly.
Mipmapping
To get it working properly expand the areas with real texture information by a few pixels (pic 6). Oolite will do the mipmapping (if its available) automagically. Mipmapping or Level of Detail (LOD) is a antialiasing technique to improve the quality when textures are minified / magnified. See Mipmap for more infos.
Tesselation is evil
And last but not least tesselation (or subdivision) is evil if its used to smooth objects appearance. We can see it in a growing number of released OXPs, and it is really the worst case. Tesselation (pic 7) is a time eater for a game as it increases vertex and face counts a lot and often enough results in higher texture sizes. Both are adding time to the setup of entities whenever they are spawned in the game. Oolite handles smooth groups and hard/soft edges so in most cases there is absolutely no need to raise v/f counts. A really simple example how to use the smoothing option in combination with materials entries in Oolite can be found in the RVandGS.oxp.
Details and Greebles
Another point to consider is if a detail has to be done in the model itself or if this can be placed in a normal map.
Export the model
to obj( mtl texture) and convert to *.dat format.
The picture above shows 3 simple steps to export the model and use one of the converter scripts to get the .dat file.
- If you have the Wings stuff ready for export (means a model with UV-Map), simply use the Wavefront (obj) exporter (Step 1+2). You'll need to configure it as shown in Step 2. Once exported you have three files (.obj, .mtl and .png).
- Copy the
Obj2DatTexNorm.py
to your folder where the model has been saved to. - Open a shell and switch to the folder with the model (and script) and type in:
Obj2DatTexNorm.py mymodel.obj
(Step 3).
Please note that the converter script Obj2DatTexNorm.py needs Python 2.7 or higher (but doesn't work out of the box with 3.x!!). There is still Obj2DatTexNorm.py
available which will work with Python 2.5, but the recommended tool is Obj2DatTexNorm.py
.
Edit shipdata.plist
Supply the in-game values relevant to your model.
Subentities
Entities can have sub-entities, which are defined by quaternions. There are several types of SE:
- Model Entities: can be any model, with any properties.
- Turrets: are a specialised model entity.
- Flashers: blinking lights
- Exhausts: although they are defined seperate from subentities, they can be regarded as subentities.
One important thing to remember is that frangibility is defined for the main entity, not seperately for every SE.
Tool: Library MatFinder
Svengali wrote a special add-on for Library - "a helper to set and test materials entries" - which inter-alia enables locating the exhaust and weapons on your ship model.
You need Library loaded as well. A new development sub-heading will appear on your docked F4 screen which will allow you to choose any ship model loaded and to analyse it.
Warning: this was cut and pasted here by an ignoramus who recognised its importance, but does not understand any of it!
Version 1.0
"It only works with the plain materials thing at the moment, because I wrote it to migrate from custom shaders to the default shader (as much as possible). Reason is that shader swapping is a 1st class performance killer and getting rid of a few custom shaders is surely a good thing. The tool also disables shaders in use to force use of Oolite's default shader, when the model gets shown on the main screens. It shows the shadered versions though when you can enter values. This is simply to show the difference between both version to give users a chance to get your material as close as possible to the 'original' version."
Multiple weapons are already supported, positions and orientations of subentities is on the to-do list.
Version 1.1
- - Added note by a_c about gloss+specular
- - Choices left aligned
- - Handling for disallowed models via conditions
- - Added Mode: Positions. Handling and logging for aft_eject_position, exhaust, missile_launch_position, scoop_position, view_position_aft, view_position_forward, view_position_port, view_position_starboard, weapon_position_aft, weapon_position_forward, weapon_position_port, weapon_position_starboard. The Positions mode requires shader support to visualize them.
- - Testmode for view_positions
- - Search for entity
For details & download link see the BB thread for his Library.oxp here
Important comment from a_c
Decide what your ship should look like early on. Decide on the type of materials you need for each single part of it. Don't just go with it thinking that you just need to "dress it up" with a texture. If you do, it will most likely end up looking like the texture is a piece of coloured paper wrapped around a model. Some lighting and material tips (Another_commander 2020)
Links
- List of software - useful tools.
- Converter scripts - helpers for models and plists.
- Materials_in_Oolite - further infos about textures in Oolite.
- Quaternion
- noob: my own ship (2013+) - getting started!
- Some tips (2007) by Arexack
- YouTube classes in Wings3D (2013-4) by Dertien
- Putting it all together (2018) by Phkb
- OXP howto texture - texturing your new model