[126] | 1 | // author: Barnabas Aszodi (BME-IIT)
|
---|
| 2 |
|
---|
| 3 | #include "Ogre.h"
|
---|
| 4 | #include "OgreEffectWrapper.h"
|
---|
| 5 | #include "ManagedOgreRenderTexturePass.h"
|
---|
| 6 | #include "CAURenderPhotonUVMapPass.h"
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 | CAURenderPhotonUVMapPass::CAURenderPhotonUVMapPass(
|
---|
| 10 | Root* mRoot,const String& renderTextureName,unsigned int width,unsigned int height,
|
---|
| 11 | TextureType texType , PixelFormat internalFormat ,
|
---|
| 12 | const NameValuePairList *miscParams,
|
---|
| 13 | bool fullScreenQuadRenderer):ManagedOgreRenderTexturePass(mRoot,renderTextureName,width,height,texType,internalFormat,miscParams,fullScreenQuadRenderer)
|
---|
| 14 | {
|
---|
| 15 | effectWrapper->createMaterial("RenderPhotonUVMap");
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | void CAURenderPhotonUVMapPass::onRenderStart(NameValuePairList* namedParams){
|
---|
| 19 | effectWrapper->SetTechniqueToUse(0);
|
---|
| 20 | effectWrapper->BeginPass();
|
---|
| 21 | effectWrapper->SetVertexProgramParameters();
|
---|
| 22 | effectWrapper->SetMatrix("g_mWorldEntityMesh",g_mWorldEntityMesh);
|
---|
| 23 | effectWrapper->SetMatrix("g_mWorldViewProj",g_mWorldViewProj);
|
---|
| 24 | effectWrapper->SetVector3("g_vLightPos3f",g_vLightPos3f);
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | void CAURenderPhotonUVMapPass::onRenderEnd(NameValuePairList* namedParams)
|
---|
| 28 | {
|
---|
| 29 | effectWrapper->EndPass();
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | Matrix4 CAURenderPhotonUVMapPass::getWorldEntityMesh()
|
---|
| 33 | {
|
---|
| 34 | return g_mWorldEntityMesh;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | void CAURenderPhotonUVMapPass::setWorldEntityMesh( Matrix4 matrix4 )
|
---|
| 38 | {
|
---|
| 39 | g_mWorldEntityMesh = matrix4;
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | Matrix4 CAURenderPhotonUVMapPass::getWorldViewProj()
|
---|
| 43 | {
|
---|
| 44 | return g_mWorldViewProj;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | void CAURenderPhotonUVMapPass::setWorldViewProj( Matrix4 matrix4 )
|
---|
| 48 | {
|
---|
| 49 | g_mWorldViewProj = matrix4;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | Vector3 CAURenderPhotonUVMapPass::getLightPos3f()
|
---|
| 53 | {
|
---|
| 54 | return g_vLightPos3f;
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | void CAURenderPhotonUVMapPass::setLightPos3f( Vector3 v )
|
---|
| 58 | {
|
---|
| 59 | g_vLightPos3f = v;
|
---|
| 60 | }
|
---|