53 #include <ACG/GL/gl.hh> 54 #include <ACG/Math/GLMatrixT.hh> 55 #include <ACG/GL/ShaderGenerator.hh> 56 #include <ACG/GL/RenderObject.hh> 59 #include <ACG/Scenegraph/MaterialNode.hh> 71 class VertexDeclaration;
108 virtual void addRenderObject(
RenderObject* _renderObject);
113 : ltype(ACG::SG_LIGHT_DIRECTIONAL),
114 diffuse(1.0f, 1.0f, 1.0f), ambient(1.0f, 1.0f, 1.0f), specular(1.0f, 1.0f, 1.0f),
115 pos(0.0f, 0.0f, 0.0f), dir(1.0f, 0.0f, 0.0f), atten(1.0f, 0.0f, 0.0f),
116 spotCutoffExponent(0.0f, 0.0f)
119 ACG::ShaderGenLightType ltype;
130 std::vector<ACG::RenderObject>::iterator end) :
131 begin_(begin), end_(end) {}
133 std::vector<ACG::RenderObject>::iterator begin()
const {
137 std::vector<ACG::RenderObject>::iterator end()
const {
142 std::vector<ACG::RenderObject>::iterator begin_, end_;
153 virtual void addLight(
const LightData& _light);
226 virtual void sortRenderObjects();
244 virtual void renderObject(
ACG::RenderObject* _obj,
GLSL::Program* _prog = 0,
bool _constRenderStates =
false,
const std::vector<unsigned int>* _shaderModifiers = 0);
301 virtual void finishRenderingPipeline(
bool _drawOverlay =
true);
305 virtual void saveInputFbo();
309 virtual void restoreInputFbo();
316 virtual void saveActiveFbo(GLint* _outFboId, GLint* _outViewport, GLint* _outDrawBuffer)
const;
323 virtual void restoreFbo(GLint _fboId,
const GLint* _outViewport, GLint _drawBuffer)
const;
330 virtual void clearInputFbo(
const ACG::Vec4f& _clearColor);
350 virtual void copyDepthToBackBuffer(GLuint _depthTex,
float _scale = 1.0f);
365 virtual void renderDepthMap(
int _viewerID,
int _width,
int _height);
377 void modifyFragmentEndCode(QStringList* _code);
394 void dumpRenderObjectsToFile(
const char* _fileName,
ACG::RenderObject** _sortedList = 0)
const;
403 virtual QString dumpCurrentRenderObjectsToString(
ACG::RenderObject** _list = 0,
bool _outputShaders =
false, std::vector<ACG::ShaderModifier*>* _modifiers = 0);
416 void setErrorDetectionLevel(
int _level);
419 int getErrorDetectionLevel()
const;
427 int getNumRenderObjects()
const;
430 int getNumLights()
const;
457 void setLineThicknessRenderingGL42(
bool _enable);
473 void setViewerID(
int _viewerID);
484 return current_subtree_objects_;
540 GLint prevViewport_[4];
574 void renderLineThicknessGL42();
GLMatrixf viewMatrix_
view transform
int curViewerID_
currently active viewer ID as specified in prepareRenderObjects()
DrawModeProperties stores a set of properties that defines, how to render an object.
GLSL::Program * depthCopyShader_
shader copies depth of the first front layer to the back buffer
std::vector< ACG::RenderObject * > sortedObjects_
sorted list of renderobjects without overlay objects (sorted in rendering order)
int numLights_
Number of Lights.
Interface for modifying render objects.
Vec3f camDirWS_
direction the camera is looking to in world-space
std::vector< ACG::RenderObjectModifier * > renderObjectModifiers_
active render object modifiers
static int maxClipDistances_
max number of clip distance outputs in a vertex shader
const ACG::Vec3f & getGlobalAmbientScale() const
Get global ambient light contribution from GL_LIGHT_MODEL_AMBIENT.
ACG::Vec3f globalLightModelAmbient_
int errorDetectionLevel_
error-detection level for checking render objects
bool enableLineThicknessGL42_
Enable/disable gl4.2 based technique for rendering thick lines.
std::vector< ACG::RenderObject * > overlayObjects_
sorted list of overlay-only renderobjects (sorted in rendering order)
Namespace providing different geometric functions concerning angles.
std::vector< RenderObject * > lineGL42Objects_
default line render objects that are rendered with gl4.2
Vec3f camPosWS_
cam position in world-space
bool prevFboSaved_
flag indicating a that saveCurrentFbo() has been called prior restoreFbo()
GLint prevFbo_
previous fbo
const RenderObjectRange & getCollectedSubtreeObjects() const
This namespace contains all the classes and functions for handling GLSL shader and program objects...
std::vector< ACG::RenderObject > renderObjects_
array of renderobjects, filled by addRenderObject()
bool depthMapUsed_
true if at least one renderobject requires a scene depthmap, false otherwise
GLint prevDrawBuffer_
previous drawbuffer target (ie GL_BACK, GL_COLOR_ATTACHMENTi...)
Interface class between scenegraph and renderer.
std::map< int, Texture * > lineColorBuffers_
map from viewport id to line buffer
std::map< int, ACG::FBO * > depthMaps_