Artists Guide: Difference between revisions

Ringwaul (talk | contribs)
Ringwaul (talk | contribs)
Line 63: Line 63:
'''Using the Exported Files'''[[File:ExportedFiles.png|250px|thumb|right|Typical exported files before user modification.]]
'''Using the Exported Files'''[[File:ExportedFiles.png|250px|thumb|right|Typical exported files before user modification.]]
Once you have exported the mesh, some files will be created in the chosen directory. Follow these steps:
Once you have exported the mesh, some files will be created in the chosen directory. Follow these steps:
*Rename the “ .mesh” file to “Graphics.mesh”.  
*Make sure the “ .mesh” file is named “Graphics.mesh”.  
*If you did not use the XML Converter, rename the “ .mesh.xml” file to 'Graphics.mesh.xml' (The “ .mesh” and “ .mesh.xml” files will be named after the object exported from blender. i.e. 'Cube.mesh')
*If you exported the OGRE files to a temporary directory, copy 'Graphics.mesh', the ' .skeleton' file, the 'Scene.material' file, and any textures used by the mesh to your object definition.
*If you exported the OGRE files to a temporary directory, copy 'Graphics.mesh', the ' .skeleton' file, the 'Scene.material' file, and any textures used by the mesh to your object definition.
*If you have exported the OGRE files directly to your object definition, you can delete all .xml files and the .log file.
*If you have exported the OGRE files directly to your object definition, you can delete all .xml files and the .log file.

Revision as of 02:29, 12 March 2012

There are three main areas where artists can contribute: Modelling 3D objects and the texturing thereof, which requires different skills and doesn't need to be done by the same person. Most of our modellers use Blender, however which modeller you use is not important as long as it can export meshes to the OGRE format. For creating scenario backgrounds, textures for models, scenario decoration and stuff, we actually need people who are good with Photoshop, GIMP or any other image manipulation software. Also, we are in desperate need for people who are talented at creating sounds and/or music.

Have a look in the art workshop and the sound studio in the forum.

Modelling

The mesh of the foundry

We got rid of the old graphics from Clonk Rage which were so tiny that it was already hard to play the game in a proper resolution. (The character you control smaller than a mouse cursor? Come on!) For OpenClonk, the graphics are about three times as big and detailed as in the old Clonk series.

Unlike in previous clonk titles, most objects are actually models that are rendered in game. The file format we use for this is the OGRE format as it is a format designed to be used in games plus all important modellers can export into this format. However, we do exchange of the models in their native format (mostly .blend).

Now, for creating models that are to be rendered ingame (in OpenClonk), there are a few additional things that have to be considered if you are used to creating models that are rendered before the start of the game. Apart from the polygon count, for each model we only use one UV-mapped texture rather than zillion materials with different colors/googled textures. More guidelines on how to create a real time model for OpenClonk can be read here: Modelling Workflow.

You might ask yourself if there is a guideline of how many polygons a model should max have. Yes, there is one: So many, that the object looks both good ingame with a 3x zoom and on it's picture graphic (whichever is bigger). Also, unanimated inventory items like materials don't need to be rendered ingame. As sprites, the polygon count doesn't matter.

Also, if you want to contribute a model, please always include the 3D-model when you attach a rendering of the same to your post. Otherwise, if you somehow lose your model, all the work was in vain.

Textures

UV mapped texture of the foundry
Foundry with mesh and texture

We use the CC-by licence for OpenClonk and ask you to license your contributions under the same license. As many textures in texture archives have licenses which are not compatible with CC-by, we will have to create many textures on our own. But don't worry, it's quite easy and there are some really good tutorials on how to create quality textures from photos.

Here is a list of bigger texture archives and it's licenses which is a good source for resources: Texture Archives

My experience is that textures for 3D-models which are based on actual photos always turn out better then textures which where painted by oneself.

You might also ask yourself if there is a guideline of how big the texture for one 3D-model should be. Right: So big that it doesn't look blurred ingame with a 3x zoom and on it's picture graphic (whichever is bigger).

For material textures, we need seamless textures. Regarding this, there are different methods to create seamless textures from (a set of) photos, here is how I do it: Tutorial: Creating Seamless Textures. For GIMP, there are two filters which can do this automatically: The plugin Texturize and the filter Resynthesise. Both work good with textures with small random patterns like gravel, plaster, sand or ground. However, they don't produce quite as convincing results for bigger regular patterns like (roofing) tiles, bricks, wickerwork, pavements etc. The manual method that I proposed always produces better results and if you are experienced in this, it's a thing of five minutes.

Exporting Meshes

Exporting a model properly for OpenClonk can be a tricky process, but we've compiled a step-by-step guide on how to do so.

Firstly, you'll need the proper tools. For Blender 2.49b, you'll need the OGRE Exporter. Randrian has created an improved version of the OGRE Exporter which adds critical features necessary for animation blending. Download Link

  • Extract the OGRE Exporter into your .blender/scripts/ folder.
  • Install Python 2.6.2
  • Obtain the OGRE XML Converter software, bundled inside the OGRE Command Line Tools package (look in 'See Also' box for download).
  • Extract the OGRE Command Line Tools somewhere easily accessible (ie: C:\OgreCommandLineTools).
  • Load up blender, and create a new window and set the window type to 'Scripts Window'. Then click File>Export>OGRE Meshes to load the exporter GUI into that window.
  • Hit the 'Preferences' button in the OGRE GUI. Set the location of the OGRE XML Exporter to Manual, and link to the location of the OgreXmlConverter.exe.
  • In the directory of your .blend file, create an empty Actions.txt file. More on this later.

By following these steps, you should be able to properly export models for OpenClonk. If you run into any problems, leave a post on the forum addressing the issue.

