Skip to content

Commit 6dca65f

Browse files
committed
Docs: improve stencil shadow algorithm documentation
1 parent 30e7ec0 commit 6dca65f

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

Docs/src/bibliography.bib

+7
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,10 @@ @article{moller1997fast
139139
year={1997},
140140
publisher={Taylor \& Francis}
141141
}
142+
143+
@article{mcguire2003fast,
144+
title={Fast, practical and robust shadows},
145+
author={McGuire, Morgan and Hughes, John F and Egan, Kevin and Kilgard, Mark J and Everitt, Cass},
146+
journal={Brown University Computer Science Tech Report CS-03-19, November},
147+
year={2003}
148+
}

OgreMain/include/OgreMesh.h

+1-18
Original file line numberDiff line numberDiff line change
@@ -730,24 +730,7 @@ namespace Ogre {
730730
/** Destroys and frees the edge lists this mesh has built. */
731731
void freeEdgeList(void);
732732

733-
/** This method prepares the mesh for generating a renderable shadow volume.
734-
@remarks
735-
Preparing a mesh to generate a shadow volume involves firstly ensuring that the
736-
vertex buffer containing the positions for the mesh is a standalone vertex buffer,
737-
with no other components in it. This method will therefore break apart any existing
738-
vertex buffers this mesh holds if position is sharing a vertex buffer.
739-
Secondly, it will double the size of this vertex buffer so that there are 2 copies of
740-
the position data for the mesh. The first half is used for the original, and the second
741-
half is used for the 'extruded' version of the mesh. The vertex count of the main
742-
VertexData used to render the mesh will remain the same though, so as not to add any
743-
overhead to regular rendering of the object.
744-
Both copies of the position are required in one buffer because shadow volumes stretch
745-
from the original mesh to the extruded version.
746-
@par
747-
Because shadow volumes are rendered in turn, no additional
748-
index buffer space is allocated by this method, a shared index buffer allocated by the
749-
shadow rendering algorithm is used for addressing this extended vertex buffer.
750-
*/
733+
/// @copydoc VertexData::prepareForShadowVolume
751734
void prepareForShadowVolume(void);
752735

753736
/** Return the edge list for this mesh, building it if required.

OgreMain/include/OgreVertexIndexData.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ namespace Ogre {
119119
*/
120120
VertexData* clone(bool copyData = true, HardwareBufferManagerBase* mgr = 0) const OGRE_NODISCARD;
121121

122-
/** Modifies the vertex data to be suitable for use for rendering shadow geometry.
123-
@remarks
122+
/** Modifies the vertex data to be suitable for use for rendering shadow geometry as in @cite mcguire2003fast
123+
124124
Preparing vertex data to generate a shadow volume involves firstly ensuring that the
125125
vertex buffer containing the positions is a standalone vertex buffer,
126126
with no other components in it. This method will therefore break apart any existing
@@ -131,12 +131,16 @@ namespace Ogre {
131131
the same though, so as not to add any overhead to regular rendering of the object.
132132
Both copies of the position are required in one buffer because shadow volumes stretch
133133
from the original mesh to the extruded version.
134-
@par
134+
135135
It's important to appreciate that this method can fundamentally change the structure of your
136136
vertex buffers, although in reality they will be new buffers. As it happens, if other
137137
objects are using the original buffers then they will be unaffected because the reference
138138
counting will keep them intact. However, if you have made any assumptions about the
139139
structure of the vertex data in the buffers of this object, you may have to rethink them.
140+
141+
Because shadow volumes are rendered in turn, no additional
142+
index buffer space is allocated by this method, a shared index buffer allocated by the
143+
shadow rendering algorithm is used for addressing this extended vertex buffer.
140144
*/
141145
void prepareForShadowVolume(void);
142146

0 commit comments

Comments
 (0)