source: OGRE/trunk/ogrenew/Docs/manual/manual_11.html @ 657

Revision 657, 5.5 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1<HTML>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3<!-- Created on , 12 2006 by texi2html 1.64 -->
4<!--
5Written 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.
9Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
11 
12-->
13<HEAD>
14<TITLE>OGRE Manual v1.0.7: Materials</TITLE>
15
16<META NAME="description" CONTENT="OGRE Manual v1.0.7: Materials">
17<META NAME="keywords" CONTENT="OGRE Manual v1.0.7: 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"> &lt; </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"> &gt; </A>]</TD>
31<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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
41The 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
44Materials 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_15.html#SEC24">3.1 Material Scripts</A> for more info.<BR><BR>
45</P><P>
46
47Basically everything about the appearance of an object apart from it's shape is controlled by the Material class.<BR><BR>
48</P><P>
49
50The 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>
55ambient reflectance = ColourValue::White (full)
56<LI>
57diffuse reflectance = ColourValue::White (full)
58<LI>
59specular reflectance = ColourValue::Black (none)
60<LI>
61emmissive = ColourValue::Black (none)
62<LI>
63shininess = 0 (not shiny)
64<LI>
65No texture layers (&#38; hence no textures)
66<LI>
67SourceBlendFactor = SBF_ONE, DestBlendFactor = SBF_ZERO (opaque)
68<LI>
69Depth buffer checking on
70<LI>
71Depth buffer writing on
72<LI>
73Depth buffer comparison function = CMPF_LESS_EQUAL
74<LI>
75Culling mode = CULL_CLOCKWISE
76<LI>
77Ambient lighting in scene = ColourValue(0.5, 0.5, 0.5) (mid-grey)
78<LI>
79Dynamic lighting enabled
80<LI>
81Gourad shading mode
82<LI>
83Bilinear texture filtering
84</UL>
85<P>
86
87You can alter these settings by calling SceneManager::getDefaultMaterialSettings() and making the required changes to the Material which is returned.
88</P><P>
89
90Entities 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().
91</P><P>
92
93<A NAME="Overlays"></A>
94<HR SIZE=1>
95<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
96<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_10.html#SEC13"> &lt; </A>]</TD>
97<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_4.html#SEC4"> Up </A>]</TD>
98<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_12.html#SEC15"> &gt; </A>]</TD>
99<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
100<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_toc.html#SEC_Contents">Contents</A>]</TD>
101<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
102<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="manual_abt.html#SEC_About"> ? </A>]</TD>
103</TR></TABLE>
104<BR> 
105<FONT SIZE="-1">
106This document was generated
107by <I>Steve Streeting</I> on <I>, 12 2006</I>
108using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
109"><I>texi2html</I></A>
110
111</BODY>
112</HTML>
Note: See TracBrowser for help on using the repository browser.