Frapper  1.0a
AdvancedRenderNode.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 version.
13 
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License along with
19 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21 http://www.gnu.org/copyleft/lesser.txt.
22 -----------------------------------------------------------------------------
23 */
24 
36 
37 #ifndef ADVANCEDRENDERNODE_H
38 #define ADVANCEDRENDERNODE_H
39 
40 #include "GeometryRenderNode.h"
41 #include "OgreTools.h"
42 
43 // OGRE
44 #include <Ogre.h>
45 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
46 #include <windows.h>
47 #endif
48 
49 //#define WRINKLE_DEBUG
50 
51 namespace AdvancedRenderNode {
52 using namespace Frapper;
53 
57 class AdvancedRenderNode;
58 
59 
63 class MaterialSwitcher : public Ogre::MaterialManager::Listener
64 {
65 
66 public: // constructors and destructors
67 
72 
80  virtual ~MaterialSwitcher ();
81 
82 public: // methods
83 
89  Ogre::Technique* handleSchemeNotFound(unsigned short schemeIndex,
90  const Ogre::String& schemeName,
91  Ogre::Material* originalMaterial,
92  unsigned short lodIndex,
93  const Ogre::Renderable* rend);
94 
95 protected: // data
96 
97  Ogre::Technique *m_mrtTechnique;
98  Ogre::Technique *m_wrinkleMappingTechnique; // for SaC-mapping
99 };
100 
101 
102 
107 {
108 
109  Q_OBJECT
110 
111 public: // constructors and destructors
112 
119  AdvancedRenderNode ( const QString &name, ParameterGroup *parameterRoot );
120 
128  virtual ~AdvancedRenderNode ();
129 
130 
131 public slots: //
132 
136  virtual void processOutputImage ();
137 
138 public:
139 
143  void redrawTriggered ();
144 
145 private: // methods
146 
152  bool setupWrinkleMaterial ();
153 
157  void setupTextures ();
158 
162  void rebindViewports ();
163 
164 protected: // data
165 
169  Ogre::Light *m_sceneLight;
170 
174  Ogre::Camera *m_cameraCopy;
175 
180 
185 
190 
194  Ogre::TexturePtr m_blendWeightTexture;
195 
200 
204  Ogre::MultiRenderTarget *m_multiRenderTarget;
205 
206 #ifdef WRINKLE_DEBUG
207 
208 
209 
210  QString m_outputWrinkleImageName;
211 #endif
212 };
213 
214 } // namespace AdvancedRenderNode
215 
216 #endif