1 | <HTML> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
3 | <!-- Created on , 12 2006 by texi2html 1.64 --> |
---|
4 | <!-- |
---|
5 | Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) |
---|
6 | Karl Berry <karl@freefriends.org> |
---|
7 | Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
8 | and many others. |
---|
9 | Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> |
---|
10 | Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> |
---|
11 | |
---|
12 | --> |
---|
13 | <HEAD> |
---|
14 | <TITLE>OGRE Manual v1.2.0 ('Dagon'): Materials</TITLE> |
---|
15 | |
---|
16 | <META NAME="description" CONTENT="OGRE Manual v1.2.0 ('Dagon'): Materials"> |
---|
17 | <META NAME="keywords" CONTENT="OGRE Manual v1.2.0 ('Dagon'): Materials"> |
---|
18 | <META NAME="resource-type" CONTENT="document"> |
---|
19 | <META NAME="distribution" CONTENT="global"> |
---|
20 | <META NAME="Generator" CONTENT="texi2html 1.64"> |
---|
21 | <LINK TYPE="text/css" rel="stylesheet" href="../style.css"> |
---|
22 | </HEAD> |
---|
23 | |
---|
24 | <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> |
---|
25 | |
---|
26 | <A NAME="SEC14"></A> |
---|
27 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> |
---|
28 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_10.html#SEC13"> < </A>]</TD> |
---|
29 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC4"> Up </A>]</TD> |
---|
30 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_12.html#SEC15"> > </A>]</TD> |
---|
31 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD> |
---|
32 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD> |
---|
33 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> |
---|
34 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD> |
---|
35 | </TR></TABLE> |
---|
36 | <HR SIZE=1> |
---|
37 | <H2> 2.7 Materials </H2> |
---|
38 | <!--docid::SEC14::--> |
---|
39 | <P> |
---|
40 | |
---|
41 | The Material object controls how objects in the scene are rendered. It specifies what basic surface properties objects have such as reflectance of colours, shininess etc, how many texture layers are present, what images are on them and how they are blended together, what special effects are applied such as environment mapping, what culling mode is used, how the textures are filtered etc.<BR><BR> |
---|
42 | </P><P> |
---|
43 | |
---|
44 | Materials can either be set up programmatically, by calling SceneManager::createMaterial and tweaking the settings, or by specifying it in a 'script' which is loaded at runtime. See section <A HREF="manual_14.html#SEC23">3.1 Material Scripts</A> for more info.<BR><BR> |
---|
45 | </P><P> |
---|
46 | |
---|
47 | Basically everything about the appearance of an object apart from it's shape is controlled by the Material class.<BR><BR> |
---|
48 | </P><P> |
---|
49 | |
---|
50 | The SceneManager class manages the master list of materials available to the scene. The list can be added to by the application by calling SceneManager::createMaterial, or by loading a Mesh (which will in turn load material properties). Whenever materials are added to the SceneManager, they start off with a default set of properties; these are defined by OGRE as the following:<BR><BR> |
---|
51 | </P><P> |
---|
52 | |
---|
53 | <UL> |
---|
54 | <LI> |
---|
55 | ambient reflectance = ColourValue::White (full) |
---|
56 | <LI> |
---|
57 | diffuse reflectance = ColourValue::White (full) |
---|
58 | <LI> |
---|
59 | specular reflectance = ColourValue::Black (none) |
---|
60 | <LI> |
---|
61 | emmissive = ColourValue::Black (none) |
---|
62 | <LI> |
---|
63 | shininess = 0 (not shiny) |
---|
64 | <LI> |
---|
65 | No texture layers (& hence no textures) |
---|
66 | <LI> |
---|
67 | SourceBlendFactor = SBF_ONE, DestBlendFactor = SBF_ZERO (opaque) |
---|
68 | <LI> |
---|
69 | Depth buffer checking on |
---|
70 | <LI> |
---|
71 | Depth buffer writing on |
---|
72 | <LI> |
---|
73 | Depth buffer comparison function = CMPF_LESS_EQUAL |
---|
74 | <LI> |
---|
75 | Culling mode = CULL_CLOCKWISE |
---|
76 | <LI> |
---|
77 | Ambient lighting in scene = ColourValue(0.5, 0.5, 0.5) (mid-grey) |
---|
78 | <LI> |
---|
79 | Dynamic lighting enabled |
---|
80 | <LI> |
---|
81 | Gourad shading mode |
---|
82 | <LI> |
---|
83 | Solid polygon mode |
---|
84 | <LI> |
---|
85 | Bilinear texture filtering |
---|
86 | </UL> |
---|
87 | <P> |
---|
88 | |
---|
89 | You can alter these settings by calling SceneManager::getDefaultMaterialSettings() and making the required changes to the Material which is returned. |
---|
90 | </P><P> |
---|
91 | |
---|
92 | Entities automatically have Material's associated with them if they use a Mesh object, since the Mesh object typically sets up it's required materials on loading. You can also customise the material used by an entity as described in <A HREF="manual_10.html#SEC13">2.6 Entities</A>. Just create a new Material, set it up how you like (you can copy an existing material into it if you like using a standard assignment statement) and point the SubEntity entries at it using SubEntity::setMaterialName(). |
---|
93 | </P><P> |
---|
94 | |
---|
95 | <A NAME="Overlays"></A> |
---|
96 | <HR SIZE=1> |
---|
97 | <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> |
---|
98 | <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_10.html#SEC13"> < </A>]</TD> |
---|
99 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC4"> Up </A>]</TD> |
---|
100 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_12.html#SEC15"> > </A>]</TD> |
---|
101 | <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD> |
---|
102 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD> |
---|
103 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> |
---|
104 | <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD> |
---|
105 | </TR></TABLE> |
---|
106 | <BR> |
---|
107 | <FONT SIZE="-1"> |
---|
108 | This document was generated |
---|
109 | by <I>Steve Streeting</I> on <I>, 12 2006</I> |
---|
110 | using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html |
---|
111 | "><I>texi2html</I></A> |
---|
112 | |
---|
113 | </BODY> |
---|
114 | </HTML> |
---|