Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
GPUNormalMapManager.cpp
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of Hydrax.
4Visit ---
5
6Copyright (C) 2008 Xavier Verguín González <xavierverguin@hotmail.com>
7 <xavyiy@gmail.com>
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU Lesser General Public License as published by the Free Software
11Foundation; either version 2 of the License, or (at your option) any later
12version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License along with
19this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21http://www.gnu.org/copyleft/lesser.txt.
22--------------------------------------------------------------------------------
23*/
24
25#include <GPUNormalMapManager.h>
26
27#include <Hydrax.h>
28
29namespace Hydrax
30{
41
46
60
62 {
63 if (!mCreated)
64 {
65 return;
66 }
67
68 for (unsigned int k = 0; k < mTextures.size(); k++)
69 {
70 Ogre::TextureManager::getSingleton().remove(mTextures.at(k)->getName());
71 }
72
73 mTextures.clear();
74
76
77 Ogre::HighLevelGpuProgramManager::getSingleton().unload(mNormalMapMaterial->getTechnique(0)->getPass(0)->getVertexProgramName());
78 Ogre::HighLevelGpuProgramManager::getSingleton().unload(mNormalMapMaterial->getTechnique(0)->getPass(0)->getFragmentProgramName());
79 Ogre::HighLevelGpuProgramManager::getSingleton().remove(mNormalMapMaterial->getTechnique(0)->getPass(0)->getVertexProgramName());
80 Ogre::HighLevelGpuProgramManager::getSingleton().remove(mNormalMapMaterial->getTechnique(0)->getPass(0)->getFragmentProgramName());
81
82 Ogre::MaterialManager::getSingleton().remove(mNormalMapMaterial->getName());
83 mNormalMapMaterial.reset();
84
85 mCreated = false;
86 }
87}
std::vector< Ogre::TexturePtr > mTextures
The normal map material needs some textures wich will be filled by code.
GPUNormalMapManager(Hydrax *h)
Constructor.
Ogre::MaterialPtr mNormalMapMaterial
This material must be created in the noise module, in order to be according with the Hydrax modulable...
Hydrax * mHydrax
Hydrax main pointer.
RttManager * mRttManager
Rtt manager pointer.
bool mCreated
Has been create() already called?
bool isComponent(const HydraxComponent &Component)
Returns if the especified component is active.
Definition Hydrax.cpp:612
MaterialManager * getMaterialManager()
Get Hydrax::MaterialManager.
Definition Hydrax.h:325
void reload(const MaterialType &Material)
Reload material.
void setNumberOfChannels(const RttType &Rtt, const NumberOfChannels &NOC)
Definition RttManager.h:179
void remove(const RttType &Rtt)
Removes a RTT.
void initialize(const RttType &Rtt)
Initialize a RTT.
void setBitsPerChannel(const RttType &Rtt, const BitsPerChannel &BPC)
Definition RttManager.h:194
@ HYDRAX_COMPONENT_UNDERWATER
Definition Enums.h:65