Developer Documentation
RenderObject.cc
1 /*===========================================================================*\
2  * *
3  * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39  * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43  * *
44  * $Revision: 15868 $ *
45  * $Author: tenter $ *
46  * $Date: 2012-11-26 12:37:58 +0100 (Mo, 26 Nov 2012) $ *
47  * *
48 \*===========================================================================*/
49 
50 #include <cstdio>
51 #include <iostream>
52 #include <cstdlib>
53 #include <QFile>
54 #include <QTextStream>
55 
56 #include <ACG/GL/gl.hh>
57 
58 #include <ACG/GL/IRenderer.hh>
59 
60 #include <ACG/GL/VertexDeclaration.hh>
61 
62 #include <ACG/GL/ShaderCache.hh>
63 
64 
65 
66 namespace ACG
67 {
68 
70 {
71  culling = true;
72  blending = false;
73  depthTest = true;
74  depthWrite = true;
75  alphaTest = false;
76 
77  colorWriteMask[0] = colorWriteMask[1] = colorWriteMask[2] = colorWriteMask[3] = 1;
78 
79  fillMode = GL_FILL;
80 
81  depthRange = Vec2f(0.0f, 1.0f);
82  depthFunc = GL_LESS;
83 
84  blendSrc = GL_ONE;
85  blendDest = GL_ZERO;
86 
87  alpha = 1.0f;
88 
89 
90  if (_glState)
91  {
92  modelview = _glState->modelview();
93  proj = _glState->projection();
94 
95  culling =_glState->isStateEnabled(GL_CULL_FACE);
96  blending = _glState->isStateEnabled(GL_BLEND);
97  depthTest = _glState->isStateEnabled(GL_DEPTH_TEST);
98 
99  _glState->getBlendFunc(&blendSrc, &blendDest);
100 
101  glGetFloatv(GL_DEPTH_RANGE, depthRange.data());
102 
103  depthFunc = _glState->depthFunc();
104 
105 
106  alphaTest = _glState->isStateEnabled(GL_ALPHA_TEST);
107 
108  for (int i = 0; i < 3; ++i)
109  {
110  diffuse[i] = _glState->diffuse_color()[i];
111  ambient[i] = _glState->ambient_color()[i];
112  specular[i] = _glState->specular_color()[i];
113  emissive[i] = _glState->base_color()[i];
114  }
115  shininess = _glState->shininess();
116  }
117 
118 
119  // get texcoord generation params
120  if (glIsEnabled(GL_TEXTURE_GEN_Q))
121  shaderDesc.texGenDim = 4;
122  else if (glIsEnabled(GL_TEXTURE_GEN_R))
123  shaderDesc.texGenDim = 3;
124  else if (glIsEnabled(GL_TEXTURE_GEN_T))
125  shaderDesc.texGenDim = 2;
126  else if (glIsEnabled(GL_TEXTURE_GEN_S))
127  shaderDesc.texGenDim = 1;
128 
129  if (shaderDesc.texGenDim)
130  {
131  GLint genMode = 0;
132  glGetTexGeniv(GL_S, GL_TEXTURE_GEN_MODE, &genMode);
133  shaderDesc.texGenMode = genMode;
134  }
135 }
136 
138 {
139  if (_props)
140  {
141  shaderDesc.vertexColors = _props->colored();
142  if (_props->textured())
143  shaderDesc.addTextureType(GL_TEXTURE_2D,false,0);
144  else
146  shaderDesc.numLights = _props->lighting() ? 0 : -1;
147 
148  switch (_props->lightStage()) {
150  shaderDesc.shadeMode = SG_SHADE_GOURAUD;
151  break;
153  shaderDesc.shadeMode = SG_SHADE_PHONG;
154  break;
156  shaderDesc.shadeMode = SG_SHADE_UNLIT;
157  break;
158  default:
159  break;
160  }
161 
162  if (_props->flatShaded())
163  shaderDesc.shadeMode = SG_SHADE_FLAT;
164 
165  if (_props->primitive() == SceneGraph::DrawModes::PRIMITIVE_WIREFRAME ||
166  _props->primitive() == SceneGraph::DrawModes::PRIMITIVE_HIDDENLINE ||
167  _props->primitive() == SceneGraph::DrawModes::PRIMITIVE_EDGE ||
168  _props->primitive() == SceneGraph::DrawModes::PRIMITIVE_HALFEDGE)
169  shaderDesc.shadeMode = SG_SHADE_UNLIT;
170  }
171 }
172 
173 void RenderObject::setMaterial( const SceneGraph::Material* _mat )
174 {
175  for (int i = 0; i < 3; ++i)
176  {
177  diffuse[i] = _mat->diffuseColor()[i];
178  ambient[i] = _mat->ambientColor()[i];
179  specular[i] = _mat->specularColor()[i];
180  emissive[i] = _mat->baseColor()[i];
181  }
182  shininess = _mat->shininess();
183  alpha = _mat->diffuseColor()[3];
184 
185  // material node sets the alpha test function to GL_GREATER
186  alphaFunc = GL_GREATER;
187  alphaRef = _mat->alphaValue();
188 }
189 
190 
192 : priority(0),
193  overlay(false),
194  modelview(GLMatrixf(ACG::Vec3f(1.0,0.0,0.0),ACG::Vec3f(0.0,1.0,0.0),ACG::Vec3f(0.0,0.0,1.0))),
195  proj(modelview),
198  primitiveMode(GL_TRIANGLES), patchVertices(0), numIndices(0), indexOffset(0), indexType(GL_UNSIGNED_INT),
199  numInstances(0),
200  vertexDecl(0),
201  culling(true), blending(false), alphaTest(false),
202  depthTest(true), depthWrite(true),
203  fillMode(GL_FILL), depthFunc(GL_LESS),
204  alphaFunc(GL_ALWAYS), alphaRef(0.0f),
205  blendSrc(GL_SRC_ALPHA), blendDest(GL_ONE_MINUS_SRC_ALPHA),
206  depthRange(0.0f, 1.0f),
207 
208  clipDistanceMask(0),
209 
210  patchDefaultInnerLevel(1.0f, 1.0f),
211  patchDefaultOuterLevel(1.0f, 1.0f, 1.0f, 1.0f),
212 
213  diffuse(0.6f, 0.6f, 0.6f), ambient(0.1f, 0.1f, 0.1f),
214  specular(0.0f, 0.0f, 0.0f), emissive(0.05f, 0.05f, 0.05f),
215  alpha(1.0f), shininess(100.0f),
216 
217  inZPrePass(true),
219 
220  debugID(0), debugName(0),
221  internalFlags_(0)
222 {
223  colorWriteMask[0] = colorWriteMask[1] = colorWriteMask[2] = colorWriteMask[3] = 1;
224 }
225 
226 RenderObject::~RenderObject() {
227  uniformPool_.clear();
228 }
229 
230 QString RenderObject::toString() const
231 {
232  // several mappings: (int)GLEnum -> string
233 
234  const char* primitiveString[] =
235  {
236  "GL_POINTS",
237  "GL_LINES",
238  "GL_LINE_LOOP",
239  "GL_LINE_STRIP",
240  "GL_TRIANGLES",
241  "GL_TRIANGLE_STRIP",
242  "GL_TRIANGLE_FAN",
243  "GL_QUADS",
244  "GL_QUAD_STRIP",
245  "GL_POLYGON",
246  "GL_LINES_ADJACENCY",
247  "GL_LINE_STRIP_ADJACENCY",
248  "GL_TRIANGLES_ADJACENCY",
249  "GL_TRIANGLE_STRIP_ADJACENCY",
250  "GL_PATCHES"
251  };
252 
253  const char* fillModeString[] =
254  {
255  "GL_POINT",
256  "GL_LINE",
257  "GL_FILL"
258  };
259 
260  const char* depthFunString[] =
261  {
262  "GL_NEVER",
263  "GL_LESS",
264  "GL_EQUAL",
265  "GL_LEQUAL",
266  "GL_GREATER",
267  "GL_NOTEQUAL",
268  "GL_GEQUAL",
269  "GL_ALWAYS"
270  };
271 
272  QString result;
273  QTextStream resultStrm(&result);
274 
275 
276 #if !defined(GL_VERSION_3_2)
277  const GLenum maxSupportedPrimitiveMode = GL_POLYGON;
278 #elif !defined(GL_ARB_tessellation_shader)
279  const GLenum maxSupportedPrimitiveMode = GL_TRIANGLE_STRIP_ADJACENCY;
280 #else
281  const GLenum maxSupportedPrimitiveMode = GL_PATCHES;
282 #endif
283 
284  resultStrm << "name: " << debugName
285  << "\ndebugID: " << debugID
286  << "\npriority: " << priority
287  << "\nprimitiveMode: " << (primitiveMode <= maxSupportedPrimitiveMode ? primitiveString[primitiveMode] : "undefined")
288  << "\nfillMode: " << fillModeString[fillMode - GL_POINT]
289  << "\nnumIndices: " << numIndices
290  << "\nindexOffset: " << indexOffset;
291 
292 
293 #ifdef GL_ARB_tessellation_shader
294  if (primitiveMode == GL_PATCHES)
295  resultStrm << "\npatchVertices: " << patchVertices;
296 #endif
297 
298  resultStrm << "\nvao-id: " << vertexArrayObject
299  << "\nvbo-id: " << vertexBuffer
300  << "\nibo-id: " << indexBuffer
301  << "\nsysmemIndexBuffer: " << sysmemIndexBuffer;
302 
303 
304 
305  resultStrm << "\n" << shaderDesc.toString();
306 
307 
308  resultStrm << "\nmodelview: "
309  << "{" << modelview(0, 0) << ", " << modelview(0, 1) << ", " << modelview(0, 2) << ", " << modelview(0, 3) << "} "
310  << "{" << modelview(1, 0) << ", " << modelview(1, 1) << ", " << modelview(1, 2) << ", " << modelview(1, 3) << "} "
311  << "{" << modelview(2, 0) << ", " << modelview(2, 1) << ", " << modelview(2, 2) << ", " << modelview(2, 3) << "} "
312  << "{" << modelview(3, 0) << ", " << modelview(3, 1) << ", " << modelview(3, 2) << ", " << modelview(3, 3) << "} ";
313 
314  resultStrm << "\nproj: "
315  << "{" << proj(0, 0) << ", " << proj(0, 1) << ", " << proj(0, 2) << ", " << proj(0, 3) << "} "
316  << "{" << proj(1, 0) << ", " << proj(1, 1) << ", " << proj(1, 2) << ", " << proj(1, 3) << "} "
317  << "{" << proj(2, 0) << ", " << proj(2, 1) << ", " << proj(2, 2) << ", " << proj(2, 3) << "} "
318  << "{" << proj(3, 0) << ", " << proj(3, 1) << ", " << proj(3, 2) << ", " << proj(3, 3) << "} ";
319 
320 
321  resultStrm << "\nculling: " << culling
322  << "\nblending: " << blending
323  << "\nalphaTest: " << alphaTest;
324 
325 
326  resultStrm << "\ndepthTest: " << depthTest
327  << "\ndepthWrite: " << depthWrite
328  << "\ndepthFunc: " << depthFunString[depthFunc - GL_NEVER]
329  << "\ndepthRange: [" << depthRange[0] << ", " << depthRange[1] << "]"
330  << "\ncolorWriteMask: " << colorWriteMask[0] << ", " << colorWriteMask[1] << ", "<< colorWriteMask[2] << ", "<< colorWriteMask[2];
331 
332  resultStrm << "\nalphaFunc: " << depthFunString[alphaFunc - GL_NEVER]
333  << "\nalphaRef: " << alphaRef;
334 
335  resultStrm << "\ndiffuse: [" << diffuse[0] << ", " << diffuse[1] << ", " << diffuse[2] << "]";
336  resultStrm << "\nambient: [" << ambient[0] << ", " << ambient[1] << ", " << ambient[2] << "]";
337  resultStrm << "\nspecular: [" << specular[0] << ", " << specular[1] << ", " << specular[2] << "]";
338  resultStrm << "\nemissive: [" << emissive[0] << ", " << emissive[1] << ", " << emissive[2] << "]";
339 
340  resultStrm << "\nshininess: " << shininess;
341  resultStrm << "\nalpha: " << alpha;
342 
343 
344  resultStrm << "\ninZPrePass: " << inZPrePass;
345  resultStrm << "\ndepthMapUniformName: " << depthMapUniformName;
346 
347 
348  resultStrm << "\ninternalFlags: " << internalFlags_;
349 
350  // textures
351  for (std::map<size_t, Texture>::const_iterator it = textures_.begin(); it != textures_.end(); ++it)
352  {
353  resultStrm << "\ntexture unit " << it->first << ": ";
354 
355  switch (it->second.type)
356  {
357  case GL_TEXTURE_1D: resultStrm << "GL_TEXTURE_1D"; break;
358  case GL_TEXTURE_2D: resultStrm << "GL_TEXTURE_2D"; break;
359  case GL_TEXTURE_3D: resultStrm << "GL_TEXTURE_3D"; break;
360 #ifdef GL_TEXTURE_RECTANGLE
361  case GL_TEXTURE_RECTANGLE: resultStrm << "GL_TEXTURE_RECTANGLE"; break;
362 #endif
363 #ifdef GL_TEXTURE_CUBE_MAP
364  case GL_TEXTURE_CUBE_MAP: resultStrm << "GL_TEXTURE_CUBE_MAP"; break;
365 #endif
366 #ifdef GL_TEXTURE_1D_ARRAY
367  case GL_TEXTURE_1D_ARRAY: resultStrm << "GL_TEXTURE_1D_ARRAY"; break;
368 #endif
369 #ifdef GL_TEXTURE_2D_ARRAY
370  case GL_TEXTURE_2D_ARRAY: resultStrm << "GL_TEXTURE_2D_ARRAY"; break;
371 #endif
372 #ifdef GL_TEXTURE_CUBE_MAP_ARRAY
373  case GL_TEXTURE_CUBE_MAP_ARRAY: resultStrm << "GL_TEXTURE_CUBE_MAP_ARRAY"; break;
374 #endif
375 #ifdef GL_TEXTURE_BUFFER
376  case GL_TEXTURE_BUFFER: resultStrm << "GL_TEXTURE_BUFFER"; break;
377 #endif
378 #ifdef GL_TEXTURE_2D_MULTISAMPLE
379  case GL_TEXTURE_2D_MULTISAMPLE: resultStrm << "GL_TEXTURE_2D_MULTISAMPLE"; break;
380 #endif
381 #ifdef GL_TEXTURE_2D_MULTISAMPLE_ARRAY
382  case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: resultStrm << "GL_TEXTURE_2D_MULTISAMPLE_ARRAY"; break;
383 #endif
384  default: resultStrm << "unknown_type"; break;
385  }
386 
387  resultStrm << " - id " << it->second.id;
388  }
389 
390  if (vertexDecl)
391  resultStrm << "\n" << vertexDecl->toString();
392 
393 
394  return result;
395 }
396 
397 
398 void RenderObject::setUniform( const char *_name, GLint _value )
399 {
400  uniformPool_.setUniform(_name, _value);
401 }
402 
403 void RenderObject::setUniform( const char *_name, GLfloat _value )
404 {
405  uniformPool_.setUniform(_name, _value);
406 }
407 
408 void RenderObject::setUniform( const char *_name, const ACG::Vec2f &_value )
409 {
410  uniformPool_.setUniform(_name, _value);
411 }
412 
413 void RenderObject::setUniform( const char *_name, const ACG::Vec3f &_value )
414 {
415  uniformPool_.setUniform(_name, _value);
416 }
417 
418 void RenderObject::setUniform( const char *_name, const ACG::Vec4f &_value )
419 {
420  uniformPool_.setUniform(_name, _value);
421 }
422 
423 void RenderObject::setUniform( const char *_name, const ACG::GLMatrixf &_value, bool _transposed /*= false*/ )
424 {
425  uniformPool_.setUniform(_name, _value, _transposed);
426 }
427 
428 void RenderObject::setUniformMat3( const char *_name, const ACG::GLMatrixf &_value, bool _transposed /*= false*/ )
429 {
430  uniformPool_.setUniform(_name, _value, _transposed);
431 }
432 
433 void RenderObject::setUniform( const char *_name, GLint *_values, int _count )
434 {
435  uniformPool_.setUniform(_name, _values, _count);
436 }
437 
438 void RenderObject::setUniform( const char *_name, GLfloat *_values, int _count )
439 {
440  uniformPool_.setUniform(_name, _values, _count);
441 }
442 
444 {
445  uniformPool_.addPool(_pool);
446 }
447 
448 
449 void RenderObject::setupLineRendering( float _lineWidth, const Vec2f& _screenSize )
450 {
451  shaderDesc.geometryTemplateFile = "Wireframe/geom_line2quad.tpl";
452 
453  setUniform("lineWidth", _lineWidth);
454  setUniform("screenSize", _screenSize);
455 }
456 
458 {
459  return shaderDesc.geometryTemplateFile == "Wireframe/geom_line2quad.tpl" ||
460  (shaderDesc.geometryTemplateFile == "Wireframe/gl42/geometry.tpl" &&
461  shaderDesc.fragmentTemplateFile == "Wireframe/gl42/fragment.tpl");
462 }
463 
465 {
466  shaderDesc.geometryTemplateFile.clear();
467 }
468 
469 void RenderObject::setupPointRendering( float _pointSize, const Vec2f& _screenSize )
470 {
471  shaderDesc.geometryTemplateFile = "PointSize/geometry.tpl";
472  shaderDesc.fragmentTemplateFile = "PointSize/fragment.tpl";
473 
474  setUniform("pointSize", _pointSize);
475  setUniform("screenSize", _screenSize);
476 }
477 
479 {
480  return shaderDesc.geometryTemplateFile == "PointSize/geometry.tpl" &&
481  shaderDesc.fragmentTemplateFile == "PointSize/fragment.tpl";
482 }
483 
485 {
486  shaderDesc.geometryTemplateFile.clear();
487  shaderDesc.fragmentTemplateFile.clear();
488 }
489 
490 
491 
492 } // namespace ACG end
493 
VectorT< float, 2 > Vec2f
Definition: VectorT.hh:108
Vec3f diffuse
material definitions
void specularColor(const Vec4f &_s)
set the specular color
void clearTextures()
disables texture support and removes all texture types
int debugID
used internally for renderer debugging
QString toString() const
convert ShaderGenDesc to string format for debugging
DrawModeProperties stores a set of properties that defines, how to render an object.
Definition: DrawModes.hh:183
void addPool(const UniformPool &_src)
Add all uniforms of a pool to this pool.
Definition: UniformPool.cc:136
GLSL uniform pool.
Definition: UniformPool.hh:71
bool overlay
Layer based rendering.
void setupShaderGenFromDrawmode(const SceneGraph::DrawModes::DrawModeProperties *_props)
Fills out ShaderGenDesc parameters based on Drawmode properties.
GLenum primitiveMode
Primitive type.
void addTextureType(GLenum _type, bool _shadow, size_t _stage)
adds a texture type to the shader and enables texturing.
void setUniform(const char *_name, GLint _value)
Set int uniform to specified value.
Definition: UniformPool.cc:512
bool isDefaultLineObject() const
Test if the object is rendered with one of the default line thickness methods.
bool flatShaded() const
Is flat shading used (Normals per face)?
Definition: DrawModes.hh:231
int priority
Priority to allow sorting of objects.
bool textured() const
Is texturing enabled?
Definition: DrawModes.hh:225
std::map< size_t, Texture > textures_
holds the textures (second) and the stage id (first)
unsigned int internalFlags_
may be used internally by the renderer
const Vec4f & ambient_color() const
get ambient color
Definition: GLState.hh:934
GLuint indexBuffer
Use vertex array object.
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
bool colored() const
Are colors used?
Definition: DrawModes.hh:228
const void * sysmemIndexBuffer
Use system memory index buffer.
void baseColor(const Vec4f &_c)
set the base color
GLuint vertexArrayObject
Use vertex array object.
static bool isStateEnabled(GLenum _cap)
returns true, if a cpa state is enabled
Definition: GLState.cc:1533
GLenum indexType
Index element type.
const Vec4f & specular_color() const
get specular color
Definition: GLState.hh:944
float alphaValue() const
get current alpha value for alpha_test
unsigned int patchVertices
patch size if primitiveMode is GL_PATCHES for rendering with tessellation shaders ...
bool lighting() const
Is lighting enabled?
Definition: DrawModes.hh:222
unsigned int numIndices
Number indices to render.
GLMatrixd modelview
Modelview transform.
void ambientColor(const Vec4f &_a)
set the ambient color.
GLenum blendDest
glBlendFunc: GL_SRC_ALPHA, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA ...
const GLenum & depthFunc() const
get glDepthFunc() that is supposed to be active
Definition: GLState.cc:937
const Vec4f & base_color() const
get base color (used when lighting is off)
Definition: GLState.hh:929
unsigned int indexOffset
Offset to first index in the index buffer or vertex buffer respectively.
void resetPointRendering()
Reset shader template names blocked by point rendering.
void diffuseColor(const Vec4f &_d)
set the diffuse color.
void setupPointRendering(float _pointSize, const Vec2f &_screenSize)
Setup rendering of circle points.
void setUniform(const char *_name, GLint _value)
set values for int uniforms
void clear()
Clear the pool.
Definition: UniformPool.cc:86
float shininess() const
get specular shininess (must be in [0, 128])
Definition: GLState.hh:963
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
void setupLineRendering(float _lineWidth, const Vec2f &_screenSize)
Setup rendering of thick lines.
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
const GLMatrixd & projection() const
get projection matrix
Definition: GLState.hh:789
const char * depthMapUniformName
Uniform name of the depth map in the used shader.
void shininess(float _s)
set shininess
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
Definition: RenderObject.cc:69
GLenum alphaFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
const Vec4f & diffuse_color() const
get diffuse color
Definition: GLState.hh:939
const GLMatrixd & modelview() const
get modelview matrix
Definition: GLState.hh:794
void addUniformPool(const GLSL::UniformPool &_pool)
add all uniforms from a pool
bool inZPrePass
Specify whether this object should be rendered in a z-prepass.
static void getBlendFunc(GLenum *_sfactor, GLenum *_dfactor)
get blend function, null-ptr safe
Definition: GLState.hh:317
GLMatrixd proj
Projection transform.
QString toString() const
void resetLineRendering()
Reset shader template names blocked by line rendering.
bool isDefaultPointObject() const
Test if the object is rendered with one of the default point extension methods.
GLuint vertexBuffer
VBO, IBO ids, ignored if VAO is provided.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
Scalar * data()
access to Scalar array
Definition: Vector11T.hh:193
Vec2f depthRange
glDepthRange: (znear, zmax)