Files
yugioh-legacy-engine/server/irrlicht/include/IShadowVolumeSceneNode.h
T
donnyandClaude Fable 5.1 da27435cdb server: import the duel server (nanahira/ygopro server at 52c868ce)
The server tree of https://code.moenext.com/nanahira/ygopro.git, branch
server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/,
premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps
them in resource/ and copies them in before building). No game assets, no
scripts, no ocgcore submodule: the core is ../core.

The third-party sources upstream's Windows CI downloads are vendored here
at the positions its premake expects, each with its premake fragment from
upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent
2.1.13-stable (tests, samples and autotools helpers left out; the files
its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib
and examples left out), xz 5.8.3 (src/liblzma + src/common only), and
irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht
headers and the 11 .cpp files the server's zip reader project compiles.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:21 -07:00

94 lines
3.3 KiB
C++

// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef IRR_I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED
#define IRR_I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED
#include "ISceneNode.h"
namespace irr
{
namespace scene
{
class IMesh;
enum ESHADOWVOLUME_OPTIMIZATION
{
//! Create volumes around every triangle
ESV_NONE,
//! Create volumes only around the silhouette of the mesh
/** This can reduce the number of volumes drastically,
but will have an upfront-cost where it calculates adjacency of
triangles. Also it will not work with all models. Basically
if you see strange black shadow lines then you have a model
for which it won't work.
We get that information about adjacency by comparing the positions of
all edges in the mesh (even if they are in different meshbuffers). */
ESV_SILHOUETTE_BY_POS
};
//! Options for what happens in IShadowVolumeSceneNode::updateShadowVolumes
enum ESHADOWVOLUME_FREEZE
{
//! Default - shadow volumes update on each call
ESF_RUN,
//! Update the shadow volumes once, then switch to freeze
ESF_FREEZE_AFTER_UPDATE,
//! Do no longer update the shadow volumes
ESF_FREEZE
};
//! Scene node for rendering a shadow volume into a stencil buffer.
class IShadowVolumeSceneNode : public ISceneNode
{
public:
//! constructor
IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
: ISceneNode(parent, mgr, id) {}
//! Sets the mesh from which the shadow volume should be generated.
/** To optimize shadow rendering, use a simpler mesh for shadows.
*/
virtual void setShadowMesh(const IMesh* mesh) = 0;
//! Updates the shadow volumes for current light positions.
virtual void updateShadowVolumes() = 0;
//! Control if updateShadowVolumes really updates the shadow volumes
/** Usually Irrlicht nodes will update the shadow every frame when
they are not culled. But this can be expensive and isn't always necessary,
p.E. with static objects and unchanging lights. */
virtual void setFreeze(ESHADOWVOLUME_FREEZE behavior) = 0;
virtual ESHADOWVOLUME_FREEZE getFreeze() const = 0;
//! Set optimization used to create shadow volumes
/** Default is ESV_SILHOUETTE_BY_POS. If the shadow
looks bad then give ESV_NONE a try (which will be slower).
Alternatively you can try to fix the model, it's often
because it's not closed (aka if you'd put water in it then
that would leak out). */
virtual void setOptimization(ESHADOWVOLUME_OPTIMIZATION optimization) = 0;
//! Get currently active optimization used to create shadow volumes
virtual ESHADOWVOLUME_OPTIMIZATION getOptimization() const = 0;
//! Get number of shadow volumes the node currently has.
//! Note that this usually gets updated with updateShadowVolumes,
//! so the returned number doesn't mean much before that call.
virtual u32 getNumShadowVolumes() const= 0;
//! Get the number of shadow volumes which got drawn in the last render() call
//! Number is already reset in OnRegisterSceneNode
virtual u32 getNumRenderedShadowVolumes() const = 0;
};
} // end namespace scene
} // end namespace irr
#endif