User Tools

Site Tools


gamedev:skinproperties

Start Page » Game Development with the Drag[en]gine » Skin Texture Properties

Skin Texture Properties

The Drag[en]gine game engine uses a very open and flexible way to handle skins for models. Instead of defining hard coded material properties that can not be changed any more the principle of Dynamic Texture Properties is used. A texture property defines one property of a material the texture composes of. A texture property is identified by a unique name which defines what corresponding material property is altered. The names are not defined by the game engine itself. They can be chosen arbitrarily as long as the various modules (Graphic, Audio and Physics) and artists attribute the same meaning to the same names. For this purpose a list of texture properties is maintained here providing texture property names and their intended use. Modules and artists should stick to this list of texture properties for existing property names but can of course introduce new ones to enhance the engine.

The default skin texture format is XML based and can be edited by hand or generated. It is easier though to use the Skin Editor (*.deskin) to edit these resources. This editor provides also a visual preview of the edited skin and also provides support to test Dynamic Skin functionality before using the skin in-game.

Properties can define a material property in various ways.

Static Value

Defines a static value for a property. Static values are different from colors in that they can have any value outside the range from 0 to 1. Colors on the other hand are limited to this range since images can not define colors with values outside this range.

Static Color

Defines a static color for a property. In contrary to static values a color can only hold values between 0 and 1 inclusive for all 4 components. Many properties require only 3 components ( RGB colors ) in which case the 4th component is left unused.

Image

Defines the property using an image. The UV coordinates stored in a mesh are used to index into the image. The range of UV coordinates is matched to the size of the texture with uv=(0,0) being the upper left corner and uv=(1,1) the lower right corner. The format of the image can be 8-bit gray scale ( often called intensity images ), 32-bit RGB ( 3-color image ) or 32-bit RGBA ( 3-color image with alpha channel ). In memory the image is arranged in the same way in row order from left to right and top to bottom without any padding. Specifying a static color for an image is allowed but not the other way around.

Video

Defines the property using an video. The UV coordinates stored in a mesh are used to index into the video images. The range of UV coordinates is matched to the size of the video with uv=(0,0) being the upper left corner and uv=(1,1) the lower right corner. The format of the video can be 8-bit gray scale, 24-bit RGB or 32-bit RGBA. A video is automatically played back using a play speed relative to the update calls done to the world object containing a component with a video texture property. In contrary to videos used over renderables the control over static videos is limited. Specifying a static color for an video is allowed but not the other way around.

Constructed

Constructed type allows to build images for properties using a CAD like interface. The graphic module creates the final images for use with textures from the constructed image at runtime. This allows to create modifications of existing textures or assembling complex textures from shared images without the need to go through a full art production pipeline. Furthermore constructed textures are useful to create 3 dimensional images.

Renderables

In addition each texture property can be assigned a renderable name. Using static colors or images a texture is static and has the same look all the time. Using renderables though you can change individual texture properties on the fly during a game. The renderable name is not required to be unique and allows therefore to use a renderable content for more than one texture property simultaneously. Once specified the user can add a renderable to a component and fill it with appropriate values. A renderable overrules the static property as soon as the renderable name is not empty and a component contains a dynamic skin with a renderable of the same name. You can thus use a renderable to dynamically alter a texture property or let it be static if not used. This gives a lot of flexibility even if you don't know if a component is actually going to provide dynamic content or not.

Transforms

Each property can have a transfrom assigned. Transform are used to manipulate the incoming texture coordinates before they are used for texturing. Transforms are similar to sources in that they are also organized in a tree shape. The advantage of transforms is that they are very fast and produce textures looking dynamic although they are not. Whenever possible use first a transform to animate a texture and resort to renderables or even sources only if there is no other way.

Examples

Using a Video Source to create a Special Effects texture.

Using a Constructed Source to create a texture on the fly.

You could leave a comment if you were logged in.
gamedev/skinproperties.txt · Last modified: 2019/05/24 23:43 by dragonlord