Commit ec650d66 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'splatcloud_rendering' into 'master'

Splatcloud rendering

See merge request !244
parents 6511d116 8e109c0d
......@@ -132,6 +132,12 @@ void IRenderer::addRenderObject(ACG::RenderObject* _renderObject)
!_renderObject->colorWriteMask[2] && !_renderObject->colorWriteMask[3])
std::cout << "warning: depth write and color write disabled in renderobject: " << _renderObject->debugName << std::endl;
// Why is gl_PointSize not working in shader?
#ifndef GL_PROGRAM_POINT_SIZE
if (_renderObject->programPointSize)
std::cout << "warning: GL_PROGRAM_POINT_SIZE requested but missing in opengl headers!" << std::endl;
#endif
if (errorDetectionLevel_ > 1 && _renderObject->shaderDesc.shadeMode == SG_SHADE_UNLIT)
{
if (_renderObject->emissive.max() < 1e-3f)
......@@ -719,6 +725,8 @@ void IRenderer::finishRenderingPipeline(bool _drawOverlay)
for (int i = 0; i < maxClipDistances_; ++i)
glDisable(GL_CLIP_DISTANCE0 + i);
glDisable(GL_PROGRAM_POINT_SIZE);
glDepthMask(1);
glColorMask(1,1,1,1);
......@@ -1048,6 +1056,15 @@ void IRenderer::bindObjectRenderStates(ACG::RenderObject* _obj)
else
glDisable(GL_CLIP_DISTANCE0 + i);
}
#ifdef GL_PROGRAM_POINT_SIZE
if (_obj->programPointSize)
glEnable(GL_PROGRAM_POINT_SIZE);
else
glDisable(GL_PROGRAM_POINT_SIZE);
#endif
glPointSize(_obj->pointSize);
}
void IRenderer::drawObject(ACG::RenderObject* _obj)
......
......@@ -74,6 +74,8 @@ void RenderObject::initFromState( GLState* _glState )
depthWrite = true;
alphaTest = false;
programPointSize = false;
colorWriteMask[0] = colorWriteMask[1] = colorWriteMask[2] = colorWriteMask[3] = 1;
fillMode = GL_FILL;
......@@ -86,6 +88,7 @@ void RenderObject::initFromState( GLState* _glState )
alpha = 1.0f;
pointSize = 0.1f;
if (_glState)
{
......@@ -113,6 +116,13 @@ void RenderObject::initFromState( GLState* _glState )
emissive[i] = _glState->base_color()[i];
}
shininess = _glState->shininess();
#ifdef GL_PROGRAM_POINT_SIZE
programPointSize = _glState->isStateEnabled(GL_PROGRAM_POINT_SIZE);
#endif
pointSize = _glState->point_size();
}
......@@ -194,24 +204,27 @@ void RenderObject::setMaterial( const SceneGraph::Material* _mat )
RenderObject::RenderObject()
: priority(0),
: priority(0),
overlay(false),
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))),
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))),
proj(modelview),
vertexArrayObject(0),
vertexBuffer(0), indexBuffer(0), sysmemIndexBuffer(0),
primitiveMode(GL_TRIANGLES), patchVertices(0), numIndices(0), indexOffset(0), indexType(GL_UNSIGNED_INT),
numInstances(0),
vertexDecl(0),
vertexDecl(0),
culling(true), blending(false), alphaTest(false),
depthTest(true), depthWrite(true),
fillMode(GL_FILL), depthFunc(GL_LESS),
fillMode(GL_FILL), depthFunc(GL_LESS),
alphaFunc(GL_ALWAYS), alphaRef(0.0f),
blendSrc(GL_SRC_ALPHA), blendDest(GL_ONE_MINUS_SRC_ALPHA),
depthRange(0.0f, 1.0f),
depthRange(0.0f, 1.0f),
clipDistanceMask(0),
programPointSize(false),
pointSize(0.1f),
patchDefaultInnerLevel(1.0f, 1.0f),
patchDefaultOuterLevel(1.0f, 1.0f, 1.0f, 1.0f),
......
......@@ -261,6 +261,14 @@ struct ACGDLLEXPORT RenderObject
// default: all zero (disabled)
GLuint clipDistanceMask;
// GL_PROGRAM_POINT_SIZE : default false
// if true, use gl_PointSize from shader
// otherwise, use pointSize from render object
bool programPointSize;
// glPointSize(), default: 0.1
float pointSize;
// ---------------------------
// default tessellation lod, if only a tess-eval, but no tess-control shader is specified
// this is ignored otherwise
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment