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;
77 namespace SceneGraph {
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;
134 virtual void addLight(
const LightData& _light);
185 static int cmpPriority(
const void*,
const void*);
192 virtual void sortRenderObjects();
210 virtual void renderObject(
ACG::RenderObject* _obj,
GLSL::Program* _prog = 0,
bool _constRenderStates =
false,
const std::vector<unsigned int>* _shaderModifiers = 0);
267 virtual void finishRenderingPipeline(
bool _drawOverlay =
true);
271 virtual void saveInputFbo();
275 virtual void restoreInputFbo();
282 virtual void saveActiveFbo(GLint* _outFboId, GLint* _outViewport, GLint* _outDrawBuffer)
const;
289 virtual void restoreFbo(GLint _fboId,
const GLint* _outViewport, GLint _drawBuffer)
const;
296 virtual void clearInputFbo(
const ACG::Vec4f& _clearColor);
316 virtual void copyDepthToBackBuffer(GLuint _depthTex,
float _scale = 1.0f);
331 virtual void renderDepthMap(
int _viewerID,
int _width,
int _height);
343 void modifyFragmentEndCode(QStringList* _code);
360 void dumpRenderObjectsToFile(
const char* _fileName,
ACG::RenderObject** _sortedList = 0)
const;
369 virtual QString dumpCurrentRenderObjectsToString(
ACG::RenderObject** _list = 0,
bool _outputShaders =
false, std::vector<ACG::ShaderModifier*>* _modifiers = 0);
382 void setErrorDetectionLevel(
int _level);
385 int getErrorDetectionLevel()
const;
393 int getNumRenderObjects()
const;
396 int getNumOverlayObjects()
const;
399 int getNumLineGL42Objects()
const;
402 int getNumLights()
const;
429 void setLineThicknessRenderingGL42(
bool _enable);
445 void setViewerID(
int _viewerID);
497 GLint prevViewport_[4];
527 void renderLineThicknessGL42();
Namespace providing different geometric functions concerning angles.
bool depthMapUsed_
true if at least one renderobject requires a scene depthmap, false otherwise
Vec3f camDirWS_
direction the camera is looking to in world-space
ACG::Vec3f globalLightModelAmbient_
bool prevFboSaved_
flag indicating a that saveCurrentFbo() has been called prior restoreFbo()
Interface class between scenegraph and renderer.
std::vector< ACG::RenderObject * > sortedObjects_
sorted list of renderobjects without overlay objects (sorted in rendering order)
GLSL::Program * depthCopyShader_
shader copies depth of the first front layer to the back buffer
GLint prevDrawBuffer_
previous drawbuffer target (ie GL_BACK, GL_COLOR_ATTACHMENTi...)
int errorDetectionLevel_
error-detection level for checking render objects
bool enableLineThicknessGL42_
Enable/disable gl4.2 based technique for rendering thick lines.
Vec3f camPosWS_
cam position in world-space
GLMatrixf viewMatrix_
view transform
std::vector< RenderObject * > lineGL42Objects_
default line render objects that are rendered with gl4.2
int curViewerID_
currently active viewer ID as specified in prepareRenderObjects()
std::map< int, Texture * > lineColorBuffers_
map from viewport id to line buffer
DrawModeProperties stores a set of properties that defines, how to render an object.
int numLights_
Number of Lights.
This namespace contains all the classes and functions for handling GLSL shader and program objects...
std::map< int, ACG::FBO * > depthMaps_
std::vector< ACG::RenderObject > renderObjects_
array of renderobjects, filled by addRenderObject()
std::vector< ACG::RenderObject * > overlayObjects_
sorted list of overlay-only renderobjects (sorted in rendering order)
GLint prevFbo_
previous fbo
const ACG::Vec3f & getGlobalAmbientScale() const
Get global ambient light contribution from GL_LIGHT_MODEL_AMBIENT.