diff options
author | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-04-13 08:40:18 +0200 |
---|---|---|
committer | Lizzy Fleckenstein <eliasfleckenstein@web.de> | 2023-04-13 18:01:09 +0200 |
commit | bf90df100e120e272c14c7975a22ed01bf3ad215 (patch) | |
tree | 073f4cf268a7f9407e5ad4a313ae76a619ff1dcc /include/IMeshSceneNode.h | |
parent | 7a3fc62ada4001d5bb6c97ed26ec19a4e7c9d9ac (diff) | |
download | irrlicht-bf90df100e120e272c14c7975a22ed01bf3ad215.tar.xz |
Add back lighting system
Code is taken from latest irrlicht trunk; this is relevant because there have been fixes to stencil shadows since 1.8.5 (irrlicht SVN revision 5933).
Diffstat (limited to 'include/IMeshSceneNode.h')
-rw-r--r-- | include/IMeshSceneNode.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/IMeshSceneNode.h b/include/IMeshSceneNode.h index d4f6fff..e4b3b05 100644 --- a/include/IMeshSceneNode.h +++ b/include/IMeshSceneNode.h @@ -12,6 +12,7 @@ namespace irr namespace scene
{
+class IShadowVolumeSceneNode;
class IMesh;
@@ -37,6 +38,31 @@ public: /** \return Pointer to mesh which is displayed by this node. */
virtual IMesh* getMesh(void) = 0;
+ /** The shadow can be rendered using the ZPass or the zfail
+ method. ZPass is a little bit faster because the shadow volume
+ creation is easier, but with this method there occur ugly
+ looking artifacts when the camera is inside the shadow volume.
+ These error do not occur with the ZFail method, but it can
+ have trouble with clipping to the far-plane (it usually works
+ well in OpenGL and fails with other drivers).
+ \param shadowMesh: Optional custom mesh for shadow volume.
+ \param id: Id of the shadow scene node. This id can be used to
+ identify the node later.
+ \param zfailmethod: If set to true, the shadow will use the
+ zfail method, if not, zpass is used.
+ \param infinity: Value used by the shadow volume algorithm to
+ scale the shadow volume. For zfail shadow volumes on some drivers
+ only suppport finite shadows, so camera zfar must be larger than
+ shadow back cap,which is depending on the infinity parameter).
+ Infinity value also scales by the scaling factors of the model.
+ If shadows don't show up with zfail then try reducing infinity.
+ If shadows are cut-off then try increasing infinity.
+ \return Pointer to the created shadow scene node. This pointer
+ should not be dropped. See IReferenceCounted::drop() for more
+ information. */
+ virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
+ s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
+
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
/** In this way it is possible to change the materials of a mesh
causing all mesh scene nodes referencing this mesh to change, too.
|