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