User Tools

Site Tools


This is an old revision of the document!



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/18/d28239263/htdocs/cafu/docs/inc/parser/handler.php on line 1552

What is it? An Introduction

The Ca3DE Material System is the central rendering subsytem of the Ca3D-Engine and of its graphical tools like CaWE, the model viewer, the terrain viewer, and so on. It takes polygonal meshes of geometry and renders them on the screen. While doing so, it is responsible for the materials that their surfaces show. Said differently, it defines how the rendered polygons eventually look.

The Material System is not involved with or responsible for what gets rendered, when it is rendered, how the meshes are spatially formed or organized, etc.

Features of a MatSys

FIXME Explain: Why? Purpose? Goals?

Renderers

The MatSys is shipped in several separate modules. Each module offers the same features, but they are different in that each is implemented basing on a different underlying technology. These modules are called the Renderers of the Ca3DE MatSys. For example, a MatSys renderer exists that is based on OpenGL 1.2, another is based on the latest programmable GPU features and others are somewhere in the middle. In fact, Ca3DE ships with several of them, and it uses the MatSys by using effectively one of the renderers.

Technically, renderers are dynamically loaded libraries (.dll files on Windows systems), and you can find them in the Renderers/ subdirectory of the demo or SDK. When the Ca3D-Engine or another program starts, it first scans the list of all available renderers, automatically selects the one that is the best (or most appropriate) for your system, and then loads it (this specific instance of the Material System) for use.

This way it does not matter wether your computer is very old or the latest leading-edge system, wether it uses OpenGL, Direct3D or software-only rendering or if it is running Windows or Linux: You always get the best possible graphical output!

Materials

Materials define what surfaces look like and what features a surface has, and if you are interested in Ca3DE editing, you'll most likely get in touch with them.

For example, mappers assign materials to world geometry in order to give all objects the look and feel that they want. Modellers often create new materials for the creatures that they create, and then assign them to the polygonal meshes of their model.

When it comes to rendering, the Ca3D-Engine takes both the meshes and their assigned materials, and hands them to the Material System. The MatSys then does it's best to render the mesh with that material as accurately as possible on the available technology.

Each material is referred to by its name, and is defined in a material definition script file. These files have the suffix .cmat and can contain the definition of one or more materials. They are simple ASCII text files, and you can find many examples in the Games/DeathMatch/Materials/ subdirectory of the demo or SDK.

Here is an example of a material definition from Games/DeathMatch/Materials/Kai.cmat:

    Textures/Kai/3r_metpan01
    {
        diffusemap  Textures/Kai/3r_metpan01_diff.png
        normalmap   Textures/Kai/3r_metpan01_norm.png
        specularmap Textures/Kai/3r_metpan01_spec.png
        lightmap    $lightmap
    }

Creating and using materials is explained in great detail elsewhere in this documentation.

matsys/introduction.1126727707.txt.gz ยท Last modified: 2013-01-07 12:07 (external edit)