47 #include <ACG/GL/gl.hh> 48 #include <ACG/Math/GLMatrixT.hh> 49 #include <ACG/GL/ShaderGenerator.hh> 50 #include <ACG/GL/RenderObject.hh> 53 #include <ACG/Scenegraph/MaterialNode.hh> 65 class VertexDeclaration;
102 virtual void addRenderObject(
RenderObject* _renderObject);
107 : ltype(ACG::SG_LIGHT_DIRECTIONAL),
108 diffuse(1.0f, 1.0f, 1.0f), ambient(1.0f, 1.0f, 1.0f), specular(1.0f, 1.0f, 1.0f),
109 pos(0.0f, 0.0f, 0.0f), dir(1.0f, 0.0f, 0.0f), atten(1.0f, 0.0f, 0.0f),
110 spotCutoffExponent(0.0f, 0.0f)
113 ACG::ShaderGenLightType ltype;
124 std::vector<ACG::RenderObject>::iterator end) :
125 begin_(begin), end_(end) {}
127 std::vector<ACG::RenderObject>::iterator begin()
const {
131 std::vector<ACG::RenderObject>::iterator end()
const {
136 std::vector<ACG::RenderObject>::iterator begin_, end_;
147 virtual void addLight(
const LightData& _light);
220 virtual void sortRenderObjects();
238 virtual void renderObject(
ACG::RenderObject* _obj,
GLSL::Program* _prog = 0,
bool _constRenderStates =
false,
const std::vector<unsigned int>* _shaderModifiers = 0);
295 virtual void finishRenderingPipeline(
bool _drawOverlay =
true);
299 virtual void saveInputFbo();
303 virtual void restoreInputFbo();
310 virtual void saveActiveFbo(GLint* _outFboId, GLint* _outViewport, GLint* _outDrawBuffer)
const;
317 virtual void restoreFbo(GLint _fboId,
const GLint* _outViewport, GLint _drawBuffer)
const;
324 virtual void clearInputFbo(
const ACG::Vec4f& _clearColor);
344 virtual void copyDepthToBackBuffer(GLuint _depthTex,
float _scale = 1.0f);
359 virtual void renderDepthMap(
int _viewerID,
int _width,
int _height);
371 void modifyFragmentEndCode(QStringList* _code);
388 void dumpRenderObjectsToFile(
const char* _fileName,
ACG::RenderObject** _sortedList = 0)
const;
397 virtual QString dumpCurrentRenderObjectsToString(
ACG::RenderObject** _list = 0,
bool _outputShaders =
false, std::vector<ACG::ShaderModifier*>* _modifiers = 0);
410 void setErrorDetectionLevel(
int _level);
413 int getErrorDetectionLevel()
const;
421 int getNumRenderObjects()
const;
424 int getNumLights()
const;
459 void setLineThicknessRenderingGL42(
bool _enable);
475 void setViewerID(
int _viewerID);
494 return current_subtree_objects_;
560 GLint prevViewport_[4];
602 void renderLineThicknessGL42();
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()
const RenderObjectRange & getCollectedSubtreeObjects() const
Namespace providing different geometric functions concerning angles.
bool enableLineThicknessGL42_
Enable/disable gl4.2 based technique for rendering thick lines.
Vec3f camDirWS_
direction the camera is looking to in world-space
std::map< int, ACG::FBO * > depthMaps_
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.
GLint prevVAO_
previously bound VAO
int errorDetectionLevel_
error-detection level for checking render objects
bool coreProfile_
core profile mode
GLMatrixf viewMatrix_
view transform
Interface class between scenegraph and renderer.
Interface for modifying render objects.
std::map< int, Texture *> lineColorBuffers_
map from viewport id to line buffer
std::vector< ACG::RenderObject * > sortedObjects_
sorted list of renderobjects without overlay objects (sorted in rendering order)
std::vector< ACG::SceneGraph::BaseNode * > renderObjectSource_
source node that added the render object (map renderObjectID -> scenegraph node)
GLint prevFbo_
previous fbo
GLSL::Program * depthCopyShader_
shader copies depth of the first front layer to the back buffer
std::vector< int > sortListOverlays_
map sortedID -> original renderObjectID
void setCoreProfileMode(bool _enable)
Tell renderer to use core or compatibility profile.
int curViewerID_
currently active viewer ID as specified in prepareRenderObjects()
std::vector< int > sortListObjects_
map sortedID -> original renderObjectID
Vec3f camPosWS_
cam position in world-space
GLint prevDrawBuffer_
previous drawbuffer target (ie GL_BACK, GL_COLOR_ATTACHMENTi...)
std::vector< ACG::RenderObject * > overlayObjects_
sorted list of overlay-only renderobjects (sorted in rendering order)
std::vector< ACG::SceneGraph::BaseNode * > overlayObjectSource_
source node that added the overlay render object (map renderObjectID -> scenegraph node) ...
ACG::Vec3f globalLightModelAmbient_
int numLights_
Number of Lights.
bool depthMapUsed_
true if at least one renderobject requires a scene depthmap, false otherwise
std::vector< RenderObject * > lineGL42Objects_
default line render objects that are rendered with gl4.2
DrawModeProperties stores a set of properties that defines, how to render an object.
bool prevFboSaved_
flag indicating a that saveCurrentFbo() has been called prior restoreFbo()
std::vector< ACG::RenderObjectModifier * > renderObjectModifiers_
active render object modifiers