diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03371.html | 2812 |
1 files changed, 2812 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03371.html b/docs/doxygen/nel/a03371.html new file mode 100644 index 00000000..adaa069a --- /dev/null +++ b/docs/doxygen/nel/a03371.html @@ -0,0 +1,2812 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NL3D::CShadowMapManager class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NL3D::CShadowMapManager Class Reference</h1><code>#include <<a class="el" href="a06373.html">shadow_map_manager.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A class to manage the render of shadow map. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2003 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00058">58</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera0">addShadowCaster</a> (<a class="el" href="a02316.html">CTransform</a> *model)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a ShadowCaster that influence the scene this pass. <a href="#NL3D_1_1CShadowMapManagera0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera1">addShadowCasterGenerate</a> (<a class="el" href="a02316.html">CTransform</a> *model)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera2">addShadowReceiver</a> (<a class="el" href="a02316.html">CTransform</a> *model)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a ShadowRecevier visible in this scene for this pass. <a href="#NL3D_1_1CShadowMapManagera2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera3">CShadowMapManager</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CShadowMapManagera3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera4">enableShadowPolySmooth</a> (bool enable)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Enable Polygon Smoothing. <a href="#NL3D_1_1CShadowMapManagera4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02839.html">CMaterial</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera5">getCasterShadowMaterial</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the typical Material for Caster. <a href="#NL3D_1_1CShadowMapManagera5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera6">getEnableShadowPolySmooth</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get Enable Polygon Smoothing flag <a href="#NL3D_1_1CShadowMapManagera6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera7">renderGenerate</a> (<a class="el" href="a03348.html">CScene</a> *scene)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera8">renderProject</a> (<a class="el" href="a03348.html">CScene</a> *scene)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera9">selectShadowMapsToGenerate</a> (<a class="el" href="a03348.html">CScene</a> *scene)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera10">setQuadGridSize</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>, float cellSize)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">change the QuadGrid size. it reset all the receivers! <a href="#NL3D_1_1CShadowMapManagera10"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera11">~CShadowMapManager</a> ()</td></tr> + +<tr><td colspan="2"><div class="groupHeader">Texture Allocation</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03487.html">ITexture</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerz898_0">allocateTexture</a> (<a class="el" href="a04558.html#a15">uint</a> textSize)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocate a texture for a shadowMap. NB: owned by a smartPtr. nlassert powerof2. <a href="#NL3D_1_1CShadowMapManagerz898_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerz898_1">releaseTexture</a> (<a class="el" href="a03487.html">ITexture</a> *text)</td></tr> + +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TTextureMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery0">ItTextureMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="a03273.html">CQuadGrid</a>< <a class="el" href="a02316.html">CTransform</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery1">TShadowReceiverGrid</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a03487.html">ITexture</a> *,<br> + <a class="el" href="a03408.html">CSmartPtr</a>< <a class="el" href="a03487.html">ITexture</a> > > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery2">TTextureMap</a></td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd0">applyFakeGaussianBlur</a> (<a class="el" href="a02434.html">IDriver</a> *drv, <a class="el" href="a04558.html#a15">uint</a> numPassText, <a class="el" href="a04558.html#a15">uint</a> numTextW, <a class="el" href="a04558.html#a15">uint</a> numTextH, <a class="el" href="a04558.html#a15">uint</a> baseTextureSize)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd1">clearGenerateShadowCasters</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd2">computeShadowColors</a> (<a class="el" href="a03348.html">CScene</a> *scene, <a class="el" href="a02316.html">CTransform</a> *sc, <a class="el" href="a03337.html">CRGBA</a> &ambient, <a class="el" href="a03337.html">CRGBA</a> &diffuse)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd3">computeShadowDirection</a> (<a class="el" href="a03348.html">CScene</a> *scene, <a class="el" href="a02316.html">CTransform</a> *sc, <a class="el" href="a03128.html">CVector</a> &lightDir)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd4">copyScreenToBlurTexture</a> (<a class="el" href="a02434.html">IDriver</a> *drv, <a class="el" href="a04558.html#a15">uint</a> numPassText, <a class="el" href="a04558.html#a15">uint</a> numTextW, <a class="el" href="a04558.html#a15">uint</a> numTextH, <a class="el" href="a04558.html#a15">uint</a> baseTextureSize)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd5">fillBlackBorder</a> (<a class="el" href="a02434.html">IDriver</a> *drv, <a class="el" href="a04558.html#a15">uint</a> numPassText, <a class="el" href="a04558.html#a15">uint</a> numTextW, <a class="el" href="a04558.html#a15">uint</a> numTextH, <a class="el" href="a04558.html#a15">uint</a> baseTextureSize)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd6">garbageShadowTextures</a> (<a class="el" href="a03348.html">CScene</a> *scene)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd7">setBlackQuad</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a566">index</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a572">x</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a573">y</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a575">w</a>, <a class="el" href="a04558.html#a14">sint</a> h)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd8">setBlurQuadFakeGaussian</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a566">index</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a572">x</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a573">y</a>, <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a04223.html#a575">w</a>, <a class="el" href="a04558.html#a14">sint</a> h)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerd9">updateBlurTexture</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a575">w</a>, <a class="el" href="a04558.html#a15">uint</a> h)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02839.html">CMaterial</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03408.html">CSmartPtr</a>< <a class="el" href="a03487.html">ITexture</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr3">_BlurTextureD05H</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr4">_BlurTextureD05W</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr5">_BlurTextureH</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr6">_BlurTextureOOH</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr7">_BlurTextureOOW</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02839.html">CMaterial</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03408.html">NLMISC::CSmartPtr</a>< <a class="el" href="a03487.html">ITexture</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02839.html">CMaterial</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery0">ItTextureMap</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02316.html">CTransform</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02839.html">CMaterial</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02316.html">CTransform</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">TShadowReceiverGrid</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery2">TTextureMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr21">_XYZToUWVMatrix</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr22">_XYZToWUVMatrix</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NL3D_1_1CShadowMapManagery0" doxytag="NL3D::CShadowMapManager::ItTextureMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef TTextureMap::iterator <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery0">NL3D::CShadowMapManager::ItTextureMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00166">166</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l01000">releaseTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagery1" doxytag="NL3D::CShadowMapManager::TShadowReceiverGrid" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef <a class="el" href="a03273.html">CQuadGrid</a><<a class="el" href="a02316.html">CTransform</a>*> <a class="el" href="a03273.html">NL3D::CShadowMapManager::TShadowReceiverGrid</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00120">120</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagery2" doxytag="NL3D::CShadowMapManager::TTextureMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef std::map<<a class="el" href="a03487.html">ITexture</a> *, <a class="el" href="a03408.html">CSmartPtr</a><<a class="el" href="a03487.html">ITexture</a>> > <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery2">NL3D::CShadowMapManager::TTextureMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00165">165</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CShadowMapManagera3" doxytag="NL3D::CShadowMapManager::CShadowMapManager" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NL3D::CShadowMapManager::CShadowMapManager </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00059">59</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00150">_BlurMaterial</a>, <a class="el" href="a06373.html#l00151">_BlurQuads</a>, <a class="el" href="a06373.html#l00145">_BlurTextureH</a>, <a class="el" href="a06373.html#l00144">_BlurTextureW</a>, <a class="el" href="a06373.html#l00160">_CasterShadowMaterial</a>, <a class="el" href="a06373.html#l00157">_ClampTexture</a>, <a class="el" href="a06373.html#l00140">_FillMaterial</a>, <a class="el" href="a06373.html#l00139">_FillQuads</a>, <a class="el" href="a06373.html#l00118">_GenerateShadowCasters</a>, <a class="el" href="a06373.html#l00122">_NumShadowReceivers</a>, <a class="el" href="a06373.html#l00136">_PolySmooth</a>, <a class="el" href="a06373.html#l00154">_ReceiveShadowMaterial</a>, <a class="el" href="a06373.html#l00116">_ShadowCasters</a>, <a class="el" href="a06373.html#l00155">_XYZToUWVMatrix</a>, <a class="el" href="a06373.html#l00156">_XYZToWUVMatrix</a>, <a class="el" href="a06372.html#l00047">NL3D::easeInEaseOut()</a>, <a class="el" href="a05641.html#l00337">NL3D::CMaterial::enableUserTexMat()</a>, <a class="el" href="a05968.html#l00059">NL3D::CMaterial::initUnlit()</a>, <a class="el" href="a06373.html#l00046">NL3D_SMM_QUADCELL_SIZE</a>, <a class="el" href="a06373.html#l00045">NL3D_SMM_QUADGRID_SIZE</a>, <a class="el" href="a05641.html#l00078">NL3D::CMaterial::setAlphaTest()</a>, <a class="el" href="a05641.html#l00085">NL3D::CMaterial::setAlphaTestThreshold()</a>, <a class="el" href="a05641.html#l00064">NL3D::CMaterial::setBlend()</a>, <a class="el" href="a05641.html#l00091">NL3D::CMaterial::setBlendFunc()</a>, <a class="el" href="a05641.html#l00118">NL3D::CMaterial::setColor()</a>, <a class="el" href="a05641.html#l00071">NL3D::CMaterial::setDoubleSided()</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a06372.html#l00203">setQuadGridSize()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, <a class="el" href="a05641.html#l00304">NL3D::CMaterial::setTexCoordGen()</a>, <a class="el" href="a05968.html#l00567">NL3D::CMaterial::setTexCoordGenMode()</a>, <a class="el" href="a05968.html#l00322">NL3D::CMaterial::setTexture()</a>, <a class="el" href="a06710.html#l00169">NL3D::CVertexBuffer::setVertexFormat()</a>, <a class="el" href="a05641.html#l00099">NL3D::CMaterial::setZFunc()</a>, <a class="el" href="a05641.html#l00105">NL3D::CMaterial::setZWrite()</a>, <a class="el" href="a05641.html#l00268">NL3D::CMaterial::texConstantColor()</a>, <a class="el" href="a05641.html#l00247">NL3D::CMaterial::texEnvArg0Alpha()</a>, <a class="el" href="a05641.html#l00221">NL3D::CMaterial::texEnvArg0RGB()</a>, <a class="el" href="a05641.html#l00256">NL3D::CMaterial::texEnvArg1Alpha()</a>, <a class="el" href="a05641.html#l00229">NL3D::CMaterial::texEnvArg1RGB()</a>, <a class="el" href="a05641.html#l00240">NL3D::CMaterial::texEnvOpAlpha()</a>, <a class="el" href="a05641.html#l00214">NL3D::CMaterial::texEnvOpRGB()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +<div class="fragment"><pre>00060 { +00061 <a class="code" href="a04558.html#a15">uint</a> i; +00062 +00063 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagera10">setQuadGridSize</a>(NL3D_SMM_QUADGRID_SIZE, NL3D_SMM_QUADCELL_SIZE); +00064 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.reserve(256); +00065 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.reserve(256); +00066 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>= 0; +00067 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a>= <span class="keyword">true</span>; +00068 +00069 <span class="comment">// **** Setup Fill</span> +00070 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setVertexFormat(CVertexBuffer::PositionFlag); +00071 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.initUnlit(); +00072 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.setColor(<a class="code" href="a03337.html">CRGBA</a>(0,0,0,0)); +00073 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.setZWrite(<span class="keyword">false</span>); +00074 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.setZFunc(CMaterial::always); +00075 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.setDoubleSided(<span class="keyword">true</span>); +00076 +00077 <span class="comment">// **** Setup Blur</span> +00078 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setVertexFormat(CVertexBuffer::PositionFlag | +00079 CVertexBuffer::TexCoord0Flag | +00080 CVertexBuffer::TexCoord1Flag | +00081 CVertexBuffer::TexCoord2Flag | +00082 CVertexBuffer::TexCoord3Flag); +00083 <span class="comment">// Only 2 quads are used to blur</span> +00084 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setNumVertices(8); +00085 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.initUnlit(); +00086 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setColor(CRGBA::White); +00087 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setZWrite(<span class="keyword">false</span>); +00088 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setZFunc(CMaterial::always); +00089 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setDoubleSided(<span class="keyword">true</span>); +00090 <span class="comment">// Setup The Blur. NB: it will take advantage of Max 4 texture driver support, but will still </span> +00091 <span class="comment">// work with 2 or 3 (less beautifull).</span> +00092 <span class="keywordflow">for</span>(i=1;i<4;i++) +00093 { +00094 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvOpRGB(i, CMaterial::InterpolateConstant); +00095 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvArg0RGB(i, CMaterial::Texture, CMaterial::SrcColor); +00096 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvArg1RGB(i, CMaterial::Previous, CMaterial::SrcColor); +00097 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvOpAlpha(i, CMaterial::InterpolateConstant); +00098 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvArg0Alpha(i, CMaterial::Texture, CMaterial::SrcAlpha); +00099 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texEnvArg1Alpha(i, CMaterial::Previous, CMaterial::SrcAlpha); +00100 } +00101 <span class="comment">// Factor for Stage so the sum is 1.</span> +00102 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texConstantColor(1, <a class="code" href="a03337.html">CRGBA</a>(128,128,128,128)); <span class="comment">// factor= 1/2</span> +00103 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texConstantColor(2, <a class="code" href="a03337.html">CRGBA</a>(85,85,85,85)); <span class="comment">// factor= 1/3</span> +00104 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.texConstantColor(3, <a class="code" href="a03337.html">CRGBA</a>(64,64,64,64)); <span class="comment">// factor= 1/4</span> +00105 +00106 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a>= 0; +00107 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr5">_BlurTextureH</a>= 0; +00108 +00109 <span class="comment">// **** Setup Receiving</span> +00110 +00111 <span class="comment">// Setup the clamp texture.</span> +00112 <span class="keyword">const</span> <a class="code" href="a04558.html#a15">uint</a> clampTextSize= 512; +00113 <span class="keyword">const</span> <a class="code" href="a04558.html#a15">uint</a> clampNearFadeSize= 32; +00114 <span class="keyword">const</span> <a class="code" href="a04558.html#a15">uint</a> clampFarFadeSize= 128; +00115 <a class="code" href="a04558.html#a15">uint</a> textMemSize= 4*clampTextSize*1; +00116 <span class="comment">// Fill mem</span> +00117 <a class="code" href="a04558.html#a7">uint8</a> *tmpMem= <span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[textMemSize]; +00118 memset(tmpMem, 255, textMemSize); +00119 <span class="keywordflow">for</span>(i=0;i<clampNearFadeSize;i++) +00120 { +00121 <span class="keywordtype">float</span> f= (<span class="keywordtype">float</span>)i/clampNearFadeSize; +00122 f= <a class="code" href="a05363.html#a524">easeInEaseOut</a>(f); +00123 tmpMem[4*i+3]= (<a class="code" href="a04558.html#a15">uint</a>)(255*f); +00124 } +00125 <span class="keywordflow">for</span>(i=0;i<clampFarFadeSize;i++) +00126 { +00127 <span class="keywordtype">float</span> f= (<span class="keywordtype">float</span>)i/clampFarFadeSize; +00128 f= <a class="code" href="a05363.html#a524">easeInEaseOut</a>(f); +00129 tmpMem[4*(clampTextSize-i-1)+3]= (<a class="code" href="a04558.html#a15">uint</a>)(255*f); +00130 } +00131 <span class="comment">// build the texture</span> +00132 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a> = <span class="keyword">new</span> CTextureMem (tmpMem, 4*clampTextSize*1, <span class="keyword">true</span>, <span class="keyword">false</span>, clampTextSize, 1); +00133 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a>->setWrapS (ITexture::Clamp); +00134 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a>->setWrapT (ITexture::Clamp); +00135 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a>->setFilterMode (ITexture::Linear, ITexture::LinearMipMapOff); +00136 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a>->generate(); +00137 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr10">_ClampTexture</a>->setReleasable (<span class="keyword">false</span>); +00138 +00139 <span class="comment">// init material</span> +00140 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.initUnlit(); +00141 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setBlend(<span class="keyword">true</span>); +00142 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setBlendFunc(CMaterial::zero, CMaterial::srccolor); +00143 <span class="comment">// FillRate Optim</span> +00144 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setAlphaTest(<span class="keyword">true</span>); +00145 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setAlphaTestThreshold(0.01f); +00146 +00147 <span class="comment">// ---- Stage 0. Project the ShadowMap. Blend the color between ShadowColor and White.</span> +00148 <span class="comment">// setup texture coord gen</span> +00149 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.enableUserTexMat(0, <span class="keyword">true</span>); +00150 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexCoordGen(0, <span class="keyword">true</span>); +00151 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexCoordGenMode(0, CMaterial::TexCoordGenObjectSpace); +00152 <span class="comment">// Setup the stage so we interpolate ShadowColor and White (according to shadowmap alpha)</span> +00153 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvOpRGB(0, CMaterial::InterpolateTexture); +00154 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg0RGB(0, CMaterial::Diffuse, CMaterial::SrcColor); +00155 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg1RGB(0, CMaterial::Constant, CMaterial::SrcColor); +00156 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texConstantColor(0, CRGBA::White); +00157 <span class="comment">// Take Alpha for AlphaTest only.</span> +00158 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvOpAlpha(0, CMaterial::Replace); +00159 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg0Alpha(0, CMaterial::Texture, CMaterial::SrcAlpha); +00160 +00161 <span class="comment">// ---- Stage 1. "Modulate" by Clamp Texture. Blend the color between stage0 color and White.</span> +00162 <span class="comment">// setup texture coord gen</span> +00163 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.enableUserTexMat(1, <span class="keyword">true</span>); +00164 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexCoordGen(1, <span class="keyword">true</span>); +00165 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexCoordGenMode(1, CMaterial::TexCoordGenObjectSpace); +00166 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexture(1, _ClampTexture); +00167 <span class="comment">// Setup the stage so we interpolate Shadow and White (according to clamp alpha)</span> +00168 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvOpRGB(1, CMaterial::InterpolateTexture); +00169 <span class="comment">//_ReceiveShadowMaterial.texEnvArg0RGB(1, CMaterial::Previous, CMaterial::SrcColor);</span> +00170 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg0RGB(1, CMaterial::Previous, CMaterial::SrcColor); +00171 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg1RGB(1, CMaterial::Constant, CMaterial::SrcColor); +00172 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texConstantColor(1, CRGBA::White); +00173 <span class="comment">// Take Alpha for AlphaTest only. (take 1st texture alpha...)</span> +00174 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvOpAlpha(0, CMaterial::Replace); +00175 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.texEnvArg0Alpha(0, CMaterial::Previous, CMaterial::SrcAlpha); +00176 +00177 <span class="comment">// Trans matrix from Nel basis (Z up) to UVW basis (V up)</span> +00178 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr21">_XYZToUWVMatrix</a>.setRot(CVector::I, CVector::K, CVector::J, <span class="keyword">true</span>); +00179 <span class="comment">// Trans Matrix so Y is now the U (for clamp map).</span> +00180 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr22">_XYZToWUVMatrix</a>.setRot(CVector::K, CVector::I, CVector::J, <span class="keyword">true</span>); +00181 +00182 <span class="comment">// **** Setup Casting</span> +00183 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.initUnlit(); +00184 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setColor(CRGBA::White); +00185 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setZWrite(<span class="keyword">false</span>); +00186 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setZFunc(CMaterial::always); +00187 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setDoubleSided(<span class="keyword">true</span>); +00188 <span class="comment">// Alpha Polygon coverage accumulate, for polygon smoothing</span> +00189 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setBlend(<span class="keyword">true</span>); +00190 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>.setBlendFunc(CMaterial::one, CMaterial::one); +00191 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera11" doxytag="NL3D::CShadowMapManager::~CShadowMapManager" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NL3D::CShadowMapManager::~<a class="el" href="a03371.html">CShadowMapManager</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00194">194</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00122">_NumShadowReceivers</a>, <a class="el" href="a06373.html#l00116">_ShadowCasters</a>, <a class="el" href="a06373.html#l00121">_ShadowReceiverGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_0">NL3D::CQuadGrid< CTransform * >::clear()</a>, and <a class="el" href="a06372.html#l00945">clearGenerateShadowCasters()</a>. +<p> +<div class="fragment"><pre>00195 { +00196 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz774_0">clear</a>(); +00197 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.clear(); +00198 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd1">clearGenerateShadowCasters</a>(); +00199 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>= 0; +00200 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CShadowMapManagera0" doxytag="NL3D::CShadowMapManager::addShadowCaster" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::addShadowCaster </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>model</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Add a ShadowCaster that influence the scene this pass. +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00209">209</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00116">_ShadowCasters</a>. +<p> +Referenced by <a class="el" href="a05555.html#l00532">NL3D::CClipTrav::clipSkeletonShadowMaps()</a>, and <a class="el" href="a06001.html#l00330">NL3D::CMeshInstance::traverseRender()</a>. +<p> +<div class="fragment"><pre>00210 { +00211 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.push_back(model); +00212 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera1" doxytag="NL3D::CShadowMapManager::addShadowCasterGenerate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::addShadowCasterGenerate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>model</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Add Manually a ShadowCaster that will compute his ShadowMap this pass. NB: model->setGeneratingShadowMap(true); is called +<p> +Definition at line <a class="el" href="a06372.html#l00215">215</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00118">_GenerateShadowCasters</a>, and <a class="el" href="a06569.html#l00514">NL3D::CTransform::setGeneratingShadowMap()</a>. +<p> +Referenced by <a class="el" href="a06001.html#l00330">NL3D::CMeshInstance::traverseRender()</a>. +<p> +<div class="fragment"><pre>00216 { +00217 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.push_back(model); +00218 <span class="comment">// Indicate this model that it will render its ShadowMap</span> +00219 model->setGeneratingShadowMap(<span class="keyword">true</span>); +00220 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera2" doxytag="NL3D::CShadowMapManager::addShadowReceiver" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::addShadowReceiver </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>model</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Add a ShadowRecevier visible in this scene for this pass. +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00223">223</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00122">_NumShadowReceivers</a>, <a class="el" href="a06373.html#l00121">_ShadowReceiverGrid</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06568.html#l01328">NL3D::CTransform::getReceiverBBox()</a>, and <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid< CTransform * >::insert()</a>. +<p> +Referenced by <a class="el" href="a05870.html#l00257">NL3D::CLandscapeModel::traverseRender()</a>. +<p> +<div class="fragment"><pre>00224 { +00225 <a class="code" href="a02156.html">CAABBox</a> bb; +00226 model->getReceiverBBox(bb); +00227 +00228 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz774_2">insert</a>(bb.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>(), bb.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>(), model); +00229 +00230 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>++; +00231 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerz898_0" doxytag="NL3D::CShadowMapManager::allocateTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03487.html">ITexture</a> * NL3D::CShadowMapManager::allocateTexture </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>textSize</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Allocate a texture for a shadowMap. NB: owned by a smartPtr. nlassert powerof2. +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00957">957</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00169">_FreeShadowTextures</a>, <a class="el" href="a06373.html#l00167">_ShadowTextureMap</a>, <a class="el" href="a06506.html#l00309">NL3D::ITexture::generate()</a>, <a class="el" href="a05486.html#l01363">NLMISC::CBitmap::getWidth()</a>, <a class="el" href="a05586.html#l00371">NLMISC::isPowerOf2()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06505.html#l00100">NL3D::ITexture::setFilterMode()</a>, <a class="el" href="a06506.html#l00278">NL3D::ITexture::setReleasable()</a>, <a class="el" href="a06506.html#l00202">NL3D::ITexture::setWrapS()</a>, <a class="el" href="a06506.html#l00203">NL3D::ITexture::setWrapT()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a06370.html#l00066">NL3D::CShadowMap::initTexture()</a>. +<p> +<div class="fragment"><pre>00958 { +00959 <a class="code" href="a04199.html#a6">nlassert</a>( <a class="code" href="a05378.html#a264">isPowerOf2</a>(textSize) ); +00960 +00961 <span class="comment">// **** First, find a free texture already allocated.</span> +00962 <span class="keywordflow">if</span>(!<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.empty()) +00963 { +00964 ITexture *freeText= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.back()->second; +00965 <span class="comment">// If Ok for the size.</span> +00966 <span class="keywordflow">if</span>(freeText->getWidth() == textSize) +00967 { +00968 <span class="comment">// take this texture => no more free.</span> +00969 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.pop_back(); +00970 <span class="keywordflow">return</span> freeText; +00971 } +00972 <span class="comment">// else, suppose that we still take this slot.</span> +00973 <span class="keywordflow">else</span> +00974 { +00975 <span class="comment">// but since bad size, delete this slot from the map and create a new one (below)</span> +00976 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>.erase(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.back()); +00977 <span class="comment">// no more valid it</span> +00978 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.pop_back(); +00979 } +00980 } +00981 +00982 <span class="comment">// **** Else Allocate new one.</span> +00983 <span class="comment">// NB: the format must be RGBA; else slow copyFrameBufferToTexture()</span> +00984 <a class="code" href="a04558.html#a7">uint8</a> *tmpMem= <span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[4*textSize*textSize]; +00985 ITexture *text; +00986 text = <span class="keyword">new</span> CTextureMem (tmpMem, 4*textSize*textSize, <span class="keyword">true</span>, <span class="keyword">false</span>, textSize, textSize); +00987 text->setWrapS (ITexture::Clamp); +00988 text->setWrapT (ITexture::Clamp); +00989 text->setFilterMode (ITexture::Linear, ITexture::LinearMipMapOff); +00990 text->generate(); +00991 text->setReleasable (<span class="keyword">false</span>); +00992 +00993 <span class="comment">// Setup in the map.</span> +00994 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>[text]= text; +00995 +00996 <span class="keywordflow">return</span> text; +00997 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd0" doxytag="NL3D::CShadowMapManager::applyFakeGaussianBlur" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::applyFakeGaussianBlur </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname" nowrap> <em>drv</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numPassText</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextW</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextH</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>baseTextureSize</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00802">802</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00150">_BlurMaterial</a>, <a class="el" href="a06373.html#l00151">_BlurQuads</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera54">NL3D::IDriver::renderQuads()</a>, <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>00803 { +00804 <span class="keywordflow">if</span>(numPassText==0) +00805 <span class="keywordflow">return</span>; +00806 +00807 <span class="comment">// the number of lines that have all their column disp.</span> +00808 <a class="code" href="a04558.html#a15">uint</a> numFullLine= numPassText/numTextW; +00809 <span class="comment">// for the last line not full, the number of column setuped</span> +00810 <a class="code" href="a04558.html#a15">uint</a> lastLineNumCol= numPassText - (numFullLine*numTextW); +00811 +00812 <span class="comment">// Split into 2 quads. one for the first full lines, and one for the last not full line.</span> +00813 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= 0; +00814 <span class="keywordflow">if</span>(numFullLine) +00815 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd8">setBlurQuadFakeGaussian</a>(index++, 0, 0, numTextW*baseTextureSize, numFullLine*baseTextureSize); +00816 <span class="keywordflow">if</span>(lastLineNumCol) +00817 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd8">setBlurQuadFakeGaussian</a>(index++, 0, numFullLine*baseTextureSize, lastLineNumCol*baseTextureSize, baseTextureSize); +00818 +00819 <span class="comment">// render</span> +00820 drv->activeVertexBuffer(_BlurQuads); +00821 drv->renderQuads(_BlurMaterial, 0, index); +00822 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd1" doxytag="NL3D::CShadowMapManager::clearGenerateShadowCasters" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::clearGenerateShadowCasters </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00945">945</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00118">_GenerateShadowCasters</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>, <a class="el" href="a06372.html#l00880">selectShadowMapsToGenerate()</a>, and <a class="el" href="a06372.html#l00194">~CShadowMapManager()</a>. +<p> +<div class="fragment"><pre>00946 { +00947 <span class="comment">// Reset first each flag of all models</span> +00948 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.size();i++) +00949 { +00950 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>[i]->setGeneratingShadowMap(<span class="keyword">false</span>); +00951 } +00952 +00953 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.clear(); +00954 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd2" doxytag="NL3D::CShadowMapManager::computeShadowColors" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::computeShadowColors </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname" nowrap> <em>scene</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02316.html">CTransform</a> * </td> + <td class="mdname" nowrap> <em>sc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03337.html">CRGBA</a> & </td> + <td class="mdname" nowrap> <em>ambient</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03337.html">CRGBA</a> & </td> + <td class="mdname" nowrap> <em>diffuse</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00626">626</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a05894.html#l00073">NL3D::CLightContribution::AttFactor</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a05894.html#l00106">NL3D::CLightContribution::computeCurrentAmbient()</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06180.html#l00131">NL3D::CPointLight::getDiffuse()</a>, <a class="el" href="a06569.html#l00373">NL3D::CTransform::getLightContribution()</a>, <a class="el" href="a06348.html#l00871">NL3D::CScene::getSunAmbient()</a>, <a class="el" href="a06348.html#l00875">NL3D::CScene::getSunDiffuse()</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, <a class="el" href="a05894.html#l00067">NL3D::CLightContribution::PointLight</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a05646.html#l00993">r</a>, <a class="el" href="a05894.html#l00086">NL3D::CLightContribution::SunContribution</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00445">renderProject()</a>. +<p> +<div class="fragment"><pre>00627 { +00628 <span class="keyword">const</span> CLightContribution &lc= sc->getLightContribution(); +00629 +00630 <span class="comment">// Get the current ambiant</span> +00631 ambient= lc.computeCurrentAmbient(scene->getSunAmbient()); +00632 +00633 <span class="comment">// Compute the current diffuse as a sum (not a mean)</span> +00634 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a628">r</a>, g, b; +00635 <a class="code" href="a03337.html">CRGBA</a> color= scene->getSunDiffuse(); +00636 <a class="code" href="a04223.html#a628">r</a>= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> * lc.SunContribution; +00637 g= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> * lc.SunContribution; +00638 b= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a> * lc.SunContribution; +00639 +00640 <span class="comment">// Add PointLights contribution</span> +00641 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<<a class="code" href="a04471.html#a0">NL3D_MAX_LIGHT_CONTRIBUTION</a>;i++) +00642 { +00643 CPointLight *pl= lc.PointLight[i]; +00644 <span class="comment">// End of List?</span> +00645 <span class="keywordflow">if</span>(!pl) +00646 <span class="keywordflow">break</span>; +00647 +00648 <span class="comment">// Sum with this light, weighted by AttFactor</span> +00649 color= pl->getDiffuse(); +00650 <a class="code" href="a04223.html#a628">r</a>+= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> * lc.AttFactor[i]; +00651 g+= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> * lc.AttFactor[i]; +00652 b+= color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a> * lc.AttFactor[i]; +00653 } +00654 +00655 <span class="comment">// normalize</span> +00656 <a class="code" href="a04223.html#a628">r</a>>>=8; +00657 g>>=8; +00658 b>>=8; +00659 +00660 <span class="comment">// Don't take the MergedPointLight into consideration (should add to the diffuse part here, but rare case)</span> +00661 +00662 diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= <a class="code" href="a04061.html#a0">min</a>(r, 255U); +00663 diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= <a class="code" href="a04061.html#a0">min</a>(g, 255U); +00664 diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>= <a class="code" href="a04061.html#a0">min</a>(b, 255U); +00665 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd3" doxytag="NL3D::CShadowMapManager::computeShadowDirection" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::computeShadowDirection </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname" nowrap> <em>scene</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02316.html">CTransform</a> * </td> + <td class="mdname" nowrap> <em>sc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>lightDir</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00595">595</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a05894.html#l00073">NL3D::CLightContribution::AttFactor</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06180.html#l00131">NL3D::CPointLight::getDiffuse()</a>, <a class="el" href="a06569.html#l00373">NL3D::CTransform::getLightContribution()</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a06348.html#l00875">NL3D::CScene::getSunDiffuse()</a>, <a class="el" href="a06348.html#l00883">NL3D::CScene::getSunDirection()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, <a class="el" href="a06682.html#l00119">NLMISC::CVector::normalize()</a>, <a class="el" href="a05894.html#l00067">NL3D::CLightContribution::PointLight</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a05894.html#l00086">NL3D::CLightContribution::SunContribution</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>00596 { +00597 <span class="comment">// merge the sunLight and pointLights into a single directional</span> +00598 lightDir= scene->getSunDirection(); +00599 <span class="keyword">const</span> CLightContribution &lc= sc->getLightContribution(); +00600 <span class="comment">// For Better result, weight with the light color too.</span> +00601 <a class="code" href="a03337.html">CRGBA</a> color= scene->getSunDiffuse(); +00602 lightDir*= (<span class="keywordtype">float</span>)lc.SunContribution * (color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> + color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> + color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>); +00603 +00604 <span class="comment">// merge pointLights</span> +00605 <span class="keyword">const</span> CVector &modelPos= sc->getWorldMatrix().getPos(); +00606 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<<a class="code" href="a04471.html#a0">NL3D_MAX_LIGHT_CONTRIBUTION</a>;i++) +00607 { +00608 CPointLight *pl= lc.PointLight[i]; +00609 <span class="comment">// End of List?</span> +00610 <span class="keywordflow">if</span>(!pl) +00611 <span class="keywordflow">break</span>; +00612 +00613 CVector plDir= modelPos - pl->getPosition(); +00614 plDir.normalize(); +00615 <span class="comment">// Sum with this light, weighted by AttFactor, and light color</span> +00616 color= pl->getDiffuse(); +00617 lightDir+= plDir * (<span class="keywordtype">float</span>)lc.AttFactor[i] * (<span class="keywordtype">float</span>)(color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> + color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> + color.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>); +00618 } +00619 +00620 <span class="comment">// normalize merged dir</span> +00621 lightDir.normalize(); +00622 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd4" doxytag="NL3D::CShadowMapManager::copyScreenToBlurTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::copyScreenToBlurTexture </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname" nowrap> <em>drv</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numPassText</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextW</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextH</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>baseTextureSize</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00786">786</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00143">_BlurTexture</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera6">NL3D::IDriver::copyFrameBufferToTexture()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>00787 { +00788 <span class="keywordflow">if</span>(numPassText==0) +00789 <span class="keywordflow">return</span>; +00790 +00791 <span class="comment">// TODO_SHADOW: optim: split into 2 copy for less pixel draw on the last line? No because of OverHead?</span> +00792 +00793 <span class="comment">// number of line including the last line if not empty</span> +00794 <a class="code" href="a04558.html#a15">uint</a> numTotalLine= (numPassText+numTextW-1)/numTextW; +00795 <span class="comment">// number of column.</span> +00796 <a class="code" href="a04558.html#a15">uint</a> numTotalCol= (numPassText<numTextW)?numPassText:numTextW; +00797 +00798 drv->copyFrameBufferToTexture(_BlurTexture, 0, 0, 0, 0, 0, numTotalCol*baseTextureSize, numTotalLine*baseTextureSize); +00799 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera4" doxytag="NL3D::CShadowMapManager::enableShadowPolySmooth" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::enableShadowPolySmooth </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>enable</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Enable Polygon Smoothing. +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00094">94</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +References <a class="el" href="a06373.html#l00136">_PolySmooth</a>. +<p> +Referenced by <a class="el" href="a06348.html#l01234">NL3D::CScene::enableShadowPolySmooth()</a>. +<p> +<div class="fragment"><pre>00094 {<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a>= enable;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd5" doxytag="NL3D::CShadowMapManager::fillBlackBorder" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::fillBlackBorder </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname" nowrap> <em>drv</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numPassText</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextW</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numTextH</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>baseTextureSize</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00669">669</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00140">_FillMaterial</a>, <a class="el" href="a06373.html#l00139">_FillQuads</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera54">NL3D::IDriver::renderQuads()</a>, <a class="el" href="a06372.html#l00731">setBlackQuad()</a>, <a class="el" href="a05641.html#l00118">NL3D::CMaterial::setColor()</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05646.html#l00236">w</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>00670 { +00671 <span class="keywordflow">if</span>(numPassText==0) +00672 <span class="keywordflow">return</span>; +00673 +00674 <span class="comment">// the number of lines that have all their column disp.</span> +00675 <a class="code" href="a04558.html#a15">uint</a> numFullLine= numPassText/numTextW; +00676 <span class="comment">// for the last line not full, the number of column setuped</span> +00677 <a class="code" href="a04558.html#a15">uint</a> lastLineNumCol= numPassText - (numFullLine*numTextW); +00678 <span class="comment">// number of line including the last line if not empty</span> +00679 <a class="code" href="a04558.html#a15">uint</a> numTotalLine= numFullLine + (lastLineNumCol?1:0); +00680 +00681 <span class="comment">// Compute how many quads to render</span> +00682 <a class="code" href="a04558.html#a15">uint</a> numHQuads= numTotalLine * 2; +00683 <a class="code" href="a04558.html#a15">uint</a> numTotalCol; +00684 <a class="code" href="a04558.html#a15">uint</a> numVQuads; +00685 <span class="keywordflow">if</span>(numFullLine) +00686 numTotalCol= numTextW; +00687 <span class="keywordflow">else</span> +00688 numTotalCol= lastLineNumCol; +00689 numVQuads= numTotalCol * 2; +00690 +00691 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setNumVertices((numVQuads + numHQuads)*4); +00692 +00693 <span class="comment">// Fill HQuads.</span> +00694 <a class="code" href="a04558.html#a15">uint</a> i; +00695 <span class="keywordflow">for</span>(i=0;i<numTotalLine;i++) +00696 { +00697 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a575">w</a>; +00698 <span class="keywordflow">if</span>(i<numFullLine) +00699 <a class="code" href="a04223.html#a575">w</a>= numTextW*baseTextureSize; +00700 <span class="keywordflow">else</span> +00701 <a class="code" href="a04223.html#a575">w</a>= lastLineNumCol*baseTextureSize; +00702 <span class="comment">// bottom of text</span> +00703 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd7">setBlackQuad</a>(i*2+0, 0, i*baseTextureSize, w, 1); +00704 <span class="comment">// top of text</span> +00705 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd7">setBlackQuad</a>(i*2+1, 0, (i+1)*baseTextureSize-1, w, 1); +00706 } +00707 +00708 <span class="comment">// Fill VQuads;</span> +00709 <a class="code" href="a04558.html#a15">uint</a> baseId= numTotalLine*2; +00710 <span class="keywordflow">for</span>(i=0;i<numTotalCol;i++) +00711 { +00712 <a class="code" href="a04558.html#a15">uint</a> h; +00713 <span class="keywordflow">if</span>(i<lastLineNumCol) +00714 h= numTotalLine*baseTextureSize; +00715 <span class="keywordflow">else</span> +00716 h= numFullLine*baseTextureSize; +00717 <span class="comment">// left of text</span> +00718 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd7">setBlackQuad</a>(baseId + i*2+0, i*baseTextureSize, 0, 1, h); +00719 <span class="comment">// right of text</span> +00720 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd7">setBlackQuad</a>(baseId + i*2+1, (i+1)*baseTextureSize-1, 0, 1, h); +00721 } +00722 +00723 <span class="comment">// Render Quads</span> +00724 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr11">_FillMaterial</a>.setColor(<a class="code" href="a03337.html">CRGBA</a>(0,0,0,0)); +00725 drv->activeVertexBuffer(_FillQuads); +00726 drv->renderQuads(_FillMaterial, 0, numHQuads+numVQuads); +00727 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd6" doxytag="NL3D::CShadowMapManager::garbageShadowTextures" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::garbageShadowTextures </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>scene</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l01013">1013</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00169">_FreeShadowTextures</a>, <a class="el" href="a06373.html#l00167">_ShadowTextureMap</a>, <a class="el" href="a06349.html#l00563">NL3D::CScene::getShadowMapTextureSize()</a>, <a class="el" href="a06373.html#l00048">NL3D_SMM_MAX_FREETEXT</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>01014 { +01015 <a class="code" href="a04558.html#a15">uint</a> defSize= scene->getShadowMapTextureSize(); +01016 +01017 <span class="comment">// For all Free Textures only, release the one that are no more of the wanted default ShadowMap Size.</span> +01018 std::vector<ItTextureMap>::iterator itVec= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.begin(); +01019 <span class="keywordflow">for</span>(;itVec!=<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.end();) +01020 { +01021 <span class="keywordflow">if</span>((*itVec)->second->getWidth() != defSize) +01022 { +01023 <span class="comment">// release the map texture iterator</span> +01024 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>.erase(*itVec); +01025 <span class="comment">// release the Vector Free iterator.</span> +01026 itVec= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.erase(itVec); +01027 } +01028 <span class="keywordflow">else</span> +01029 { +01030 itVec++; +01031 } +01032 } +01033 +01034 <span class="comment">// For memory optimisation, allow only a small extra of Texture allocated.</span> +01035 <span class="keywordflow">if</span>(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.size()><a class="code" href="a04950.html#a3">NL3D_SMM_MAX_FREETEXT</a>) +01036 { +01037 <span class="comment">// Release the extra texture (Hysteresis: divide by 2 the max wanted free to leave)</span> +01038 <a class="code" href="a04558.html#a15">uint</a> startToFree= <a class="code" href="a04950.html#a3">NL3D_SMM_MAX_FREETEXT</a>/2; +01039 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=startToFree;i<<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.size();i++) +01040 { +01041 <span class="comment">// Free the texture entry.</span> +01042 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>.erase(_FreeShadowTextures[i]); +01043 } +01044 <span class="comment">// resize vector</span> +01045 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.resize(startToFree); +01046 } +01047 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera5" doxytag="NL3D::CShadowMapManager::getCasterShadowMaterial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02839.html">CMaterial</a>& NL3D::CShadowMapManager::getCasterShadowMaterial </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the typical Material for Caster. +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00099">99</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +References <a class="el" href="a06373.html#l00160">_CasterShadowMaterial</a>. +<p> +Referenced by <a class="el" href="a06393.html#l01781">NL3D::CSkeletonModel::generateShadowMap()</a>, and <a class="el" href="a06001.html#l00166">NL3D::CMeshInstance::generateShadowMap()</a>. +<p> +<div class="fragment"><pre>00099 {<span class="keywordflow">return</span> <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr9">_CasterShadowMaterial</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera6" doxytag="NL3D::CShadowMapManager::getEnableShadowPolySmooth" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NL3D::CShadowMapManager::getEnableShadowPolySmooth </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +get Enable Polygon Smoothing flag +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00096">96</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +References <a class="el" href="a06373.html#l00136">_PolySmooth</a>. +<p> +Referenced by <a class="el" href="a06348.html#l01240">NL3D::CScene::getEnableShadowPolySmooth()</a>. +<p> +<div class="fragment"><pre>00096 {<span class="keywordflow">return</span> <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerz898_1" doxytag="NL3D::CShadowMapManager::releaseTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::releaseTexture </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03487.html">ITexture</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>text</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Release this one. NB: the texture is not deleted, but still will be used for later use +<p> +Definition at line <a class="el" href="a06372.html#l01000">1000</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00169">_FreeShadowTextures</a>, <a class="el" href="a06373.html#l00167">_ShadowTextureMap</a>, <a class="el" href="a06373.html#l00166">ItTextureMap</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a06370.html#l00085">NL3D::CShadowMap::resetTexture()</a>. +<p> +<div class="fragment"><pre>01001 { +01002 <span class="keywordflow">if</span>(!text) +01003 <span class="keywordflow">return</span>; +01004 +01005 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagery0">ItTextureMap</a> it= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>.find(text); +01006 <a class="code" href="a04199.html#a6">nlassert</a>(it!=<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr20">_ShadowTextureMap</a>.end()); +01007 +01008 <span class="comment">// Don't release it, but insert in Free Space</span> +01009 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr13">_FreeShadowTextures</a>.push_back(it); +01010 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera7" doxytag="NL3D::CShadowMapManager::renderGenerate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::renderGenerate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>scene</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +render ShadowMap with ShadowCasters. Generate ShadowMap only (with the AuxDriver). NB: current driver Frustum, ViewMatrix kept their initial state but ModelMatrix not. +<p> +Definition at line <a class="el" href="a06372.html#l00234">234</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00118">_GenerateShadowCasters</a>, <a class="el" href="a06373.html#l00122">_NumShadowReceivers</a>, <a class="el" href="a06373.html#l00136">_PolySmooth</a>, <a class="el" href="a06373.html#l00116">_ShadowCasters</a>, <a class="el" href="a06373.html#l00121">_ShadowReceiverGrid</a>, <a class="el" href="a06372.html#l00802">applyFakeGaussianBlur()</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_0">NL3D::CQuadGrid< CTransform * >::clear()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera4">NL3D::IDriver::clear2D()</a>, <a class="el" href="a06372.html#l00945">clearGenerateShadowCasters()</a>, <a class="el" href="a06372.html#l00595">computeShadowDirection()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera6">NL3D::IDriver::copyFrameBufferToTexture()</a>, <a class="el" href="a06372.html#l00786">copyScreenToBlurTexture()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_0">NL3D::IDriver::enableFog()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz153_0">NL3D::IDriver::enablePolygonSmoothing()</a>, <a class="el" href="a06372.html#l00669">fillBlackBorder()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_1">NL3D::IDriver::fogEnabled()</a>, <a class="el" href="a06372.html#l01013">garbageShadowTextures()</a>, <a class="el" href="a06569.html#l00492">NL3D::CTransform::generateShadowMap()</a>, <a class="el" href="a06330.html#l00135">NL3D::CRenderTrav::getAuxDriver()</a>, <a class="el" href="a06349.html#l00285">NL3D::CScene::getNumRender()</a>, <a class="el" href="a06349.html#l00479">NL3D::CScene::getRenderTrav()</a>, <a class="el" href="a06569.html#l00495">NL3D::CTransform::getShadowMap()</a>, <a class="el" href="a06349.html#l00571">NL3D::CScene::getShadowMapBlurSize()</a>, <a class="el" href="a06349.html#l00563">NL3D::CScene::getShadowMapTextureSize()</a>, <a class="el" href="a06371.html#l00113">NL3D::CShadowMap::getTexture()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera35">NL3D::IDriver::getViewport()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera38">NL3D::IDriver::getWindowSize()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a06355.html#l00077">NL3D::CScissor::init()</a>, <a class="el" href="a06722.html#l00044">NL3D::CViewport::init()</a>, <a class="el" href="a06722.html#l00059">NL3D::CViewport::initFullScreen()</a>, <a class="el" href="a06355.html#l00088">NL3D::CScissor::initFullScreen()</a>, <a class="el" href="a05586.html#l00371">NLMISC::isPowerOf2()</a>, <a class="el" href="a06371.html#l00078">NL3D::CShadowMap::LastGenerationFrame</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a06373.html#l00047">NL3D_SMM_MAX_TEXTDEST_SIZE</a>, <a class="el" href="a05586.html#l00349">NLMISC::raiseToNextPowerOf2()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera58">NL3D::IDriver::setColorMask()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera60">NL3D::IDriver::setFrustum()</a>, <a class="el" href="a06329.html#l00304">NL3D::CRenderTrav::setupDriverCamera()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera68">NL3D::IDriver::setupModelMatrix()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera69">NL3D::IDriver::setupScissor()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera72">NL3D::IDriver::setupViewMatrix()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera74">NL3D::IDriver::setupViewport()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. +<p> +Referenced by <a class="el" href="a06329.html#l00089">NL3D::CRenderTrav::traverse()</a>. +<p> +<div class="fragment"><pre>00235 { +00236 <a class="code" href="a04365.html#a4">H_AUTO</a>( NL3D_ShadowManager_Generate ); +00237 +00238 <span class="comment">// Each frame, do a small garbage collector for unused free textures.</span> +00239 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd6">garbageShadowTextures</a>(scene); +00240 +00241 IDriver *driverForShadowGeneration= scene->getRenderTrav().getAuxDriver(); +00242 +00243 <span class="comment">// Init</span> +00244 <span class="comment">// ********</span> +00245 <a class="code" href="a04558.html#a11">uint32</a> wndW= 0, wndH= 0; +00246 <span class="comment">// get some text/screen size.</span> +00247 <span class="keywordflow">if</span>(driverForShadowGeneration) +00248 driverForShadowGeneration->getWindowSize(wndW, wndH); +00249 <a class="code" href="a04558.html#a15">uint</a> baseTextureSize= scene->getShadowMapTextureSize(); +00250 <span class="comment">// Minimize the Dest Texture size, so the blurTexture don't get to heavy in VRAM.</span> +00251 <a class="code" href="a04558.html#a11">uint32</a> textDestW= <a class="code" href="a04061.html#a0">min</a>(wndW, (<a class="code" href="a04558.html#a11">uint32</a>)NL3D_SMM_MAX_TEXTDEST_SIZE); +00252 <a class="code" href="a04558.html#a11">uint32</a> textDestH= <a class="code" href="a04061.html#a0">min</a>(wndH, (<a class="code" href="a04558.html#a11">uint32</a>)NL3D_SMM_MAX_TEXTDEST_SIZE); +00253 +00254 <span class="comment">// if not needed or if not possible, exit. test for wndSize is also important when window is minimized</span> +00255 <span class="keywordflow">if</span>( <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.empty() || +00256 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>==0 || +00257 textDestW<baseTextureSize || textDestH<baseTextureSize) +00258 { +00259 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz774_0">clear</a>(); +00260 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>= 0; +00261 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.clear(); +00262 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd1">clearGenerateShadowCasters</a>(); +00263 <span class="keywordflow">return</span>; +00264 } +00265 +00266 <span class="comment">// If Needed to project some ShadowCaster, but none to compute this frame, quit.</span> +00267 <span class="keywordflow">if</span>( <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.empty() ) +00268 { +00269 <span class="comment">// But here don't reset since the renderProject() will do job</span> +00270 <span class="keywordflow">return</span>; +00271 } +00272 +00273 <span class="comment">// get the number of shadowMap compute we can do in one screen.</span> +00274 <a class="code" href="a04558.html#a15">uint</a> numTextW= textDestW/baseTextureSize; +00275 <a class="code" href="a04558.html#a15">uint</a> numTextH= textDestH/baseTextureSize; +00276 <span class="keywordflow">if</span>(!<a class="code" href="a05378.html#a264">isPowerOf2</a>(numTextW)) +00277 numTextW= <a class="code" href="a05378.html#a262">raiseToNextPowerOf2</a>(numTextW)/2; +00278 <span class="keywordflow">if</span>(!<a class="code" href="a05378.html#a264">isPowerOf2</a>(numTextH)) +00279 numTextH= <a class="code" href="a05378.html#a262">raiseToNextPowerOf2</a>(numTextH)/2; +00280 <span class="comment">// the max shadow casters we can do in 1 screen pass.</span> +00281 <a class="code" href="a04558.html#a15">uint</a> maxSCPerPass= numTextW * numTextH; +00282 +00283 <span class="comment">// compute vp float size.</span> +00284 <span class="keywordtype">float</span> vpWidth= (<span class="keywordtype">float</span>)baseTextureSize / (<span class="keywordtype">float</span>)wndW; +00285 <span class="keywordtype">float</span> vpHeight= (<span class="keywordtype">float</span>)baseTextureSize / (<span class="keywordtype">float</span>)wndH; +00286 +00287 +00288 <span class="comment">// Create / Update the Blur Texture </span> +00289 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd9">updateBlurTexture</a>(numTextW * baseTextureSize, numTextH * baseTextureSize); +00290 +00291 +00292 <span class="comment">// Do NPass if a screen is not sufficient to render all shadow maps...</span> +00293 <span class="comment">// ********</span> +00294 +00295 <span class="comment">// bkup driver state</span> +00296 CViewport bkupViewport; +00297 driverForShadowGeneration->getViewport(bkupViewport); +00298 <span class="keywordtype">bool</span> bkupFog= driverForShadowGeneration->fogEnabled(); +00299 +00300 <span class="comment">// setup some state</span> +00301 driverForShadowGeneration->enableFog(<span class="keyword">false</span>); +00302 <span class="comment">// Allow Writing on alpha only. => don't write on RGB objects!</span> +00303 driverForShadowGeneration->setColorMask(<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">true</span>); +00304 +00305 <a class="code" href="a04558.html#a15">uint</a> numSC= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.size(); +00306 <a class="code" href="a04558.html#a15">uint</a> baseSC= 0; +00307 <span class="keywordflow">while</span>(numSC>0) +00308 { +00309 <a class="code" href="a04558.html#a15">uint</a> numPassSC= <a class="code" href="a04061.html#a0">min</a>(maxSCPerPass, numSC); +00310 <a class="code" href="a04558.html#a15">uint</a> textX, textY; +00311 <a class="code" href="a04558.html#a15">uint</a> i; +00312 +00313 <span class="comment">// Render All Shadow Map</span> +00314 <span class="comment">// ********</span> +00315 +00316 <span class="comment">// Render the polygons with Smooth Anti-Alias. Less jittering for little performance overcost</span> +00317 <span class="keywordflow">if</span>(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a>) +00318 driverForShadowGeneration->enablePolygonSmoothing(<span class="keyword">true</span>); +00319 +00320 textX=0; +00321 textY=0; +00322 <span class="keywordflow">for</span>(i=0;i<numPassSC;i++) +00323 { +00324 <span class="comment">// get the transform to compute shadow map.</span> +00325 CTransform *sc= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>[baseSC+i]; +00326 +00327 <span class="comment">// select the shadow direction</span> +00328 CVector lightDir; +00329 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd3">computeShadowDirection</a>(scene, sc, lightDir); +00330 +00331 <span class="comment">// setup viewport to render to</span> +00332 CViewport vp; +00333 vp.init(textX*baseTextureSize/(<span class="keywordtype">float</span>)wndW, textY*baseTextureSize/(<span class="keywordtype">float</span>)wndH, vpWidth, vpHeight); +00334 driverForShadowGeneration->setupViewport(vp); +00335 +00336 <span class="comment">// TODO_SHADOW: optim: one big erase per pass, but just bbox needed (according to number of SC to render)</span> +00337 <span class="comment">// do a siccor or prefer do a polygon clear?</span> +00338 CScissor sic; +00339 sic.init(textX*baseTextureSize/(<span class="keywordtype">float</span>)wndW, textY*baseTextureSize/(<span class="keywordtype">float</span>)wndH, vpWidth, vpHeight); +00340 driverForShadowGeneration->setupScissor(sic); +00341 driverForShadowGeneration->clear2D(<a class="code" href="a03337.html">CRGBA</a>(0,0,0,0)); +00342 +00343 <span class="comment">// render to screen</span> +00344 sc->generateShadowMap(lightDir); +00345 +00346 <span class="comment">// next text</span> +00347 textX++; +00348 <span class="keywordflow">if</span>(textX==numTextW) +00349 { +00350 textX= 0; +00351 textY++; +00352 } +00353 } +00354 +00355 <span class="comment">// Restore</span> +00356 <span class="keywordflow">if</span>(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr16">_PolySmooth</a>) +00357 driverForShadowGeneration->enablePolygonSmoothing(<span class="keyword">false</span>); +00358 +00359 <span class="comment">// For Subsequent operations, setup a full viewport and a "Screen Frustum"</span> +00360 CScissor sic; +00361 sic.initFullScreen(); +00362 <span class="comment">// TODO_SHADOW: optim: need scissor?</span> +00363 driverForShadowGeneration->setupScissor(sic); +00364 CViewport vp; +00365 vp.initFullScreen(); +00366 driverForShadowGeneration->setupViewport(vp); +00367 driverForShadowGeneration->setFrustum(0, (<span class="keywordtype">float</span>)wndW, 0, (<span class="keywordtype">float</span>)wndH, -1,1,<span class="keyword">false</span>); +00368 driverForShadowGeneration->setupViewMatrix(CMatrix::Identity); +00369 driverForShadowGeneration->setupModelMatrix(CMatrix::Identity); +00370 +00371 <span class="comment">// Ensure the One pixel black security on texture border</span> +00372 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd5">fillBlackBorder</a>(driverForShadowGeneration, numPassSC, numTextW, numTextH, baseTextureSize); +00373 +00374 <span class="comment">// Blur.</span> +00375 <span class="comment">// ********</span> +00376 <a class="code" href="a04558.html#a15">uint</a> numBlur= scene->getShadowMapBlurSize(); +00377 <a class="code" href="a05378.html#a374">clamp</a>(numBlur, 0U, 3U); +00378 <span class="keywordflow">for</span>(i=0;i<numBlur;i++) +00379 { +00380 <span class="comment">// copy from FB to BlurTexture</span> +00381 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd4">copyScreenToBlurTexture</a>(driverForShadowGeneration, numPassSC, numTextW, numTextH, baseTextureSize); +00382 +00383 <span class="comment">// blur</span> +00384 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd0">applyFakeGaussianBlur</a>(driverForShadowGeneration, numPassSC, numTextW, numTextH, baseTextureSize); +00385 +00386 <span class="comment">// Ensure the One pixel black security on texture border</span> +00387 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd5">fillBlackBorder</a>(driverForShadowGeneration, numPassSC, numTextW, numTextH, baseTextureSize); +00388 } +00389 +00390 <span class="comment">// Store Screen in ShadowMaps</span> +00391 <span class="comment">// ********</span> +00392 textX=0; +00393 textY=0; +00394 <span class="keywordflow">for</span>(i=0;i<numPassSC;i++) +00395 { +00396 <span class="comment">// get the transform to compute shadow map.</span> +00397 CTransform *sc= _GenerateShadowCasters[baseSC+i]; +00398 CShadowMap *sm= sc->getShadowMap(); +00399 <span class="keywordflow">if</span>(sm) +00400 { +00401 ITexture *text= sm->getTexture(); +00402 <span class="keywordflow">if</span>(text) +00403 { +00404 <a class="code" href="a04558.html#a15">uint</a> bts= baseTextureSize; +00405 driverForShadowGeneration->copyFrameBufferToTexture(text, 0, 0, 0, textX*bts, textY*bts, bts, bts); +00406 <span class="comment">// Indicate to the ShadowMap that we have updated his Texture</span> +00407 sm->LastGenerationFrame= scene->getNumRender(); +00408 } +00409 } +00410 +00411 <span class="comment">// next text</span> +00412 textX++; +00413 <span class="keywordflow">if</span>(textX==numTextW) +00414 { +00415 textX= 0; +00416 textY++; +00417 } +00418 } +00419 +00420 +00421 <span class="comment">// next screen pass.</span> +00422 baseSC+= numPassSC; +00423 numSC-= numPassSC; +00424 } +00425 +00426 <span class="comment">// Allow Writing on all.</span> +00427 driverForShadowGeneration->setColorMask(<span class="keyword">true</span>, <span class="keyword">true</span>, <span class="keyword">true</span>, <span class="keyword">true</span>); +00428 <span class="comment">// Restore driver state. (do it here because driverForShadowGeneration may be the main screen).</span> +00429 driverForShadowGeneration->setupViewport(bkupViewport); +00430 driverForShadowGeneration->enableFog(bkupFog); +00431 <span class="comment">// TODO_SHADOW: optim need scissor?</span> +00432 CScissor sic; +00433 sic.initFullScreen(); +00434 driverForShadowGeneration->setupScissor(sic); +00435 +00436 <span class="comment">// ensure the Scene Driver has correct matrix setup (in common case where AuxDriver == Std Driver)</span> +00437 scene->getRenderTrav().setupDriverCamera(); +00438 +00439 +00440 <span class="comment">// Clear ShadowCaster Generation</span> +00441 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd1">clearGenerateShadowCasters</a>(); +00442 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera8" doxytag="NL3D::CShadowMapManager::renderProject" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::renderProject </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>scene</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +project ShadowMaps onto receivers. NB: <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagera7">renderGenerate()</a> must have been called before. NB: current driver Frustum, ViewMatrix kept their initial state but ModelMatrix not. +<p> +Definition at line <a class="el" href="a06372.html#l00445">445</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00122">_NumShadowReceivers</a>, <a class="el" href="a06373.html#l00154">_ReceiveShadowMaterial</a>, <a class="el" href="a06373.html#l00116">_ShadowCasters</a>, <a class="el" href="a06373.html#l00121">_ShadowReceiverGrid</a>, <a class="el" href="a06373.html#l00155">_XYZToUWVMatrix</a>, <a class="el" href="a06373.html#l00156">_XYZToWUVMatrix</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_0">NL3D::CQuadGrid< CTransform * >::begin()</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_0">NL3D::CQuadGrid< CTransform * >::clear()</a>, <a class="el" href="a06372.html#l00626">computeShadowColors()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_2">NL3D::CQuadGrid< CTransform * >::end()</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a05385.html#l00090">NLMISC::CAABBox::getCenter()</a>, <a class="el" href="a06330.html#l00133">NL3D::CRenderTrav::getDriver()</a>, <a class="el" href="a06371.html#l00147">NL3D::CShadowMap::getFinalFade()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_2">NL3D::IDriver::getFogColor()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_3">NL3D::IDriver::getFogEnd()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_4">NL3D::IDriver::getFogStart()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06569.html#l00511">NL3D::CTransform::getReceiverRenderWorldMatrix()</a>, <a class="el" href="a06349.html#l00479">NL3D::CScene::getRenderTrav()</a>, <a class="el" href="a06569.html#l00495">NL3D::CTransform::getShadowMap()</a>, <a class="el" href="a06371.html#l00113">NL3D::CShadowMap::getTexture()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05972.html#l00914">NLMISC::CMatrix::invert()</a>, <a class="el" href="a06371.html#l00074">NL3D::CShadowMap::LocalBoundingBox</a>, <a class="el" href="a06371.html#l00062">NL3D::CShadowMap::LocalProjectionMatrix</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a06569.html#l00506">NL3D::CTransform::receiveShadowMap()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_3">NL3D::CQuadGrid< CTransform * >::select()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05641.html#l00118">NL3D::CMaterial::setColor()</a>, <a class="el" href="a05972.html#l00744">NLMISC::CMatrix::setMulMatrix()</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05968.html#l00322">NL3D::CMaterial::setTexture()</a>, <a class="el" href="a02434.html#NL3D_1_1IDriverz143_5">NL3D::IDriver::setupFog()</a>, <a class="el" href="a05641.html#l00369">NL3D::CMaterial::setUserTexMat()</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06329.html#l00089">NL3D::CRenderTrav::traverse()</a>. +<p> +<div class="fragment"><pre>00446 { +00447 <span class="comment">// if not needed exit. NB renderGenerate() must have been called before.</span> +00448 <span class="keywordflow">if</span>( <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>==0 ) +00449 { +00450 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.empty()); +00451 <span class="keywordflow">return</span>; +00452 } +00453 +00454 +00455 <span class="comment">// Project ShadowMap on receivers.</span> +00456 <span class="comment">// ********</span> +00457 +00458 <a class="code" href="a04365.html#a4">H_AUTO</a>( NL3D_ShadowManager_Project ); +00459 +00460 +00461 <span class="comment">/* Fog Case: Since we do a modulate, we don't want to modulate the fog color with himself.</span> +00462 <span class="comment"> Instead, if the shadowed pixel is in full fog, we have to modulate him with White</span> +00463 <span class="comment"> => replace fog color with white temporarly.</span> +00464 <span class="comment"> */</span> +00465 IDriver *driver= scene->getRenderTrav().getDriver(); +00466 <a class="code" href="a03337.html">CRGBA</a> bkupFogColor= driver->getFogColor(); +00467 driver->setupFog(driver->getFogStart(), driver->getFogEnd(), CRGBA::White); +00468 +00469 <span class="comment">// For each ShadowMap</span> +00470 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.size();i++) +00471 { +00472 CTransform *caster= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>[i]; +00473 CShadowMap *sm= caster->getShadowMap(); +00474 <a class="code" href="a04199.html#a6">nlassert</a>(sm); +00475 <span class="comment">// NB: the ShadowCaster may not have a texture yet, for example because of Generate selection...</span> +00476 <span class="comment">// If the final fade is 1, don't render!</span> +00477 <span class="keywordflow">if</span>( sm->getTexture() && sm->getFinalFade()<1 ) +00478 { +00479 CVector casterPos= caster->getWorldMatrix().getPos(); +00480 +00481 <span class="comment">// Compute the World bbox (for quadGrid intersection)</span> +00482 <a class="code" href="a02156.html">CAABBox</a> worldBB= sm->LocalBoundingBox; +00483 worldBB.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1902_1">setCenter</a>(worldBB.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_0">getCenter</a>() + casterPos); +00484 +00485 <span class="comment">// compute the world matrix of the projection.</span> +00486 CMatrix worldProjMat= sm->LocalProjectionMatrix; +00487 worldProjMat.setPos(worldProjMat.getPos()+casterPos); +00488 +00489 <span class="comment">// Now compute the textureMatrix, from WorldSpace to UV.</span> +00490 CMatrix wsTextMat; +00491 CMatrix osTextMat; +00492 wsTextMat= worldProjMat; +00493 wsTextMat.invert(); +00494 +00495 <span class="comment">// setup the Material.</span> +00496 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setTexture(0, sm->getTexture()); +00498 <a class="code" href="a03337.html">CRGBA</a> ambient, diffuse; +00499 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd2">computeShadowColors</a>(scene, caster, ambient, diffuse); +00500 <span class="comment">// copute the shadowColor so that modulating a Medium diffuse terrain will get the correct result.</span> +00501 <a class="code" href="a04558.html#a15">uint</a> R= ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> + (diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>>>1); +00502 <a class="code" href="a04558.html#a15">uint</a> G= ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> + (diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>>>1); +00503 <a class="code" href="a04558.html#a15">uint</a> B= ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a> + (diffuse.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>>>1); +00504 <a class="code" href="a05378.html#a374">clamp</a>(R, 1U, 256U); +00505 <a class="code" href="a05378.html#a374">clamp</a>(G, 1U, 256U); +00506 <a class="code" href="a05378.html#a374">clamp</a>(B, 1U, 256U); +00507 <span class="comment">/* screen= text*(a+d*0.5) (mean value). if we do shadowColor= a/(a+d*0.5f), </span> +00508 <span class="comment"> then we'll have "in theory" screen= text*a</span> +00509 <span class="comment"> */</span> +00510 R= (<a class="code" href="a04558.html#a15">uint</a>)(256 * ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> / (<span class="keywordtype">float</span>)R); +00511 G= (<a class="code" href="a04558.html#a15">uint</a>)(256 * ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a> / (<span class="keywordtype">float</span>)G); +00512 B= (<a class="code" href="a04558.html#a15">uint</a>)(256 * ambient.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a> / (<span class="keywordtype">float</span>)B); +00513 <a class="code" href="a05378.html#a374">clamp</a>(R,0U,255U); +00514 <a class="code" href="a05378.html#a374">clamp</a>(G,0U,255U); +00515 <a class="code" href="a05378.html#a374">clamp</a>(B,0U,255U); +00517 <span class="keywordflow">if</span>(sm->getFinalFade()>0) +00518 { +00519 <a class="code" href="a04558.html#a14">sint</a> factor= <a class="code" href="a05378.html#a397">OptFastFloor</a>( 256 * sm->getFinalFade() ); +00520 <a class="code" href="a05378.html#a374">clamp</a>(factor, 0, 256); +00521 R= 255*factor + R*(256-factor); R>>=8; +00522 G= 255*factor + G*(256-factor); G>>=8; +00523 B= 255*factor + B*(256-factor); B>>=8; +00524 } +00525 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setColor(<a class="code" href="a03337.html">CRGBA</a>(R,G,B,255)); +00526 +00527 +00528 <span class="comment">// select receivers.</span> +00529 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz776_3">select</a>(worldBB.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>(), worldBB.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>()); +00530 <span class="comment">// For all receivers</span> +00531 TShadowReceiverGrid::CIterator it; +00532 <span class="keywordflow">for</span>(it= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz776_0">begin</a>();it!=<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz776_2">end</a>();it++) +00533 { +00534 CTransform *receiver= *it; +00535 <span class="comment">// Avoid Auto-Casting.</span> +00536 <span class="keywordflow">if</span>(receiver==caster) +00537 <span class="keywordflow">continue</span>; +00538 +00539 <span class="comment">/* The problem is material don't support WorldSpace Coordinate Generation, but ObjectSpace ones.</span> +00540 <span class="comment"> Hence must take back the coordinate in ObjectSpace before set textMat. </span> +00541 <span class="comment"> see getReceiverRenderWorldMatrix() Doc for why using this instead of getWorldMatrix()</span> +00542 <span class="comment"> */</span> +00543 osTextMat.setMulMatrix(wsTextMat, receiver->getReceiverRenderWorldMatrix()); +00544 +00545 <span class="comment">/* Set the TextureMatrix for ShadowMap projection so that UVW= mat * XYZ. </span> +00546 <span class="comment"> its osTextMat but must rotate so Z map to V</span> +00547 <span class="comment"> */</span> +00548 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setUserTexMat(0, _XYZToUWVMatrix * osTextMat); +00549 <span class="comment">/* Set the TextureMatrix for ClampMap projection so that UVW= mat * XYZ. </span> +00550 <span class="comment"> its osTextMat but must rotate so Y map to U</span> +00551 <span class="comment"> */</span> +00552 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr17">_ReceiveShadowMaterial</a>.setUserTexMat(1, _XYZToWUVMatrix * osTextMat); +00553 +00554 <span class="comment">// cast the shadow on them</span> +00555 receiver->receiveShadowMap(sm, casterPos, _ReceiveShadowMaterial); +00556 } +00557 } +00558 } +00559 +00560 <span class="comment">// Restore fog color</span> +00561 driver->setupFog(driver->getFogStart(), driver->getFogEnd(), bkupFogColor); +00562 +00563 +00564 <span class="comment">// TestYoyo. Display Projection BBox.</span> +00565 <span class="comment">/*{</span> +00566 <span class="comment"> for(uint i=0;i<_ShadowCasters.size();i++)</span> +00567 <span class="comment"> {</span> +00568 <span class="comment"> // get the transform to compute shadow map.</span> +00569 <span class="comment"> CTransform *sc= _ShadowCasters[i];</span> +00570 <span class="comment"></span> +00571 <span class="comment"> CShadowMap *sm= sc->getShadowMap();</span> +00572 <span class="comment"> if(sm)</span> +00573 <span class="comment"> {</span> +00574 <span class="comment"> CVector p0= sm->LocalProjectionMatrix.getPos() + sc->getWorldMatrix().getPos();</span> +00575 <span class="comment"> IDriver &drv= *driver;</span> +00576 <span class="comment"></span> +00577 <span class="comment"> drv.setupModelMatrix(CMatrix::Identity);</span> +00578 <span class="comment"></span> +00579 <span class="comment"> CDRU::drawWiredBox(p0, sm->LocalProjectionMatrix.getI(), sm->LocalProjectionMatrix.getJ(), </span> +00580 <span class="comment"> sm->LocalProjectionMatrix.getK(), CRGBA::White, drv);</span> +00581 <span class="comment"> }</span> +00582 <span class="comment"> }</span> +00583 <span class="comment"> }*/</span> +00584 +00585 +00586 <span class="comment">// Release pass.</span> +00587 <span class="comment">// ********</span> +00588 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz774_0">clear</a>(); +00589 _ShadowCasters.clear(); +00590 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr15">_NumShadowReceivers</a>= 0; +00591 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera9" doxytag="NL3D::CShadowMapManager::selectShadowMapsToGenerate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::selectShadowMapsToGenerate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">CScene</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>scene</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +From List of ShadowCaster, select a sub - part (so called Loding ShadowMap Casters) NB: Beware that this clear the currentlist of shadowMap to generate NB: model->setGeneratingShadowMap(true); are called for each model selected +<p> +Definition at line <a class="el" href="a06372.html#l00880">880</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00118">_GenerateShadowCasters</a>, <a class="el" href="a06373.html#l00116">_ShadowCasters</a>, <a class="el" href="a06583.html#l00079">NL3D::CTravCameraScene::CamPos</a>, <a class="el" href="a06372.html#l00870">NL3D::CShadowMapSort::Caster</a>, <a class="el" href="a06372.html#l00945">clearGenerateShadowCasters()</a>, <a class="el" href="a06349.html#l00508">NL3D::CScene::getFilterRenderFlags()</a>, <a class="el" href="a06371.html#l00147">NL3D::CShadowMap::getFinalFade()</a>, <a class="el" href="a06349.html#l00285">NL3D::CScene::getNumRender()</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06349.html#l00479">NL3D::CScene::getRenderTrav()</a>, <a class="el" href="a06569.html#l00495">NL3D::CTransform::getShadowMap()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a06371.html#l00078">NL3D::CShadowMap::LastGenerationFrame</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06372.html#l00871">NL3D::CShadowMapSort::Weight</a>. +<p> +Referenced by <a class="el" href="a05555.html#l00532">NL3D::CClipTrav::clipSkeletonShadowMaps()</a>. +<p> +<div class="fragment"><pre>00881 { +00882 <span class="comment">// TODO: Scene option.</span> +00883 <span class="keyword">const</span> <a class="code" href="a04558.html#a15">uint</a> maxPerFrame= 8; +00884 <span class="keyword">const</span> <span class="keywordtype">float</span> minCamDist= 10; +00885 <span class="keyword">const</span> CVector &camPos= scene->getRenderTrav().CamPos; +00886 <a class="code" href="a04558.html#a15">uint</a> i; +00887 +00888 <span class="comment">// **** Clear first</span> +00889 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerd1">clearGenerateShadowCasters</a>(); +00890 +00891 <span class="comment">// If the scene filter skeleton render, suppose no generation at all. Ugly.</span> +00892 <span class="keywordflow">if</span>(! (scene->getFilterRenderFlags() & UScene::FilterSkeleton) ) +00893 <span class="keywordflow">return</span>; +00894 +00895 <span class="comment">// **** Select</span> +00896 <span class="comment">// For all ShadowCaster inserted</span> +00897 <span class="keyword">static</span> vector<CShadowMapSort> sortList; +00898 sortList.clear(); +00899 sortList.reserve(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.size()); +00900 <span class="keywordflow">for</span>(i=0;i<<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>.size();i++) +00901 { +00902 CTransform *caster= <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr18">_ShadowCasters</a>[i]; +00903 <span class="comment">/* If the shadowMap exist, and if not totaly faded</span> +00904 <span class="comment"> NB: take FinalFade here because if 1, it won't be rendered in renderProject()</span> +00905 <span class="comment"> so don't really need to update (usefull for update reason, but LastGenerationFrame do the job)</span> +00906 <span class="comment"> */</span> +00907 <span class="keywordflow">if</span>(caster->getShadowMap() && caster->getShadowMap()->getFinalFade()<1 ) +00908 { +00909 CShadowMapSort sms; +00910 sms.Caster= caster; +00911 <span class="comment">// The Weight is the positive delta of frame</span> +00912 sms.Weight= (<span class="keywordtype">float</span>)(scene->getNumRender() - caster->getShadowMap()->LastGenerationFrame); +00913 <span class="comment">// Modulated by Caster Distance from Camera.</span> +00914 <span class="keywordtype">float</span> distToCam= (caster->getWorldMatrix().getPos() - camPos).norm(); +00915 distToCam= max(distToCam, minCamDist); +00916 <span class="comment">// The farthest, the less important</span> +00917 sms.Weight/= distToCam; +00918 +00919 <span class="comment">// Append</span> +00920 sortList.push_back(sms); +00921 } +00922 } +00923 +00924 <span class="comment">// Sort increasing</span> +00925 sort(sortList.begin(), sortList.end()); +00926 +00927 <span class="comment">// Select the best</span> +00928 <a class="code" href="a04558.html#a15">uint</a> numSel= <a class="code" href="a04061.html#a0">min</a>((<a class="code" href="a04558.html#a15">uint</a>)sortList.size(), maxPerFrame); +00929 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.resize(numSel); +00930 <span class="keywordflow">for</span>(i= 0;i<numSel;i++) +00931 { +00932 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>[i]= sortList[sortList.size()-1-i].Caster; +00933 } +00934 +00935 <span class="comment">// **** Flag selecteds</span> +00936 <span class="comment">// For All selected models, indicate that they will generate shadowMap for this Frame.</span> +00937 <span class="keywordflow">for</span>(i=0;i<<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>.size();i++) +00938 { +00939 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr14">_GenerateShadowCasters</a>[i]->setGeneratingShadowMap(<span class="keyword">true</span>); +00940 } +00941 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd7" doxytag="NL3D::CShadowMapManager::setBlackQuad" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::setBlackQuad </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>index</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>x</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>y</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>w</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>h</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00731">731</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00139">_FillQuads</a>, <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a06711.html#l00524">NL3D::CVertexBuffer::setVertexCoord()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00236">w</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00669">fillBlackBorder()</a>. +<p> +<div class="fragment"><pre>00732 { +00733 <span class="keywordtype">float</span> x0= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a572">x</a>; +00734 <span class="keywordtype">float</span> y0= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a573">y</a>; +00735 <span class="keywordtype">float</span> x1= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a572">x</a>+(<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a575">w</a>; +00736 <span class="keywordtype">float</span> y1= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a573">y</a>+(<span class="keywordtype">float</span>)h; +00737 <a class="code" href="a04223.html#a566">index</a>*= 4; +00738 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setVertexCoord (index+0, CVector (x0, 0, y0)); +00739 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setVertexCoord (index+1, CVector (x1, 0, y0)); +00740 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setVertexCoord (index+2, CVector (x1, 0, y1)); +00741 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr12">_FillQuads</a>.setVertexCoord (index+3, CVector (x0, 0, y1)); +00742 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd8" doxytag="NL3D::CShadowMapManager::setBlurQuadFakeGaussian" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::setBlurQuadFakeGaussian </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>index</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>x</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>y</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>w</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>h</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00826">826</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00151">_BlurQuads</a>, <a class="el" href="a06373.html#l00149">_BlurTextureD05H</a>, <a class="el" href="a06373.html#l00148">_BlurTextureD05W</a>, <a class="el" href="a06373.html#l00147">_BlurTextureOOH</a>, <a class="el" href="a06373.html#l00146">_BlurTextureOOW</a>, <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a06711.html#l00600">NL3D::CVertexBuffer::setTexCoord()</a>, <a class="el" href="a06711.html#l00524">NL3D::CVertexBuffer::setVertexCoord()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00236">w</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00802">applyFakeGaussianBlur()</a>. +<p> +<div class="fragment"><pre>00827 { +00828 <span class="keywordtype">float</span> x0= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a572">x</a>; +00829 <span class="keywordtype">float</span> y0= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a573">y</a>; +00830 <span class="keywordtype">float</span> x1= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a572">x</a>+(<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a575">w</a>; +00831 <span class="keywordtype">float</span> y1= (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a573">y</a>+(<span class="keywordtype">float</span>)h; +00832 <span class="keywordtype">float</span> u0= x0*<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr7">_BlurTextureOOW</a>; +00833 <span class="keywordtype">float</span> v0= y0*<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr6">_BlurTextureOOH</a>; +00834 <span class="keywordtype">float</span> u1= x1*_BlurTextureOOW; +00835 <span class="keywordtype">float</span> v1= y1*_BlurTextureOOH; +00836 <a class="code" href="a04223.html#a566">index</a>*= 4; +00837 +00838 <span class="comment">// NB: the order of the Delta (--,++,-+,+-) is made so it works well with 2,3 or 4 texture support.</span> +00839 +00840 <span class="comment">// vertex 0</span> +00841 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setVertexCoord (index+0, CVector (x0, 0, y0)); +00842 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+0, 0, u0-_BlurTextureD05W, v0-_BlurTextureD05H); +00843 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+0, 1, u0+_BlurTextureD05W, v0+_BlurTextureD05H); +00844 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+0, 2, u0-_BlurTextureD05W, v0+_BlurTextureD05H); +00845 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+0, 3, u0+_BlurTextureD05W, v0-_BlurTextureD05H); +00846 <span class="comment">// vertex 1</span> +00847 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setVertexCoord (index+1, CVector (x1, 0, y0)); +00848 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+1, 0, u1-_BlurTextureD05W, v0-_BlurTextureD05H); +00849 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+1, 1, u1+_BlurTextureD05W, v0+_BlurTextureD05H); +00850 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+1, 2, u1-_BlurTextureD05W, v0+_BlurTextureD05H); +00851 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+1, 3, u1+_BlurTextureD05W, v0-_BlurTextureD05H); +00852 <span class="comment">// vertex 2</span> +00853 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setVertexCoord (index+2, CVector (x1, 0, y1)); +00854 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+2, 0, u1-_BlurTextureD05W, v1-_BlurTextureD05H); +00855 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+2, 1, u1+_BlurTextureD05W, v1+_BlurTextureD05H); +00856 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+2, 2, u1-_BlurTextureD05W, v1+_BlurTextureD05H); +00857 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+2, 3, u1+_BlurTextureD05W, v1-_BlurTextureD05H); +00858 <span class="comment">// vertex 3</span> +00859 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setVertexCoord (index+3, CVector (x0, 0, y1)); +00860 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+3, 0, u0-_BlurTextureD05W, v1-_BlurTextureD05H); +00861 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+3, 1, u0+_BlurTextureD05W, v1+_BlurTextureD05H); +00862 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+3, 2, u0-_BlurTextureD05W, v1+_BlurTextureD05H); +00863 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr1">_BlurQuads</a>.setTexCoord(index+3, 3, u0+_BlurTextureD05W, v1-_BlurTextureD05H); +00864 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagera10" doxytag="NL3D::CShadowMapManager::setQuadGridSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::setQuadGridSize </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>size</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>cellSize</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +change the QuadGrid size. it reset all the receivers! +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00203">203</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00121">_ShadowReceiverGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid< CTransform * >::create()</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>. +<p> +<div class="fragment"><pre>00204 { +00205 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr19">_ShadowReceiverGrid</a>.<a class="code" href="a03273.html#NL3D_1_1CQuadGridz772_1">create</a>(size, cellSize); +00206 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerd9" doxytag="NL3D::CShadowMapManager::updateBlurTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NL3D::CShadowMapManager::updateBlurTexture </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>w</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>h</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06372.html#l00745">745</a> of file <a class="el" href="a06372.html">shadow_map_manager.cpp</a>. +<p> +References <a class="el" href="a06373.html#l00150">_BlurMaterial</a>, <a class="el" href="a06373.html#l00143">_BlurTexture</a>, <a class="el" href="a06373.html#l00149">_BlurTextureD05H</a>, <a class="el" href="a06373.html#l00148">_BlurTextureD05W</a>, <a class="el" href="a06373.html#l00145">_BlurTextureH</a>, <a class="el" href="a06373.html#l00147">_BlurTextureOOH</a>, <a class="el" href="a06373.html#l00146">_BlurTextureOOW</a>, <a class="el" href="a06373.html#l00144">_BlurTextureW</a>, <a class="el" href="a05968.html#l00322">NL3D::CMaterial::setTexture()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, and <a class="el" href="a05646.html#l00236">w</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00234">renderGenerate()</a>. +<p> +<div class="fragment"><pre>00746 { +00747 <a class="code" href="a04223.html#a575">w</a>= max(w, 2U); +00748 h= max(h, 2U); +00749 <span class="comment">// if same size than setup, quit</span> +00750 <span class="keywordflow">if</span>(<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a>==<a class="code" href="a04223.html#a575">w</a> && <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr5">_BlurTextureH</a>==h) +00751 <span class="keywordflow">return</span>; +00752 +00753 <span class="comment">// release old SmartPtr</span> +00754 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(0, NULL); +00755 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(1, NULL); +00756 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(2, NULL); +00757 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(3, NULL); +00758 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>= NULL; +00759 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a>= <a class="code" href="a04223.html#a575">w</a>; +00760 _BlurTextureH= h; +00761 <span class="comment">// NB: the format must be RGBA; else slow copyFrameBufferToTexture()</span> +00762 <a class="code" href="a04558.html#a7">uint8</a> *tmpMem= <span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[4*<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a>*_BlurTextureH]; +00763 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a> = <span class="keyword">new</span> CTextureMem (tmpMem, 4*_BlurTextureW*_BlurTextureH, <span class="keyword">true</span>, <span class="keyword">false</span>, _BlurTextureW, _BlurTextureH); +00764 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>->setWrapS (ITexture::Clamp); +00765 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>->setWrapT (ITexture::Clamp); +00766 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>->setFilterMode (ITexture::Linear, ITexture::LinearMipMapOff); +00767 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>->generate(); +00768 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr2">_BlurTexture</a>->setReleasable (<span class="keyword">false</span>); +00769 +00770 <span class="comment">// set to the material</span> +00771 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(0, _BlurTexture); +00772 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(1, _BlurTexture); +00773 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(2, _BlurTexture); +00774 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr0">_BlurMaterial</a>.setTexture(3, _BlurTexture); +00775 +00776 <span class="comment">// compute values for texturing</span> +00777 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr7">_BlurTextureOOW</a>= 1.f / <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr8">_BlurTextureW</a>; +00778 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr6">_BlurTextureOOH</a>= 1.f / _BlurTextureH; +00779 <span class="comment">// The Delta HalfPixel</span> +00780 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr4">_BlurTextureD05W</a>= 0.5f*<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr7">_BlurTextureOOW</a>; +00781 <a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr3">_BlurTextureD05H</a>= 0.5f*<a class="code" href="a03371.html#NL3D_1_1CShadowMapManagerr6">_BlurTextureOOH</a>; +00782 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr0" doxytag="NL3D::CShadowMapManager::_BlurMaterial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02839.html">CMaterial</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr0">NL3D::CShadowMapManager::_BlurMaterial</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00150">150</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00802">applyFakeGaussianBlur()</a>, <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr1" doxytag="NL3D::CShadowMapManager::_BlurQuads" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03692.html">CVertexBuffer</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr1">NL3D::CShadowMapManager::_BlurQuads</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00151">151</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00802">applyFakeGaussianBlur()</a>, <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr2" doxytag="NL3D::CShadowMapManager::_BlurTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03408.html">CSmartPtr</a><<a class="el" href="a03487.html">ITexture</a>> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr2">NL3D::CShadowMapManager::_BlurTexture</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00143">143</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00786">copyScreenToBlurTexture()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr3" doxytag="NL3D::CShadowMapManager::_BlurTextureD05H" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr3">NL3D::CShadowMapManager::_BlurTextureD05H</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00149">149</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr4" doxytag="NL3D::CShadowMapManager::_BlurTextureD05W" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr4">NL3D::CShadowMapManager::_BlurTextureD05W</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00148">148</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr5" doxytag="NL3D::CShadowMapManager::_BlurTextureH" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr5">NL3D::CShadowMapManager::_BlurTextureH</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00145">145</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr6" doxytag="NL3D::CShadowMapManager::_BlurTextureOOH" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr6">NL3D::CShadowMapManager::_BlurTextureOOH</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00147">147</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr7" doxytag="NL3D::CShadowMapManager::_BlurTextureOOW" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr7">NL3D::CShadowMapManager::_BlurTextureOOW</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00146">146</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00826">setBlurQuadFakeGaussian()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr8" doxytag="NL3D::CShadowMapManager::_BlurTextureW" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr8">NL3D::CShadowMapManager::_BlurTextureW</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00144">144</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00745">updateBlurTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr9" doxytag="NL3D::CShadowMapManager::_CasterShadowMaterial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02839.html">CMaterial</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr9">NL3D::CShadowMapManager::_CasterShadowMaterial</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00160">160</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06373.html#l00099">getCasterShadowMaterial()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr10" doxytag="NL3D::CShadowMapManager::_ClampTexture" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03408.html">NLMISC::CSmartPtr</a><<a class="el" href="a03487.html">ITexture</a>> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr10">NL3D::CShadowMapManager::_ClampTexture</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00157">157</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr11" doxytag="NL3D::CShadowMapManager::_FillMaterial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02839.html">CMaterial</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr11">NL3D::CShadowMapManager::_FillMaterial</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00140">140</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00669">fillBlackBorder()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr12" doxytag="NL3D::CShadowMapManager::_FillQuads" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03692.html">CVertexBuffer</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr12">NL3D::CShadowMapManager::_FillQuads</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00139">139</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, <a class="el" href="a06372.html#l00669">fillBlackBorder()</a>, and <a class="el" href="a06372.html#l00731">setBlackQuad()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr13" doxytag="NL3D::CShadowMapManager::_FreeShadowTextures" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery0">ItTextureMap</a>> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr13">NL3D::CShadowMapManager::_FreeShadowTextures</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00169">169</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00957">allocateTexture()</a>, <a class="el" href="a06372.html#l01013">garbageShadowTextures()</a>, and <a class="el" href="a06372.html#l01000">releaseTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr14" doxytag="NL3D::CShadowMapManager::_GenerateShadowCasters" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02316.html">CTransform</a>*> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr14">NL3D::CShadowMapManager::_GenerateShadowCasters</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00118">118</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00215">addShadowCasterGenerate()</a>, <a class="el" href="a06372.html#l00945">clearGenerateShadowCasters()</a>, <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, <a class="el" href="a06372.html#l00234">renderGenerate()</a>, and <a class="el" href="a06372.html#l00880">selectShadowMapsToGenerate()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr15" doxytag="NL3D::CShadowMapManager::_NumShadowReceivers" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr15">NL3D::CShadowMapManager::_NumShadowReceivers</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00122">122</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00223">addShadowReceiver()</a>, <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, <a class="el" href="a06372.html#l00234">renderGenerate()</a>, <a class="el" href="a06372.html#l00445">renderProject()</a>, and <a class="el" href="a06372.html#l00194">~CShadowMapManager()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr16" doxytag="NL3D::CShadowMapManager::_PolySmooth" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr16">NL3D::CShadowMapManager::_PolySmooth</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00136">136</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, <a class="el" href="a06373.html#l00094">enableShadowPolySmooth()</a>, <a class="el" href="a06373.html#l00096">getEnableShadowPolySmooth()</a>, and <a class="el" href="a06372.html#l00234">renderGenerate()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr17" doxytag="NL3D::CShadowMapManager::_ReceiveShadowMaterial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02839.html">CMaterial</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr17">NL3D::CShadowMapManager::_ReceiveShadowMaterial</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00154">154</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00445">renderProject()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr18" doxytag="NL3D::CShadowMapManager::_ShadowCasters" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02316.html">CTransform</a>*> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr18">NL3D::CShadowMapManager::_ShadowCasters</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00116">116</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00209">addShadowCaster()</a>, <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, <a class="el" href="a06372.html#l00234">renderGenerate()</a>, <a class="el" href="a06372.html#l00445">renderProject()</a>, <a class="el" href="a06372.html#l00880">selectShadowMapsToGenerate()</a>, and <a class="el" href="a06372.html#l00194">~CShadowMapManager()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr19" doxytag="NL3D::CShadowMapManager::_ShadowReceiverGrid" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03273.html">TShadowReceiverGrid</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr19">NL3D::CShadowMapManager::_ShadowReceiverGrid</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00121">121</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00223">addShadowReceiver()</a>, <a class="el" href="a06372.html#l00234">renderGenerate()</a>, <a class="el" href="a06372.html#l00445">renderProject()</a>, <a class="el" href="a06372.html#l00203">setQuadGridSize()</a>, and <a class="el" href="a06372.html#l00194">~CShadowMapManager()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr20" doxytag="NL3D::CShadowMapManager::_ShadowTextureMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagery2">TTextureMap</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr20">NL3D::CShadowMapManager::_ShadowTextureMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00167">167</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00957">allocateTexture()</a>, <a class="el" href="a06372.html#l01013">garbageShadowTextures()</a>, and <a class="el" href="a06372.html#l01000">releaseTexture()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr21" doxytag="NL3D::CShadowMapManager::_XYZToUWVMatrix" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr21">NL3D::CShadowMapManager::_XYZToUWVMatrix</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00155">155</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00445">renderProject()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CShadowMapManagerr22" doxytag="NL3D::CShadowMapManager::_XYZToWUVMatrix" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a> <a class="el" href="a03371.html#NL3D_1_1CShadowMapManagerr22">NL3D::CShadowMapManager::_XYZToWUVMatrix</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06373.html#l00156">156</a> of file <a class="el" href="a06373.html">shadow_map_manager.h</a>. +<p> +Referenced by <a class="el" href="a06372.html#l00059">CShadowMapManager()</a>, and <a class="el" href="a06372.html#l00445">renderProject()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06373.html">shadow_map_manager.h</a><li><a class="el" href="a06372.html">shadow_map_manager.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 07:43:19 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |