Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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),
196  vertexArrayObject(0),
197  vertexBuffer(0), indexBuffer(0), sysmemIndexBuffer(0),
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  patchDefaultInnerLevel(1.0f, 1.0f),
209  patchDefaultOuterLevel(1.0f, 1.0f, 1.0f, 1.0f),
210 
211  diffuse(0.6f, 0.6f, 0.6f), ambient(0.1f, 0.1f, 0.1f),
212  specular(0.0f, 0.0f, 0.0f), emissive(0.05f, 0.05f, 0.05f),
213  alpha(1.0f), shininess(100.0f),
214 
215  inZPrePass(true),
216  depthMapUniformName(0),
217 
218  debugID(0), debugName(0),
219  internalFlags_(0)
220 {
221  colorWriteMask[0] = colorWriteMask[1] = colorWriteMask[2] = colorWriteMask[3] = 1;
222 }
223 
224 RenderObject::~RenderObject() {
225  uniformPool_.clear();
226 }
227 
228 QString RenderObject::toString() const
229 {
230  // several mappings: (int)GLEnum -> string
231 
232  const char* primitiveString[] =
233  {
234  "GL_POINTS",
235  "GL_LINES",
236  "GL_LINE_LOOP",
237  "GL_LINE_STRIP",
238  "GL_TRIANGLES",
239  "GL_TRIANGLE_STRIP",
240  "GL_TRIANGLE_FAN",
241  "GL_QUADS",
242  "GL_QUAD_STRIP",
243  "GL_POLYGON",
244  "GL_LINES_ADJACENCY",
245  "GL_LINE_STRIP_ADJACENCY",
246  "GL_TRIANGLES_ADJACENCY",
247  "GL_TRIANGLE_STRIP_ADJACENCY",
248  "GL_PATCHES"
249  };
250 
251  const char* fillModeString[] =
252  {
253  "GL_POINT",
254  "GL_LINE",
255  "GL_FILL"
256  };
257 
258  const char* depthFunString[] =
259  {
260  "GL_NEVER",
261  "GL_LESS",
262  "GL_EQUAL",
263  "GL_LEQUAL",
264  "GL_GREATER",
265  "GL_NOTEQUAL",
266  "GL_GEQUAL",
267  "GL_ALWAYS"
268  };
269 
270  QString result;
271  QTextStream resultStrm(&result);
272 
273 
274 #if !defined(GL_VERSION_3_2)
275  const GLenum maxSupportedPrimitiveMode = GL_POLYGON;
276 #elif !defined(GL_ARB_tessellation_shader)
277  const GLenum maxSupportedPrimitiveMode = GL_TRIANGLE_STRIP_ADJACENCY;
278 #else
279  const GLenum maxSupportedPrimitiveMode = GL_PATCHES;
280 #endif
281 
282  resultStrm << "name: " << debugName
283  << "\ndebugID: " << debugID
284  << "\npriority: " << priority
285  << "\nprimitiveMode: " << (primitiveMode <= maxSupportedPrimitiveMode ? primitiveString[primitiveMode] : "undefined")
286  << "\nfillMode: " << fillModeString[fillMode - GL_POINT]
287  << "\nnumIndices: " << numIndices
288  << "\nindexOffset: " << indexOffset;
289 
290 
291 #ifdef GL_ARB_tessellation_shader
292  if (primitiveMode == GL_PATCHES)
293  resultStrm << "\npatchVertices: " << patchVertices;
294 #endif
295 
296  resultStrm << "\nvao-id: " << vertexArrayObject
297  << "\nvbo-id: " << vertexBuffer
298  << "\nibo-id: " << indexBuffer
299  << "\nsysmemIndexBuffer: " << sysmemIndexBuffer;
300 
301 
302 
303  resultStrm << "\n" << shaderDesc.toString();
304 
305 
306  resultStrm << "\nmodelview: "
307  << "{" << modelview(0, 0) << ", " << modelview(0, 1) << ", " << modelview(0, 2) << ", " << modelview(0, 3) << "} "
308  << "{" << modelview(1, 0) << ", " << modelview(1, 1) << ", " << modelview(1, 2) << ", " << modelview(1, 3) << "} "
309  << "{" << modelview(2, 0) << ", " << modelview(2, 1) << ", " << modelview(2, 2) << ", " << modelview(2, 3) << "} "
310  << "{" << modelview(3, 0) << ", " << modelview(3, 1) << ", " << modelview(3, 2) << ", " << modelview(3, 3) << "} ";
311 
312  resultStrm << "\nproj: "
313  << "{" << proj(0, 0) << ", " << proj(0, 1) << ", " << proj(0, 2) << ", " << proj(0, 3) << "} "
314  << "{" << proj(1, 0) << ", " << proj(1, 1) << ", " << proj(1, 2) << ", " << proj(1, 3) << "} "
315  << "{" << proj(2, 0) << ", " << proj(2, 1) << ", " << proj(2, 2) << ", " << proj(2, 3) << "} "
316  << "{" << proj(3, 0) << ", " << proj(3, 1) << ", " << proj(3, 2) << ", " << proj(3, 3) << "} ";
317 
318 
319  resultStrm << "\nculling: " << culling
320  << "\nblending: " << blending
321  << "\nalphaTest: " << alphaTest;
322 
323 
324  resultStrm << "\ndepthTest: " << depthTest
325  << "\ndepthWrite: " << depthWrite
326  << "\ndepthFunc: " << depthFunString[depthFunc - GL_NEVER]
327  << "\ndepthRange: [" << depthRange[0] << ", " << depthRange[1] << "]"
328  << "\ncolorWriteMask: " << colorWriteMask[0] << ", " << colorWriteMask[1] << ", "<< colorWriteMask[2] << ", "<< colorWriteMask[2];
329 
330  resultStrm << "\nalphaFunc: " << depthFunString[alphaFunc - GL_NEVER]
331  << "\nalphaRef: " << alphaRef;
332 
333  resultStrm << "\ndiffuse: [" << diffuse[0] << ", " << diffuse[1] << ", " << diffuse[2] << "]";
334  resultStrm << "\nambient: [" << ambient[0] << ", " << ambient[1] << ", " << ambient[2] << "]";
335  resultStrm << "\nspecular: [" << specular[0] << ", " << specular[1] << ", " << specular[2] << "]";
336  resultStrm << "\nemissive: [" << emissive[0] << ", " << emissive[1] << ", " << emissive[2] << "]";
337 
338  resultStrm << "\nshininess: " << shininess;
339  resultStrm << "\nalpha: " << alpha;
340 
341 
342  resultStrm << "\ninZPrePass: " << inZPrePass;
343  resultStrm << "\ndepthMapUniformName: " << depthMapUniformName;
344 
345 
346  resultStrm << "\ninternalFlags: " << internalFlags_;
347 
348  // textures
349  for (std::map<size_t, Texture>::const_iterator it = textures_.begin(); it != textures_.end(); ++it)
350  {
351  resultStrm << "\ntexture unit " << it->first << ": ";
352 
353  switch (it->second.type)
354  {
355  case GL_TEXTURE_1D: resultStrm << "GL_TEXTURE_1D"; break;
356  case GL_TEXTURE_2D: resultStrm << "GL_TEXTURE_2D"; break;
357  case GL_TEXTURE_3D: resultStrm << "GL_TEXTURE_3D"; break;
358 #ifdef GL_TEXTURE_RECTANGLE
359  case GL_TEXTURE_RECTANGLE: resultStrm << "GL_TEXTURE_RECTANGLE"; break;
360 #endif
361 #ifdef GL_TEXTURE_CUBE_MAP
362  case GL_TEXTURE_CUBE_MAP: resultStrm << "GL_TEXTURE_CUBE_MAP"; break;
363 #endif
364 #ifdef GL_TEXTURE_1D_ARRAY
365  case GL_TEXTURE_1D_ARRAY: resultStrm << "GL_TEXTURE_1D_ARRAY"; break;
366 #endif
367 #ifdef GL_TEXTURE_2D_ARRAY
368  case GL_TEXTURE_2D_ARRAY: resultStrm << "GL_TEXTURE_2D_ARRAY"; break;
369 #endif
370 #ifdef GL_TEXTURE_CUBE_MAP_ARRAY
371  case GL_TEXTURE_CUBE_MAP_ARRAY: resultStrm << "GL_TEXTURE_CUBE_MAP_ARRAY"; break;
372 #endif
373 #ifdef GL_TEXTURE_BUFFER
374  case GL_TEXTURE_BUFFER: resultStrm << "GL_TEXTURE_BUFFER"; break;
375 #endif
376 #ifdef GL_TEXTURE_2D_MULTISAMPLE
377  case GL_TEXTURE_2D_MULTISAMPLE: resultStrm << "GL_TEXTURE_2D_MULTISAMPLE"; break;
378 #endif
379 #ifdef GL_TEXTURE_2D_MULTISAMPLE_ARRAY
380  case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: resultStrm << "GL_TEXTURE_2D_MULTISAMPLE_ARRAY"; break;
381 #endif
382  default: resultStrm << "unknown_type"; break;
383  }
384 
385  resultStrm << " - id " << it->second.id;
386  }
387 
388  if (vertexDecl)
389  resultStrm << "\n" << vertexDecl->toString();
390 
391 
392  return result;
393 }
394 
395 
396 void RenderObject::setUniform( const char *_name, GLint _value )
397 {
398  uniformPool_.setUniform(_name, _value);
399 }
400 
401 void RenderObject::setUniform( const char *_name, GLfloat _value )
402 {
403  uniformPool_.setUniform(_name, _value);
404 }
405 
406 void RenderObject::setUniform( const char *_name, const ACG::Vec2f &_value )
407 {
408  uniformPool_.setUniform(_name, _value);
409 }
410 
411 void RenderObject::setUniform( const char *_name, const ACG::Vec3f &_value )
412 {
413  uniformPool_.setUniform(_name, _value);
414 }
415 
416 void RenderObject::setUniform( const char *_name, const ACG::Vec4f &_value )
417 {
418  uniformPool_.setUniform(_name, _value);
419 }
420 
421 void RenderObject::setUniform( const char *_name, const ACG::GLMatrixf &_value, bool _transposed /*= false*/ )
422 {
423  uniformPool_.setUniform(_name, _value, _transposed);
424 }
425 
426 void RenderObject::setUniformMat3( const char *_name, const ACG::GLMatrixf &_value, bool _transposed /*= false*/ )
427 {
428  uniformPool_.setUniform(_name, _value, _transposed);
429 }
430 
431 void RenderObject::setUniform( const char *_name, GLint *_values, int _count )
432 {
433  uniformPool_.setUniform(_name, _values, _count);
434 }
435 
436 void RenderObject::setUniform( const char *_name, GLfloat *_values, int _count )
437 {
438  uniformPool_.setUniform(_name, _values, _count);
439 }
440 
442 {
443  uniformPool_.addPool(_pool);
444 }
445 
446 
447 void RenderObject::setupLineRendering( float _lineWidth, const Vec2f& _screenSize )
448 {
449  shaderDesc.geometryTemplateFile = "Wireframe/geom_line2quad.tpl";
450 
451  setUniform("lineWidth", _lineWidth);
452  setUniform("screenSize", _screenSize);
453 }
454 
456 {
457  return shaderDesc.geometryTemplateFile == "Wireframe/geom_line2quad.tpl" ||
458  (shaderDesc.geometryTemplateFile == "Wireframe/gl42/geometry.tpl" &&
459  shaderDesc.fragmentTemplateFile == "Wireframe/gl42/fragment.tpl");
460 }
461 
463 {
464  shaderDesc.geometryTemplateFile.clear();
465 }
466 
467 void RenderObject::setupPointRendering( float _pointSize, const Vec2f& _screenSize )
468 {
469  shaderDesc.geometryTemplateFile = "PointSize/geometry.tpl";
470  shaderDesc.fragmentTemplateFile = "PointSize/fragment.tpl";
471 
472  setUniform("pointSize", _pointSize);
473  setUniform("screenSize", _screenSize);
474 }
475 
477 {
478  return shaderDesc.geometryTemplateFile == "PointSize/geometry.tpl" &&
479  shaderDesc.fragmentTemplateFile == "PointSize/fragment.tpl";
480 }
481 
483 {
484  shaderDesc.geometryTemplateFile.clear();
485  shaderDesc.fragmentTemplateFile.clear();
486 }
487 
488 
489 
490 } // namespace ACG end
491 
void addPool(const UniformPool &_src)
Add all uniforms of a pool to this pool.
Definition: UniformPool.cc:136
VectorT< float, 2 > Vec2f
Definition: VectorT.hh:108
GLuint indexBuffer
Use vertex array object.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
float shininess() const
get specular shininess (must be in [0, 128])
Definition: GLState.hh:963
Vec2f depthRange
glDepthRange: (znear, zmax)
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
void specularColor(const Vec4f &_s)
set the specular color
std::map< size_t, Texture > textures_
holds the textures (second) and the stage id (first)
GLenum alphaFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
bool isDefaultLineObject() const
Test if the object is rendered with one of the default line thickness methods.
void resetPointRendering()
Reset shader template names blocked by point rendering.
GLenum blendDest
glBlendFunc: GL_SRC_ALPHA, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA ...
void setupPointRendering(float _pointSize, const Vec2f &_screenSize)
Setup rendering of circle points.
void resetLineRendering()
Reset shader template names blocked by line rendering.
void addTextureType(GLenum _type, bool _shadow, size_t _stage)
adds a texture type to the shader and enables texturing.
QString toString() const
GLuint vertexBuffer
VBO, IBO ids, ignored if VAO is provided.
void setUniform(const char *_name, GLint _value)
set values for int uniforms
unsigned int internalFlags_
may be used internally by the renderer
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
Definition: RenderObject.cc:69
GLuint vertexArrayObject
Use vertex array object.
const GLMatrixd & modelview() const
get modelview matrix
Definition: GLState.hh:794
void clear()
Clear the pool.
Definition: UniformPool.cc:86
const GLMatrixd & projection() const
get projection matrix
Definition: GLState.hh:789
QString toString() const
convert ShaderGenDesc to string format for debugging
void diffuseColor(const Vec4f &_d)
set the diffuse color.
const void * sysmemIndexBuffer
Use system memory index buffer.
GLSL uniform pool.
Definition: UniformPool.hh:71
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
bool colored() const
Are colors used?
Definition: DrawModes.hh:228
GLenum primitiveMode
Primitive type.
const Vec4f & specular_color() const
get specular color
Definition: GLState.hh:944
unsigned int numIndices
Number indices to render.
void addUniformPool(const GLSL::UniformPool &_pool)
add all uniforms from a pool
DrawModeProperties stores a set of properties that defines, how to render an object.
Definition: DrawModes.hh:183
Vec3f diffuse
material definitions
bool flatShaded() const
Is flat shading used (Normals per face)?
Definition: DrawModes.hh:231
static bool isStateEnabled(GLenum _cap)
returns true, if a cpa state is enabled
Definition: GLState.cc:1533
void clearTextures()
disables texture support and removes all texture types
void ambientColor(const Vec4f &_a)
set the ambient color.
void baseColor(const Vec4f &_c)
set the base color
GLMatrixd modelview
Modelview transform.
const char * depthMapUniformName
Uniform name of the depth map in the used shader.
bool textured() const
Is texturing enabled?
Definition: DrawModes.hh:225
const GLenum & depthFunc() const
get glDepthFunc() that is supposed to be active
Definition: GLState.cc:937
void setupShaderGenFromDrawmode(const SceneGraph::DrawModes::DrawModeProperties *_props)
Fills out ShaderGenDesc parameters based on Drawmode properties.
const Vec4f & ambient_color() const
get ambient color
Definition: GLState.hh:934
unsigned int indexOffset
Offset to first index in the index buffer or vertex buffer respectively.
bool lighting() const
Is lighting enabled?
Definition: DrawModes.hh:222
int priority
Priority to allow sorting of objects.
bool isDefaultPointObject() const
Test if the object is rendered with one of the default point extension methods.
void shininess(float _s)
set shininess
const Vec4f & base_color() const
get base color (used when lighting is off)
Definition: GLState.hh:929
int debugID
used internally for renderer debugging
void setUniform(const char *_name, GLint _value)
Set int uniform to specified value.
Definition: UniformPool.cc:512
static void getBlendFunc(GLenum *_sfactor, GLenum *_dfactor)
get blend function, null-ptr safe
Definition: GLState.hh:317
bool inZPrePass
Specify whether this object should be rendered in a z-prepass.
unsigned int patchVertices
patch size if primitiveMode is GL_PATCHES for rendering with tessellation shaders ...
void setupLineRendering(float _lineWidth, const Vec2f &_screenSize)
Setup rendering of thick lines.
const Vec4f & diffuse_color() const
get diffuse color
Definition: GLState.hh:939
float alphaValue() const
get current alpha value for alpha_test
GLMatrixd proj
Projection transform.