1 | #pragma once
|
---|
2 |
|
---|
3 | //disable inheritance warning caused by multiple inheritance
|
---|
4 | #if _WIN32
|
---|
5 | #if _MSC_VER
|
---|
6 | #pragma warning(disable: 4250)
|
---|
7 | #endif
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #include "OgreRenderingRun.h"
|
---|
11 | #include "OgreSharedRuns.h"
|
---|
12 |
|
---|
13 |
|
---|
14 | /**
|
---|
15 | @brief Weight computing rendering run.
|
---|
16 |
|
---|
17 | This run is used in the pathmap technique.
|
---|
18 | It creates a texture for a light source that stores the weights that should be used for each cluster of entry points.
|
---|
19 | */
|
---|
20 | class OgrePMWeightComputeRenderingRun : public OgreRenderingRun
|
---|
21 | {
|
---|
22 | public:
|
---|
23 |
|
---|
24 | /**
|
---|
25 | @brief Constructor.
|
---|
26 |
|
---|
27 | @param name the name of the weight texture to be created
|
---|
28 | @param LightName the name of the light source to use
|
---|
29 | */
|
---|
30 | OgrePMWeightComputeRenderingRun(String name, String LightName);
|
---|
31 |
|
---|
32 | virtual ~OgrePMWeightComputeRenderingRun(){}
|
---|
33 |
|
---|
34 | /**
|
---|
35 | @brief returns the name of the weight texture
|
---|
36 | */
|
---|
37 | static String getPMWeightTextureName(){return weightTexture->getName();}
|
---|
38 | //not used
|
---|
39 | float* getWeights(){return weights;}
|
---|
40 |
|
---|
41 | void freeAllResources();
|
---|
42 | static void sumWeights(unsigned long frameNum);
|
---|
43 |
|
---|
44 | protected:
|
---|
45 | /**
|
---|
46 | @brief light view-projection matrix
|
---|
47 | */
|
---|
48 | Matrix4 lightMatrix;
|
---|
49 | /**
|
---|
50 | @brief light view matrix
|
---|
51 | */
|
---|
52 | Matrix4 lightViewMatrix;
|
---|
53 | /**
|
---|
54 | @brief the name of the weight texture that was created by this run
|
---|
55 | */
|
---|
56 | String name;
|
---|
57 | /**
|
---|
58 | @brief a pointer to the weight texture that was created by this run
|
---|
59 | */
|
---|
60 | static Texture* weightTexture;
|
---|
61 | /**
|
---|
62 | @brief A pointer to a texture that stores weights for all the entry point.
|
---|
63 |
|
---|
64 | This texture will be used to determine the weights of the clusters.
|
---|
65 | */
|
---|
66 | static Texture* allWeightsTexture;
|
---|
67 | /**
|
---|
68 | @brief A pointer to the light source.
|
---|
69 | */
|
---|
70 | Light* light;
|
---|
71 | //not used
|
---|
72 | float* weights;
|
---|
73 | //inherited
|
---|
74 | void updateFrame(unsigned long frameNum);
|
---|
75 | /**
|
---|
76 | @brief Creates the weight texture.
|
---|
77 |
|
---|
78 | It also creates the texture storing all weights. @see allWeightsTexture
|
---|
79 | */
|
---|
80 | inline void createWeightMap();
|
---|
81 | };
|
---|