source: obsolete/trunk/BUTE/Ogre/PreComputingRuns/SpecularEnvironmentMapRun.cpp @ 126

Revision 126, 1.4 KB checked in by barsi, 19 years ago (diff)

Added a folder remotely

Line 
1#include "Ogre.h"
2#include "OgreEffectWrapper.h"
3#include "managedogrerendertexturepass.h"
4#include "SEMEnvironmentMapPass.h"
5#include "SpecularEnvironmentMapRun.h"
6
7SpecularEnvironmentMapRun::SpecularEnvironmentMapRun(Entity* entity, unsigned int resolution)
8{
9        Root* mRoot=Root::getSingletonPtr();
10        OgreAssert(mRoot!=NULL,"Root is not yet generated, rendering will fail.");
11        envMapPass=new SEMEnvironmentMapPass(mRoot,resolution,resolution);
12}
13
14SpecularEnvironmentMapRun::~SpecularEnvironmentMapRun(void)
15{
16        delete envMapPass;
17}
18
19void SpecularEnvironmentMapRun::update(){
20        envMapPass->clearRenderTargets();
21        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_POSITIVE_X);
22        envMapPass->update();
23        envMapPass->clearRenderTargets();
24        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_POSITIVE_Y);
25        envMapPass->update();
26        envMapPass->clearRenderTargets();
27        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_POSITIVE_Z);
28        envMapPass->update();
29        envMapPass->clearRenderTargets();
30        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_NEGATIVE_X);
31        envMapPass->update();
32        envMapPass->clearRenderTargets();
33        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_NEGATIVE_Y);
34        envMapPass->update();
35        envMapPass->clearRenderTargets();
36        envMapPass->addRenderTarget(envMapPass->getRenderTexture(),CUBEMAP_FACE_NEGATIVE_Z);
37        envMapPass->update();
38}
Note: See TracBrowser for help on using the repository browser.