[2189] | 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 | /**
|
---|
[2264] | 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.
|
---|
[2189] | 19 | */
|
---|
| 20 | class OgrePMWeightComputeRenderingRun : public OgreRenderingRun
|
---|
| 21 | {
|
---|
| 22 | public:
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | @brief Constructor.
|
---|
| 26 |
|
---|
[2264] | 27 | @param name the name of the weight texture to be created
|
---|
| 28 | @param LightName the name of the light source to use
|
---|
[2189] | 29 | */
|
---|
| 30 | OgrePMWeightComputeRenderingRun(String name, String LightName);
|
---|
| 31 | /**
|
---|
[2264] | 32 | @brief returns the name of the weight texture
|
---|
[2189] | 33 | */
|
---|
[2200] | 34 | String getPMWeightTetureName(){return weightTexture->getName();}
|
---|
[2264] | 35 | //not used
|
---|
[2189] | 36 | float* getWeights(){return weights;}
|
---|
| 37 |
|
---|
| 38 | protected:
|
---|
| 39 | /**
|
---|
[2264] | 40 | @brief light view-projection matrix
|
---|
[2189] | 41 | */
|
---|
| 42 | Matrix4 lightMatrix;
|
---|
[2264] | 43 | /**
|
---|
| 44 | @brief light view matrix
|
---|
| 45 | */
|
---|
[2189] | 46 | Matrix4 lightViewMatrix;
|
---|
| 47 | /**
|
---|
| 48 | @brief the name of the weight texture that was created by this run
|
---|
| 49 | */
|
---|
| 50 | String name;
|
---|
| 51 | /**
|
---|
[2264] | 52 | @brief a pointer to the weight texture that was created by this run
|
---|
[2189] | 53 | */
|
---|
| 54 | Texture* weightTexture;
|
---|
[2264] | 55 | /**
|
---|
| 56 | @brief A pointer to a texture that stores weights for all the entry point.
|
---|
| 57 |
|
---|
| 58 | This texture will be used to determine the weights of the clusters.
|
---|
| 59 | */
|
---|
[2200] | 60 | Texture* allWeightsTexture;
|
---|
[2264] | 61 | /**
|
---|
| 62 | @brief A pointer to the light source.
|
---|
| 63 | */
|
---|
[2189] | 64 | Light* light;
|
---|
[2264] | 65 | //not used
|
---|
[2189] | 66 | float* weights;
|
---|
| 67 | //inherited
|
---|
| 68 | void updateFrame(unsigned long frameNum);
|
---|
[2264] | 69 | /**
|
---|
| 70 | @brief Creates the weight texture.
|
---|
| 71 |
|
---|
| 72 | It also creates the texture storing all weights. @see allWeightsTexture
|
---|
| 73 | */
|
---|
[2189] | 74 | inline void createWeightMap();
|
---|
| 75 | };
|
---|