예제 #1
0
	void CamaraLucida::render()
	{
		if (!inited())
			return;
		
		if (mesh->is_render_enabled())
		{
			fbo.bind();
			//ofEnableAlphaBlending();  
			//glEnable(GL_BLEND);  
			//glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA); 
		
			ofNotifyEvent( render_texture, void_event_args );
		
			fbo.unbind();
			//ofDisableAlphaBlending(); 
			//glDisable(GL_BLEND);  
		}
		
		glClearColor(0, 0, 0, 1);
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		glEnable(GL_DEPTH_TEST);
	
		glPolygonMode(GL_FRONT, GL_FILL);
		// TODO wireframe it's not working with fbo textures.. why?
		// @see cmlMesh.enable_render();
		// glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
		
		glColor3f(1, 1, 1);
		glViewport(0, 0, ofGetWidth(), ofGetHeight());
		
		gl_ortho();
		
		ofNotifyEvent( render_hud, void_event_args );
		
		render_screenlog();
		
		gl_projection();	
		gl_viewpoint();
		
		gl_scene_control();
		
		if (_debug)
		{
			render_world_CS();
			render_proj_CS();
			render_rgb_CS();
			render_proj_ppal_point();
		}
		
		//	if (using_opencl)
		//		opencl.finish();
		
		// TODO alpha blending!
		
		//glEnable(GL_BLEND);  
		//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
		//glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 
		//glBlendFuncSeparate(GL_ONE, GL_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
		//glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 
		//ofEnableAlphaBlending();
		
		if (mesh->is_render_enabled())
		{
			fbo.getTextureReference(0).bind();
		
			mesh->render();
		
			fbo.getTextureReference(0).unbind();
		}
		
		//glDisable(GL_BLEND);
		//ofDisableAlphaBlending(); 
	}
예제 #2
0
 void CamaraLucida::render()
 {
     renderer->render( &events, mesh );
     render_screenlog();
     render_help();
 };