can you elaborate on the details of the material class, its implementation of decals, texturing, color, whatever other parameters? tia
-s
Decals, Materials and Texturing
Re: Decals, Materials and Texturing
At the moment the Material class is quite simplistic.
It supports separate diffuse, ambient, specular and emissive colors, which of course blend in with both the ambient light and the light sources in the scene. It has a separate opacity value, which can range from 0.0f to 1.0f. And a power (exponent) which defines the specular shininess.
Then you can specify a texture in 'baseMap', using the familiar 'Bitmap' object (which you can obtain from a loaded BitmapResource). The bumpMap and envMap are meant to be used for bump mapping and environment mapping, but are currently not implemented in any driver. Texture coordinates are specified in the Mesh class.
The flags 'member' lets you specify boolean options, such as whether the rendered geometry should be doubleSided, whether extra care should be taken because it is translucent, whether the texture should be tiled, whether fog should be applied, whether light computations should be done on a single side...
Materials, textures and meshes can be managed in a DisplaySystem by name using the methods AddMaterial(), GetMaterial(), RemoveMaterial(), ClearMaterials(), AddNamedMaterial(), AddTexture(), GetTexture(), RemoveRexture(), ClearTextures(), AddMesh(), RemoveMesh(), ClearMeshes(). Note that is is purely provided for convenience purposed and is fully optional. The 3DS model loader however will make use of this automatically (for textures and materials). Remember that multiple displays of the same type share a same DisplaySystem, so that e.g. you can have multiple OpenGL windows sharing all the same data. In full screen mode there is actually only one Display, and obviously only one DisplaySystem as well.
A material is usually set on a Mesh's PrimitiveGroup. It can also be set on an Object as a default for PrimitiveGroups that do not specify a material. ApplyMaterial() can be used to apply a material to all groups in a mesh. ApplyTranslucency() should be called on a mesh (after having properly set the 'translucent' flag to true in the translucent materials) so that translucency is rendered properly.
Code: Select all
public class MaterialFlags { public bool doubleSided:1, translucent:1, tile:1, noFog:1, singleSideLight:1; };
public class Material : struct
{
public:
Material prev, next;
char * name;
float opacity;
ColorRGB diffuse;
ColorRGB ambient;
ColorRGB specular;
ColorRGB emissive;
float power;
Bitmap baseMap;
Bitmap bumpMap;
Bitmap envMap;
MaterialFlags flags;
};
Then you can specify a texture in 'baseMap', using the familiar 'Bitmap' object (which you can obtain from a loaded BitmapResource). The bumpMap and envMap are meant to be used for bump mapping and environment mapping, but are currently not implemented in any driver. Texture coordinates are specified in the Mesh class.
The flags 'member' lets you specify boolean options, such as whether the rendered geometry should be doubleSided, whether extra care should be taken because it is translucent, whether the texture should be tiled, whether fog should be applied, whether light computations should be done on a single side...
Materials, textures and meshes can be managed in a DisplaySystem by name using the methods AddMaterial(), GetMaterial(), RemoveMaterial(), ClearMaterials(), AddNamedMaterial(), AddTexture(), GetTexture(), RemoveRexture(), ClearTextures(), AddMesh(), RemoveMesh(), ClearMeshes(). Note that is is purely provided for convenience purposed and is fully optional. The 3DS model loader however will make use of this automatically (for textures and materials). Remember that multiple displays of the same type share a same DisplaySystem, so that e.g. you can have multiple OpenGL windows sharing all the same data. In full screen mode there is actually only one Display, and obviously only one DisplaySystem as well.
A material is usually set on a Mesh's PrimitiveGroup. It can also be set on an Object as a default for PrimitiveGroups that do not specify a material. ApplyMaterial() can be used to apply a material to all groups in a mesh. ApplyTranslucency() should be called on a mesh (after having properly set the 'translucent' flag to true in the translucent materials) so that translucency is rendered properly.
Re: Decals, Materials and Texturing
Your previous message didn't handle "decals"