[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);
|
---|
[2320] | 31 |
|
---|
| 32 | virtual ~OgrePMWeightComputeRenderingRun(){}
|
---|
| 33 |
|
---|
[2189] | 34 | /**
|
---|
[2264] | 35 | @brief returns the name of the weight texture
|
---|
[2189] | 36 | */
|
---|
[2333] | 37 | static String getPMWeightTextureName(){return weightTexture->getName();}
|
---|
[2264] | 38 | //not used
|
---|
[2189] | 39 | float* getWeights(){return weights;}
|
---|
[2320] | 40 |
|
---|
| 41 | void freeAllResources();
|
---|
[2333] | 42 | static void sumWeights(unsigned long frameNum);
|
---|
[2189] | 43 |
|
---|
| 44 | protected:
|
---|
| 45 | /**
|
---|
[2264] | 46 | @brief light view-projection matrix
|
---|
[2189] | 47 | */
|
---|
| 48 | Matrix4 lightMatrix;
|
---|
[2264] | 49 | /**
|
---|
| 50 | @brief light view matrix
|
---|
| 51 | */
|
---|
[2189] | 52 | Matrix4 lightViewMatrix;
|
---|
| 53 | /**
|
---|
| 54 | @brief the name of the weight texture that was created by this run
|
---|
| 55 | */
|
---|
| 56 | String name;
|
---|
| 57 | /**
|
---|
[2264] | 58 | @brief a pointer to the weight texture that was created by this run
|
---|
[2189] | 59 | */
|
---|
[2333] | 60 | static Texture* weightTexture;
|
---|
[2264] | 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 | */
|
---|
[2333] | 66 | static Texture* allWeightsTexture;
|
---|
[2264] | 67 | /**
|
---|
| 68 | @brief A pointer to the light source.
|
---|
| 69 | */
|
---|
[2189] | 70 | Light* light;
|
---|
[2264] | 71 | //not used
|
---|
[2189] | 72 | float* weights;
|
---|
| 73 | //inherited
|
---|
| 74 | void updateFrame(unsigned long frameNum);
|
---|
[2264] | 75 | /**
|
---|
| 76 | @brief Creates the weight texture.
|
---|
| 77 |
|
---|
| 78 | It also creates the texture storing all weights. @see allWeightsTexture
|
---|
| 79 | */
|
---|
[2189] | 80 | inline void createWeightMap();
|
---|
| 81 | };
|
---|