Guidelines for Modelling

  • Model on the Y/Z view-plane. Models in OpenClonk appear as they do on the Y/Z plane in blender. The X-Axis goes 'into' the screen. Make sure you model with regard to these axes (The Y/Z plane is the default side view in Blender).
  • Do not use Mesh Transformations. Mesh transformations are not handled properly by the OGRE exporter, and will cause deformation in game. If you have transformations applied to an existing model, you can remove them (select the model and press alt+g, alt+s, alt+r). Caution: Avoid animating before removing transformations!
  • 3D Model must be Three-Dimensional. The 3D mesh must have length on all axes. Making a perfectly flat object on only two axes will cause it to not appear in-game. To fix this, move a vertex so the mesh has length on all axes.
  • Avoid edges with more than two faces connected to them. Edges with more than two faces will cause shading errors in game. An easy way to circumvent this is to separate the third face from the edge, so it is close to the original edge, but not connected.
  • What features work with the OGRE format? Not all of the features listed in Blender will affect an exported 3D OGRE mesh. For a full list of compatible features, visit: http://www.cs.ucr.edu/~macchiea/cs134/lab1/ogrehelp/ogremeshesexporter.html


Exporting the Model

The OGRE Exporter frame in Blender

To export the model, you'll need to have a window for the OGRE exporter in Blender. Make a new pane for scripts, and click 'File/Export/OGRE Meshes'. Models used for OpenClonk must be exported with specific options.

  • “Fix Up Axis to Y” should not be enabled.
  • If you have the XML converter, make sure “OgreXMLConverter” is enabled.
  • If you have already made manual modifications to the Scene.material file and are re-exporting the mesh and/or skeleton, make sure 'Export Materials' is not enabled.
  • 'Path:' will be where the OGRE files are exported to. You can use a temporary directory and then copy them into your OpenClonk object definition, or you can export the OGRE files directly into the object definition.


Using the Exported Files

Typical exported files before user modification.

Once you have exported the mesh, some files will be created in the chosen directory. Follow these steps:

  • Make sure the “ .mesh” file is named “Graphics.mesh”.
  • If you exported the OGRE files to a temporary directory, copy 'Graphics.mesh', the ' .skeleton' file, the 'Scene.material' file, and any textures used by the mesh to your object definition.
  • If you have exported the OGRE files directly to your object definition, you can delete all .xml files and the .log file.


Scene.material

Scene.material is the file which defines which materials to apply to meshes. Manually modifying Scene.material is crucial to the mesh appearing properly in game. When you export (assuming you are using a texture) your Scene.material file will look more or less like this (don't worry if it looks somewhat different):

material MyCube
{
     receive_shadows on
     technique
     {
          pass
          {
               cull_hardware none
               ambient 0.500000 0.500000 0.500000 1.000000
               diffuse 0.640000 0.640000 0.640000 1.000000
               specular 0.500000 0.500000 0.500000 1.000000 12.500000
               emissive 0.000000 0.000000 0.000000 1.000000
               scene_blend alpha_blend
               texture_unit
               {
                    texture MyCube.png
                    tex_address_mode wrap
                    filtering trilinear
               }
          }
     }
}
  • If 'depth_write off' exists, delete that line.
  • If you are using alpha, make sure 'scene_blend alpha_blend' exists (as shown above).
  • If your mesh has visible backface(s), make sure to add 'cull_hardware none' (as shown above).
  • Depending on the method you used to define alpha in blender, the 'pass' section in Scene.Material may look like this:
pass
{
     ambient 0.500000 0.500000 0.500000 0.000000
     diffuse 0.640000 0.640000 0.640000 0.000000
     specular 0.500000 0.500000 0.500000 0.000000 12.500000
     emissive 0.000000 0.000000 0.000000 0.000000
     ...

If so, make sure the fourth parameter on ambient, diffuse, specular, and emissive is '1.00000', not '0.000000' (as shown in the 'material MyCube' example).

Actions.txt

This file controls what animations are exported, which frames of said animations, and which bones will be affected by the exported animations. Most often than not you will not need to use this functionality; your Actions.txt file could simply resemble this:

[Action]
Name=Open

[Action]
Name=Close

[End]

Other tags available for an [Action] include 'Start=', 'End=', 'ExportName=', and 'Group='.

Start and End will define the frames (in blender) that will be exported. ExportName will simply change the name of the Action on export (Useful if you have multiple versions of an animation but only need one exported).

A group is a special filter used to stop bones from affecting the exported animation. For example, if we want an aiming animation to only affect the upper body, or a blinking animation to only affect the character's eyelids. Groups can either use the 'Include=' tag or 'Exclude=' tag.

As an example, a group which only affects the eyelids of the Clonk:

[Group]
Name=Eyelids
Include=eye_lid.R
Include=eye_lid.L

This would make the exported animation only control the eye_lid.* bones and nothing else. Conversely, using the 'Exclude=' tag makes the animation use every bone excluding those defined. As an example:

[Group]
Name=UpperBody
Exclude=skeleton_leg*
Exclude=skeleton_foot*

Defining the group in an Action entry is fairly simple; just add the tag 'Group=' and enter the group's name. For example:

[Action]
Name=CloseEyes
Group=Eyelids

For an example of a finished Actions.txt file, this is the Catapult's.

Sounds & Music

Any game is only half as good without proper sounds and music. If you played the titles of the old Clonk series, you will probably still suffer from the memories of the midi music from the last millenium, like "Pizza strings" or "On a razor blade". Anyway. So we need both people who are good at creating, editing (and searching) sound effects and talented people who can make music for OpenClonk. There are some sound archives out there which have CC-licensed sound effects, also it can't hurt to ask the authors of one of the many many mods for commercial games if we are allowed to use their sounds under the terms of a CC-license (preferably CC-by).