Esempio n. 1
0
// display texture
// XXX: NEEDS TO BE IMPLEMENTED
void Texture::display(void){

  // setup model matrix
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();

  glClearColor(0.5, 0.5, 0.5, 1.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  	if(rayTraceMode){
		normQuadShader.bind();
		rayTexture.bind();
		quad.draw();
		normQuadShader.unbind();
		rayTexture.unbind();

	}else{
		mesh1.draw();
		mesh.draw();
		mesh2.draw();
	}


  glutSwapBuffers();
//    glPopAttrib();

}
Esempio n. 2
0
    void render(uint textureId) {
        pointProgram.bind();

        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glActiveTexture(GL_TEXTURE1);
        glBindTexture(GL_TEXTURE_2D, textureId);
        generateVertexBuffer();
        HardwareBuffer::VBOStruct _VBO;
        _VBO.vertexBufferData = vertexBufferData;
        _VBO.vertexBufferSize = static_cast<int>(pointList.size()) * 3;

        buffer.updateVBO(_VBO, HardwareBuffer::FLAG_VERTEX_BUFFER);
        buffer.render(GL_POINTS);

        glDisable(GL_BLEND);
        pointProgram.unbind();
        glBindTexture(GL_TEXTURE_2D, 0);
        glActiveTexture(GL_TEXTURE0);
        glBindTexture(GL_TEXTURE_2D, 0);
    }