Frapper
1.0a
Main Page
Namespaces
Classes
Files
File List
File Members
plugins
nodes
Rendering
HairRender
HairRenderNode.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-2011 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
33
34
#ifndef HAIRRENDERNODE_H
35
#define HAIRRENDERNODE_H
36
37
#include "
GeometryRenderNode.h
"
38
#include "
OgreTools.h
"
39
40
// OGRE
41
#include <Ogre.h>
42
#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
43
#include <windows.h>
44
#endif
45
46
#define LIGHT_DEBUG
47
48
namespace
HairRenderNode {
49
using namespace
Frapper;
50
51
class
ShadowTargetListener
:
public
Ogre::RenderTargetListener
52
{
53
public
:
54
ShadowTargetListener
();
55
~ShadowTargetListener
() {};
56
57
void
preRenderTargetUpdate (
const
Ogre::RenderTargetEvent &evt);
58
void
setDepthBias(
const
Ogre::Real bias);
59
void
setDepthOffset(
const
Ogre::Real offset);
60
61
private
:
62
Ogre::Pass *
m_shadowCasterPass
;
63
Ogre::Real
m_depthBias
;
64
Ogre::Real
m_depthOffset
;
65
};
66
70
class
HairRenderNode
:
public
GeometryRenderNode
71
{
72
73
Q_OBJECT
74
75
public
:
// constructors and destructors
76
83
HairRenderNode
(
const
QString &name,
ParameterGroup
*parameterRoot );
84
92
virtual
~
HairRenderNode
();
93
94
private
slots:
95
104
void
loadLightDescriptionFile ();
105
109
void
setLightScale ();
110
114
void
setShaderParameter ();
115
119
void
setNbrLights();
120
121
void
setPassDepthBias();
122
123
void
setPassDepthOffset();
124
125
public
slots:
//
126
130
void
processOutputImage ();
131
132
public
:
133
void
redrawTriggered();
134
135
136
private
:
// functions
137
142
float
greatestComponent(
const
Ogre::Vector3 &vec)
const
;
143
147
void
setCustomVertexShader();
148
152
static
bool
greaterThan(
const
QPair<Ogre::Vector3, Ogre::Vector3> &d1,
const
QPair<Ogre::Vector3, Ogre::Vector3> &d2);
153
154
protected
:
// data
155
159
Ogre::Light *
m_sceneLight
;
160
164
Ogre::Camera *
m_cameraCopy
;
165
169
Ogre::Image
m_defaultTextureImage
;
170
174
QList<QPair<Ogre::Vector3, Ogre::Vector3>>
m_lightPositions
;
175
179
ShadowTargetListener
*
m_shadowListener
;
180
184
float
m_lightScale
;
185
186
187
#ifdef LIGHT_DEBUG
188
189
190
191
QString
m_outputSecondImageName
;
192
#endif
193
194
};
195
196
}
// namespace HairRenderNode
197
198
#endif
Generated on Tue Sep 18 2012 11:43:02 for Frapper by
1.8.2