32 static GLfloat lightPosition[] = {0.0f, 0.0f, 1.0f, 0.0f};
33 static GLfloat lightAmbient[] = {0.1f, 0.1f, 0.1f, 1.0f};
34 static GLfloat lightDiffuse[] = {0.8f, 0.8f, 0.8f, 1.0f};
35 static GLfloat lightSpecular[] = {0.8f, 0.8f, 0.8f, 1.0f};
38 static GLfloat materialAmbient[] = {0.2f, 0.2f, 0.2f, 1.0f};
39 static GLfloat materialDiffuse[] = {0.8f, 0.8f, 0.8f, 1.0f};
40 static GLfloat materialSpecular[] = {0.5f, 0.5f, 0.5f, 1.0f};
41 static GLint materialShininess = 64;
46 bool Renderer::init( co::Object* initData )
64 const eq::uint128_t&
id = frameData->getModelID();
65 const Model* model = application.getModel(
id );
72 glLightfv( GL_LIGHT0, GL_POSITION, lightPosition );
73 glLightfv( GL_LIGHT0, GL_AMBIENT, lightAmbient );
74 glLightfv( GL_LIGHT0, GL_DIFFUSE, lightDiffuse );
75 glLightfv( GL_LIGHT0, GL_SPECULAR, lightSpecular );
77 glMaterialfv( GL_FRONT, GL_AMBIENT, materialAmbient );
78 glMaterialfv( GL_FRONT, GL_DIFFUSE, materialDiffuse );
79 glMaterialfv( GL_FRONT, GL_SPECULAR, materialSpecular );
80 glMateriali( GL_FRONT, GL_SHININESS, materialShininess );
84 glColor3f( .75f, .75f, .75f );
90 const eq::Matrix4f projection = frustum.compute_matrix();
91 const eq::Matrix4f pmv = projection * view * modelM;
94 _state->setProjectionModelViewMatrix( pmv );
96 _state->setColors( model->hasColors( ));
98 model->cullDraw( *_state );
virtual SEQ_API bool init(co::Object *initData 1)
Initialize the renderer.
SEQ_API const Matrix4f & getModelMatrix() const
Range range
database-range wrt to dest channel
SEQ_API void updateNearFar(const Vector4f &boundingSphere)
Update the near and far planes to tightly enclose the given sphere.
SEQ_API const Frustumf & getFrustum() const
float start
The start position.
virtual bool exit()
De-initialize the renderer.
SEQ_API const GLEWContext * glewGetContext() const
Get the GLEW context for this renderer.
virtual void draw(co::Object *frameData)
Render the scene.
virtual SEQ_API void applyRenderContext()
Apply the current rendering parameters to the rendering context.
Application & getApplication()
SEQ_API const RenderContext & getRenderContext() const
SEQ_API const Matrix4f & getViewMatrix() const
virtual SEQ_API bool exit()
De-initialize the renderer.
The context applied to a channel during rendering operations.
virtual SEQ_API void applyModelMatrix()
Apply the current model matrix to the rendering context.