[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnubg] Designs and textures

From: Jon Kinsey
Subject: [Bug-gnubg] Designs and textures
Date: Tue, 23 Mar 2004 11:34:29 +0000
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

I've checked in the last few 3d designs and also updated the texture files. This means that boards.xml, textures.txt and most of the texutres have changed (from bmp to png format). I may well have missed something...

I've gone for variety (rather than quality perhaps), so if anyone wants to have a go at improving them or adding new ones, feel free to send me the new designs and I'll check them in. Have a look at the attached file if you're interested in creating new textures.


Most of the materials (except the dice) can have a texture assigned to them.

Texture format
The texture files can be in png (portable network graphic) or bmp (device 
independent bitmap) format.
The png format is better as it's stored in a compressed form.

The images must be a square shape and a power of 2 in size, e.g. 64x64, 128x128.

The textures can contain any colours and the final display is a combination of 
the texture colour and the chosen appearance colour settings.
Greyscale images are good as this means that the colour settings will be shown 
as expected.  Although this means only shades of the selected colour will be 
shown so 24 bit images can be used if multiple colours are required.

The final colour displayed is a combination of the colours (ambient, diffuse 
and specular) and the colour of the texture.
A white dot corresponds to the colour selected in the appearance dialog and a 
black dot will come out black.
Keep the texture light in general (avoid large dark/black areas).
Both chequers share the same texture setting, which can only be set from 
chequer 0.

Available textures
The list of available textures is stored in a file called textures.txt.
The first line is the version of the file and should be ignored.
Each texture then has four lines;
        The file name (limited to 15 characters),
        The format of the file,
        The display name (limited to 20 characters)
        The type.
The format can be bmp or png, note that this is used rather than the file 
extension of the file name.
There are three types of textures: General, Hinge, and Piece.  The type just 
effects which objects can select that texture in the appearance dialog.

3d Designs
The material of each part of the board is made up of several parts, detailed 

Ambient colour
The ambient colour of a material is the colour shown when lit by ambient light.
Ambient light is constant throughout the scene, so this colour doesn't vary.
The amount of ambient light is based on the ambient light level setting.

Diffuse colour
The diffuse colour of a material is the colour shown when lit by diffuse light.
Diffuse light comes from a direction (either the light source or reflected off 
a surface), so this colour varies depending on the light source position and 
the angle of the lit surface.  This effectively adds shading to the objects.
The amount of diffuse light is based on the diffuse light level setting.

Specular colour
The specular colour of a material is the colour shown when the surface is shiny.
Specular light bounces off a surface at a particular angle based on the viewers 
position.  This produces specular highlight effects.
The amount of specular light is based on the specular light level setting.

The lower the shininess setting the shinier the material.  With 0 being very 
shiny and 128 quite dull.

The chequers and dice have an extra setting that defines how opaque/transparent 
they are.

The ambient and diffuse colours make up the main colour of the object.
The specular colour and shininess setting define how shiny each object is.
To remove all specular effects from an object set the specular colour to black.
The final colour displayed is a combination of all these components.
The light position, light type and light levels get stored for each design.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]