1 | #pragma once
|
---|
2 | #include "RenderTechnique.h"
|
---|
3 |
|
---|
4 | /**
|
---|
5 | @brief Base abstract class __declspec( dllexport ) of rendering a light volume of a particle system.
|
---|
6 |
|
---|
7 | Light volumes are used when self shadowing of particle systems should be simulated.
|
---|
8 | Each layer of the volume represents the amount of transmitted light. The current implementation uses four grayscale layers,
|
---|
9 | and places these layers to the four channel of the light volume texture.
|
---|
10 | */
|
---|
11 | class __declspec( dllexport ) IllumVolumeRenderTechnique : virtual public RenderTechnique
|
---|
12 | {
|
---|
13 | public:
|
---|
14 | /**
|
---|
15 | @brief Constructor.
|
---|
16 |
|
---|
17 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
18 | @param illumVolumeUpdateInterval the update frequency of the light volume
|
---|
19 | @param illumTextureResolution the resolution of the light volume texture
|
---|
20 | @param textureDepth the number of layers to use (should be set to 1)
|
---|
21 | @param useDistCalc flag to skip updates if the shaded particle system is far away (not used)
|
---|
22 | @param useHierarchicalImpostor set this flag to true if the particle system is a hierarchical particle system
|
---|
23 | @param parentRenderable the object to operate on
|
---|
24 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
25 | */
|
---|
26 | IllumVolumeRenderTechnique(
|
---|
27 | unsigned long startFrame,
|
---|
28 | unsigned long illumVolumeUpdateInterval,
|
---|
29 | unsigned int illumTextureResolution,
|
---|
30 | unsigned int textureDepth,
|
---|
31 | bool useDistCalc,
|
---|
32 | bool useHierarchicalImpostor,
|
---|
33 | ElementaryRenderable* parentRenderable,
|
---|
34 | TechniqueGroup* parentTechniqueGroup
|
---|
35 | );
|
---|
36 | virtual ~IllumVolumeRenderTechnique();
|
---|
37 |
|
---|
38 | //inherited
|
---|
39 | void update(unsigned long frameNum);
|
---|
40 | //inherited
|
---|
41 | void runChanged(RenderingRunType runType, RenderingRun* run);
|
---|
42 | //inherited
|
---|
43 | void runUpdated(RenderingRunType runType, RenderingRun* run);
|
---|
44 |
|
---|
45 | protected:
|
---|
46 | /**
|
---|
47 | @brief the update frequency of the light volume
|
---|
48 | */
|
---|
49 | unsigned long illumVolumeUpdateInterval;
|
---|
50 | /**
|
---|
51 | @brief the resolution of the light volume texture
|
---|
52 | */
|
---|
53 | unsigned int illumTextureResolution;
|
---|
54 | /**
|
---|
55 | @brief the number of layers to use (should be set to 1)
|
---|
56 | */
|
---|
57 | unsigned int textureDepth;
|
---|
58 | /**
|
---|
59 | @brief offset in frame number used during update
|
---|
60 | */
|
---|
61 | unsigned long startFrame;
|
---|
62 | /**
|
---|
63 | @brief flag to skip updates if the shaded particle system is far away (not used)
|
---|
64 | */
|
---|
65 | bool useDistCalc;
|
---|
66 | /**
|
---|
67 | @brief set this flag to true if the particle system is a hierarchical particle system
|
---|
68 | */
|
---|
69 | bool useHierarchicalImpostor;
|
---|
70 |
|
---|
71 | /**
|
---|
72 | @brief creates a light volume rendering run needed by this technique
|
---|
73 |
|
---|
74 | @return pointer to the created LightVolumeRenderingRun instance
|
---|
75 | */
|
---|
76 | virtual RenderingRun* createLightVolumeRenderingRun()=0;
|
---|
77 | /**
|
---|
78 | @brief Called if the LightVolumeRenderingRun is chaged
|
---|
79 |
|
---|
80 | @param pointer to the new LightVolumeRenderingRun instance to use
|
---|
81 | */
|
---|
82 | virtual void lightVolumeChanged(RenderingRun* run) = 0;
|
---|
83 | /**
|
---|
84 | @brief Called if the LightVolumeRenderingRun is updated
|
---|
85 |
|
---|
86 | @param pointer to the updated LightVolumeRenderingRun instance
|
---|
87 | */
|
---|
88 | virtual void lightVolumeUpdated(RenderingRun* run) = 0;
|
---|
89 | /**
|
---|
90 | @brief Called if the ChildParticleSystemRenderingRun is chaged
|
---|
91 |
|
---|
92 | Only called if this particle system is a hierarchical particle system.
|
---|
93 |
|
---|
94 | @param pointer to the new ChildParticleSystemRenderingRun instance to use
|
---|
95 | */
|
---|
96 | virtual void hierarchicalImpostorUpdated(RenderingRun* run) = 0;
|
---|
97 |
|
---|
98 | }; |
---|