Exemplo n.º 1
0
void OpenGLScene::render(SupportCanvas3D *context)
{
    // Clear the screen in preparation for the next frame. (Use a gray background instead of a
    // black one for drawing wireframe or normals so they will show up against the background.)
    if (settings.drawWireframe || settings.drawNormals) glClearColor(0.5f, 0.5f, 0.5f, 0.5f);
    else glClearColor(0, 0, 0, 0);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // Get the active camera
    Camera *camera = context->getCamera();
    assert(camera);
    glm::mat4 viewMatrix = camera->getViewMatrix();

    glUseProgram(m_shader);

    // Set scene uniforms.
    clearLights();
    setLights(viewMatrix);
    glUniform1i(m_uniformLocs["useLighting"], settings.useLighting);
    glUniform1i(m_uniformLocs["useArrowOffsets"], GL_FALSE);
    glUniformMatrix4fv(m_uniformLocs["p"], 1, GL_FALSE,
            glm::value_ptr(camera->getProjectionMatrix()));
    glUniformMatrix4fv(m_uniformLocs["v"], 1, GL_FALSE,
            glm::value_ptr(viewMatrix));
    glUniformMatrix4fv(m_uniformLocs["m"], 1, GL_FALSE,
            glm::value_ptr(glm::mat4()));
    glUniform3f(m_uniformLocs["allBlack"], 1, 1, 1);


    renderGeometry();

    if (settings.drawWireframe)
    {
        glUniform3f(m_uniformLocs["allBlack"], 0, 0, 0);
        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

        renderGeometry();

        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    }
    // Render normals if specified.
    if (settings.drawNormals)
    {
        glUseProgram(m_shader);
        glUniform3f(m_uniformLocs["allBlack"], 0, 0, 0);
        this->renderNormals();
    }

    glUseProgram(0);
}
    void SliceExtractor::renderImageImpl(DataContainer& dataContainer, const ImageRepresentationGL::ScopedRepresentation& img) {

        // prepare OpenGL
        _shader->activate();
        cgt::TextureUnit inputUnit, tfUnit;
        img->bind(_shader, inputUnit);
        p_transferFunction.getTF()->bind(_shader, tfUnit);

        cgt::mat4 identity = cgt::mat4::identity;

        _shader->setUniform("_texCoordsMatrix", _texCoordMatrix);
        _shader->setUniform("_modelMatrix", identity);
        _shader->setUniform("_viewMatrix", _viewMatrix);
        _shader->setUniform("_projectionMatrix", identity);
        _shader->setUniform("_useTexturing", true);
        _shader->setUniform("_useSolidColor", true);

        // render slice
        FramebufferActivationGuard f*g(this);
        createAndAttachColorTexture();
        createAndAttachDepthTexture();
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        QuadRdr.renderQuad();

        if (p_renderCrosshair.getValue())
            renderCrosshair(img);

        renderGeometry(dataContainer, img);

        _shader->deactivate();
        cgt::TextureUnit::setZeroUnit();

        dataContainer.addData(p_targetImageID.getValue(), new RenderData(_fbo));
    }
Exemplo n.º 3
0
void ModelNode::render(RenderPass pass) {
	// Apply the node's transformation

	glTranslatef(_position[0], _position[1], _position[2]);
	glRotatef(_orientation[3], _orientation[0], _orientation[1], _orientation[2]);

	glRotatef(_rotation[0], 1.0, 0.0, 0.0);
	glRotatef(_rotation[1], 0.0, 1.0, 0.0);
	glRotatef(_rotation[2], 0.0, 0.0, 1.0);


	// Render the node's geometry

	bool shouldRender = _render && (_indexBuffer.getCount() > 0);
	if (((pass == kRenderPassOpaque)      &&  _isTransparent) ||
	    ((pass == kRenderPassTransparent) && !_isTransparent))
		shouldRender = false;

	if (shouldRender)
		renderGeometry();


	// Render the node's children
	for (std::list<ModelNode *>::iterator c = _children.begin(); c != _children.end(); ++c) {
		glPushMatrix();
		(*c)->render(pass);
		glPopMatrix();
	}
}
Action::ResultE
CPUSkinningAlgorithm::renderEnter(Action *action)
{
    Action::ResultE  res     = Action::Continue;
    SkinnedGeometry *skinGeo = getSkin    ();
    Skeleton        *skel    = getSkeleton();
    RenderAction    *ract    =
        boost::polymorphic_downcast<RenderAction *>(action); 

    OSG_ASSERT(skinGeo != NULL);
    OSG_ASSERT(skel    != NULL);

    CPUSkinningDataAttachmentUnrecPtr data = getCPUSkinningData(skinGeo);

    if(data == NULL)
    {
        data = CPUSkinningDataAttachment::create();
        skinGeo->addAttachment(data);
    }

    skel->renderEnter(action, skinGeo);

    if(data->getDataValid() == false)
    {
        transformGeometry(skinGeo, skel, data);

        data->setDataValid(true);
    }

    renderGeometry(ract, skinGeo, data);

    return res;
}
Exemplo n.º 5
0
void kit::BakedTerrain::renderShadows(glm::mat4 const & viewMatrix, glm::mat4 const & projectionMatrix)
{
  glDisable(GL_CULL_FACE);
  auto program = kit::Model::getShadowProgram(false, false, false);
  program->setUniformMat4("uniform_mvpMatrix", projectionMatrix * viewMatrix * getWorldTransformMatrix());
  program->use();
  renderGeometry();
}
Exemplo n.º 6
0
  	void SFRenderer::renderGeometry(SFGeometry* geometry,int lod) {

  		// geometry is drawn
  		geometry->drawGeometry(lod);
  		// sons geometry are drawn
  		for (int i=0; i < geometry->getSonsCount(); i++) {
  			renderGeometry(geometry->getSon(i),lod);
		}
	}
Exemplo n.º 7
0
  void RenderColorCube::Process(tgt::Geometry *geometry, tgt::Camera *camera)
  {
    // set modelview and projection matrices
    MatStack.matrixMode(tgt::MatrixStack::PROJECTION);
    MatStack.pushMatrix();
    MatStack.loadMatrix(camera->getProjectionMatrix(frontTarget_->getSize()));

    MatStack.matrixMode(tgt::MatrixStack::MODELVIEW);
    MatStack.pushMatrix();
    MatStack.loadMatrix(camera->getViewMatrix());

    glEnable(GL_DEPTH_TEST);

    // render front texture
    if (frontTarget_) {
      // simple implement
      //glEnable(GL_DEPTH_CLAMP);
      //renderGeometry(geometry, camera, frontTarget_, GL_LESS, 1.0f, GL_BACK);
      //glDisable(GL_DEPTH_CLAMP);

      // improved method for situation when camera inside volume.
      renderGeometry(geometry, camera, tmpTarget_, GL_LESS, 1.0f, GL_BACK); // render first front face
      renderGeometry(geometry, camera, backTarget_, GL_LESS, 1.0f, GL_FRONT); // render first back face
      fillEntryPoints(backTarget_, tmpTarget_, frontTarget_, geometry, camera);
    }

    // render back texture
    if (backTarget_) {
      renderGeometry(geometry, camera, backTarget_, GL_GREATER, 0.0f, GL_FRONT);
    }

    // restore OpenGL state
    MatStack.matrixMode(tgt::MatrixStack::PROJECTION);
    MatStack.popMatrix();
    MatStack.matrixMode(tgt::MatrixStack::MODELVIEW);
    MatStack.popMatrix();

    tgt::TextureUnit::setZeroUnit();
    LGL_ERROR;
  }
Exemplo n.º 8
0
  	void SFRenderer::renderNodeContent(SFNode* node,int lod) {

  		SFModel* model=node->getModel();
  		if(model!=0){

  			setupRenderingData(model);

  			node->getTransform()->apply();

  			SFGeometry* rootGeometry=node->getModel()->getRootGeometry();
  			renderGeometry(rootGeometry,lod);
		}
	}
Exemplo n.º 9
0
void WaitingForYou::renderImp()
{
	//
	_modules->getRenderEngine()->getRenderSystem()->clear(0, NULL, Euclid::eClearFlags_Target | Euclid::eClearFlags_ZBuffer, Euclid::Color::Black, 1.0f, 0L);

	_modules->getRenderEngine()->getRenderSystem()->beginScene();

	//
	renderGeometry();

	//
	_modules->getRenderEngine()->getRenderSystem()->endScene();
}
void RocketRenderingInterface::RenderCompiledGeometry(CompiledGeometryHandle geometry, const Vector2f& translation)
{
	GR_DEBUG_SCOPE("libRocket::RenderCompiledGeometry");

	auto geom = reinterpret_cast<CompiledGeometry*>(geometry);

	auto bitmap = -1;
	if (geom->texture != nullptr) {
		bitmap = geom->texture->handle + geom->texture->frame_num;
	}

	renderGeometry(geom->vertex_buffer, geom->index_buffer, geom->num_elements, bitmap, translation);
}
void RocketRenderingInterface::RenderGeometry(Vertex* vertices, int num_vertices, int* indices, int num_indices,
                                              TextureHandle texture, const Vector2f& translation)
{
	gr_update_buffer_data(vertex_stream_buffer, sizeof(*vertices) * num_vertices, vertices);
	gr_update_buffer_data(index_stream_buffer, sizeof(*indices) * num_indices, indices);

	int bitmap;
	if (texture == 0) {
		bitmap = -1;
	} else {
		bitmap = get_texture(texture)->handle + get_texture(texture)->frame_num;
	}

	renderGeometry(vertex_stream_buffer, index_stream_buffer, num_indices, bitmap, translation);
}
Exemplo n.º 12
0
bool WaitingForYou::rendering()
{
	//
	_modules->getRenderEngine()->getRenderSystem()->clear(0, NULL, Euclid::eClearFlags_Target | Euclid::eClearFlags_ZBuffer, Euclid::Color::Green, 1.0f, 0L);
	
	_modules->getRenderEngine()->getRenderSystem()->beginScene();
	//
	renderGeometry();

	//
	_modules->getRenderEngine()->getRenderSystem()->endScene();
	_modules->getRenderEngine()->getRenderSystem()->present(NULL, NULL, NULL);
	//
	return true;
}
Exemplo n.º 13
0
int TestApplication::run() {
    if (!initialize())
        return -1;
    
    PhysicsSimulation simulation(Vector2f(0.0f, 10.0f), 10);

    createGeometry();
    
    for (std::vector<CircleBody*>::const_iterator i = _circleBodies.begin(); i != _circleBodies.end(); ++i)
        simulation.addBody(*i);
    
    for (std::vector<PolygonBody*>::const_iterator i = _polygonBodies.begin(); i != _polygonBodies.end(); ++i)
        simulation.addBody(*i);

    Timer _timer(1000.0f / 60); //60 updates per second
    _timer.start();
    
    while (_window.isOpen()) {
        handleInput();
        
        if (_mouseForce.x < -100.0f)
            _mouseForce.x = -100.0f;
        else if (_mouseForce.x > 100.0f)
            _mouseForce.x = 100.0f;
        
        if (_mouseForce.y < -100.0f)
            _mouseForce.y = -100.0f;
        else if (_mouseForce.y > 100.0f)
            _mouseForce.y = 100.0f;

        _timer.update();
        
        while (_timer.checkTimeStep())
            simulation.update(_timer.timeStep() * 0.001f);
        
        _camera.update();
        
        _window.clear();
        
        checkMouseCollision();
        
        renderGeometry();
    }
    
    return 0;
}
Exemplo n.º 14
0
void ObjectRenderer::renderAtomic(Atomic* atomic,
                                  const glm::mat4& worldtransform,
                                  GameObject* object, RenderList& render) {
    RW_CHECK(atomic->getGeometry(), "Can't render an atomic without geometry");
    RW_CHECK(atomic->getFrame(), "Can't render an atomic without a frame");

    const auto& geometry = atomic->getGeometry();
    const auto& frame = atomic->getFrame();

    RW::BSGeometryBounds& bounds = geometry->geometryBounds;

    auto transform = worldtransform * frame->getWorldTransform();

    glm::vec3 boundpos = bounds.center + glm::vec3(transform[3]);
    if (!m_camera.frustum.intersects(boundpos, bounds.radius)) {
        culled++;
        return;
    }

    renderGeometry(geometry.get(), transform, object, render);
}
Exemplo n.º 15
0
void kit::BakedTerrain::renderDeferred(kit::Renderer * renderer)
{
  if(!m_valid)
  {
    return;
  }

  glm::mat4 modelViewMatrix = renderer->getActiveCamera()->getViewMatrix() * getWorldTransformMatrix();
  glm::mat4 modelViewProjectionMatrix = renderer->getActiveCamera()->getProjectionMatrix() * renderer->getActiveCamera()->getViewMatrix() * getWorldTransformMatrix();

  glDisable(GL_BLEND);
  glDisable(GL_CULL_FACE);
  //glCullFace(GL_BACK);

  m_program->setUniformMat4("uniform_mvMatrix", modelViewMatrix);
  m_program->setUniformMat4("uniform_mvpMatrix", modelViewProjectionMatrix);

  m_program->use();
  
  renderGeometry();
}
Exemplo n.º 16
0
bool GameRenderer::renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix, GameObject* object, float opacity, bool queueTransparent)
{
	auto localmatrix = matrix;
	bool vis = true;

	if(object && object->skeleton) {
		// Skeleton is loaded with the correct matrix via Animator.
		localmatrix *= object->skeleton->getMatrix(f);

		vis = object->skeleton->getData(f->getIndex()).enabled;
	}
	else {
		localmatrix *= f->getTransform();
	}

	if( vis ) {
		for(size_t g : f->getGeometries()) {
			if( !object || !object->animator )
			{
				RW::BSGeometryBounds& bounds = m->geometries[g]->geometryBounds;
				
				glm::vec3 boundpos = bounds.center + glm::vec3(localmatrix[3]);
				if(! _camera.frustum.intersects(boundpos, bounds.radius)) {
					culled++;
					continue;
				}
			}

			renderGeometry(m, g, localmatrix, opacity, object);
		}
	}
	
	for(ModelFrame* c : f->getChildren()) {
		renderFrame(m, c, localmatrix, object, queueTransparent);
	}
	return true;
}
Exemplo n.º 17
0
void CGlutWindow::renderFrame() {
    
	if (stereoSwitch != isStereo) {
		int w = glutGet( GLUT_WINDOW_WIDTH );
		int h = glutGet( GLUT_WINDOW_HEIGHT );
		resize(w,h);
	}
    
	stereoSwitch = isStereo;
    
	double dAspectRatio = double(m_nWidth)/double(m_nHeight);
    
	// The usual OpenGL stuff to clear the screen and set up viewing.
	glClearColor(.5, .5, 1., 1.);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
	GLfloat fTop, fRight, fNear, fFar;
    
	fNear   = float(m_dCenter - m_dRadius);
	fFar    = float(m_dCenter + m_dRadius);
    
	if (dAspectRatio > 1.0) {
		fRight = fNear * float(tan(DEG2RAD(m_dFieldOfView)/2.0) /m_dZoom);
		fTop   = fRight * float(dAspectRatio);		
	} else {
		fTop   = fNear * float(tan(DEG2RAD(m_dFieldOfView)/2.0) /m_dZoom);
		fRight = fTop / float(dAspectRatio);
	} 
    
	glViewport(0,0,m_nWidth,m_nHeight);
    
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glFrustum( -fTop, fTop, -fRight, fRight, fNear, 10*fFar);
    
	CMatrix matModel = m_pCameraArcball->getRotatonMatrix().getInverse();
    
	double matrix[16];
	matModel.get(matrix[ 0], matrix[ 4], matrix[ 8], matrix[12],
                 matrix[ 1], matrix[ 5], matrix[ 9], matrix[13],
                 matrix[ 2], matrix[ 6], matrix[10], matrix[14],
                 matrix[ 3], matrix[ 7], matrix[11], matrix[15]);
    
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
    
	glClear(GL_COLOR_BUFFER_BIT);
    
	//Set up window for stereo or non-stereo viewing
	for( int i=0; i <= (isStereo ? 1 : 0); ++i ) {
		
		if ( isStereo )	   
			glViewport(  i*(camera->getViewportWidthInPixels()), 0,
                       camera->getViewportWidthInPixels(),
                       camera->getViewportHeightInPixels());
		
		if (i == 0) camera->transform((isStereo ? CAMERA_LEFT : CAMERA_MONO), stereoDistance);
		else camera->transform(CAMERA_RIGHT, stereoDistance);
		glTranslated(m_dTranslateX * m_dRadius/(m_dZoom), m_dTranslateY*m_dRadius/(m_dZoom), 0);
		glMultMatrixd(matrix);
		renderGeometry();	
	}
	displayTF();
    
	glutSwapBuffers();
}
Exemplo n.º 18
0
void GameState::render(PlatformWindow *window, RenderContext *render_context, InputManager *input, Assets *assets, Platform *platform,  f32 delta) {
	// for(u32 i = 0; i < assets->skel_dude.skeleton.num_joints; i++) {
	// 	const Joint &joint = assets->skel_dude.skeleton.joints[i];
	// 	Vec3 position = Mat4::extractTranslation(joint.world_mat);
	// 	if(joint.parent_index > -1) {
	// 		const Joint &parent_joint = assets->skel_dude.skeleton.joints[joint.parent_index];
	// 		Vec3 parent_position = Mat4::extractTranslation(parent_joint.world_mat) *  Vec3(0.075f) + Vec3(10.0f, 0.0f, 0.0f);
	// 		DebugRenderQueue::addLine(parent_position, position *  Vec3(0.075f) + Vec3(10.0f, 0.0f, 0.0f), Vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.1f);
	// 	}
	// }
	if(input->isKeyDownOnce(Key::F5)) generateMap();
	pn_prepass.bindForWriting(platform, render_context);
	pn_prepass.clear(render_context, Vec4(0.0f, 0.0f, 0.0f, 0.0f));

	render_context->bindShaderConstant(&per_scene_constants, 0, 0);
	const float blend_factor[4] = { 0.f, 0.f, 0.f, 0.f };
	// render_context->bindBlendState(&alpha_blend, blend_factor, 0xffffffff);
	render_context->bindRasterState(&raster_state);
	render_context->bindSampler(&texture_sampler, 0);
	render_context->bindSampler(&wrap_texture_sampler, 1);
	

	PerSceneConstants scene_constants = {};
	scene_constants.projection = camera.getProjection();
	scene_constants.view = camera.getView();
	for(int i = 0; i < ArrayCount(lights); i++) {
		Light &light = lights[i];
		scene_constants.lights[i] = light.calcShaderLight();
	}
	scene_constants.camera_position = Vec4(camera.position, 1.0f);
	scene_constants.screen_size = Vec4(camera.window_dimensions.x, camera.window_dimensions.y, 0.0f, 0.0f);
	render_context->updateShaderConstant(&per_scene_constants, &scene_constants);
	
	render_context->bindDepthStencilState(&depth_state);
	render_context->bindShader(&assets->shaders.geometry);

	// position normal pre-pass
	// render_context->bindShader(&assets->shaders.geometry_pn);
	// renderGeometry(window, render_context, input, assets, platform, delta, false);

	
	// render_context->bindDepthStencilState(&no_depth_state);
	// render_context->bindRasterState(&no_depth_raster_state);
	// pn_prepass.bindForReading(render_context);
	
	// {
	// 	RenderTexture *rts[] = {&ao_render_texture};
	// 	render_context->bindRenderTextures(platform, rts, 1, 0);
	// 	render_context->clearRenderTexture(&ao_render_texture, Vec4(1.0f).xyzw);
		
	// 	render_context->bindTexture2D(&pn_prepass.normal.texture, 0);
	// 	render_context->bindTexture2D(&pn_prepass.position.texture, 1);
	// 	render_context->bindTexture2D(&ssao_noise_texture, 2);
	// 	render_context->bindShader(&assets->shaders.ao_pass);
	// 	ssao_pass_constant_data.sceen_size = Vec2(camera.window_dimensions.x, camera.window_dimensions.y);
	// 	ssao_pass_constant_data.projection = camera.getProjection();
	// 	render_context->updateShaderConstant(&ao_pass_constants, &ssao_pass_constant_data);
	// 	render_context->bindShaderConstant(&ao_pass_constants, 0, 0);
	// 	renderFullScreenQuad(render_context);

		
	// 	render_context->bindShader(&assets->shaders.blur);
	// 	render_context->updateShaderConstant(&blur_constants, &blur_constants_data);

	// 	rts[0] = &blur_render_texture;
	// 	render_context->bindRenderTextures(platform, rts, 1, 0);
	// 	render_context->bindTexture2D(&ao_render_texture.texture, 0);
	// 	render_context->bindShaderConstant(&blur_constants, 0, 0);
	// 	renderFullScreenQuad(render_context);
	// }

	render_context->bindShaderConstant(&per_scene_constants, 0, 0);
	RenderTexture *hdr_rts[] = {&hdr_color_render_texture};
	render_context->bindRenderTextures(platform, hdr_rts, 1, 0, true);
	render_context->clearRenderTexture(&hdr_color_render_texture, Vec4(0.0f, 0.0f, 0.0f, 1.0f).xyzw);
	render_context->bindTexture2D(&assets->test, 0);
	render_context->bindTexture2D(&assets->irr_map, 1);
	render_context->bindTexture2D(&assets->env_map, 2);
	render_context->bindTexture2D(&blur_render_texture.texture, 3);
	render_context->bindShader(&assets->shaders.geometry);
	renderGeometry(window, render_context, input, assets, platform, delta, true);

	scene_constants.projection = camera.getViewProjection(false);
	render_context->updateShaderConstant(&per_scene_constants, &scene_constants);
	render_context->bindShader(&assets->shaders.skybox);
	render_context->bindTexture2D(&assets->env_map, 0);

	{
		Vec3 vertices[] = {
		/* 0 */	Vec3(-1.0f, 1.0f, -1.0f), // Top Front left
		/* 1 */	Vec3(1.0f, 1.0f, -1.0f), // Top Front right
		/* 2 */	Vec3(-1.0f, -1.0f, -1.0f), // bottom Front left
		/* 3 */	Vec3(1.0f, -1.0f, -1.0f), // bottom Front right

		/* 4 */	Vec3(-1.0f, 1.0f, 1.0f), // Top back left
		/* 5 */	Vec3(1.0f, 1.0f, 1.0f), // Top back right
		/* 6 */	Vec3(-1.0f, -1.0f, 1.0f), // bottom back left
		/* 7*/	Vec3(1.0f, -1.0f, 1.0f), // bottom back right
		};

		u16 indices[] = {
			0,  2, 1,
			2,  3, 1,
			1,  3, 5,
			3,  7, 5,
			5,  7, 4,
			7,  6, 4,
			4,  6, 0,
			6,  2, 0,
			4,  0, 5,
			0,  1, 5,
			2,  6, 3,
			6,  7, 3,
		};

		u32 vertex_count = ArrayCount(vertices);
		u32 index_count = ArrayCount(indices);
		VertexBuffer vb = render_context->createVertexBuffer(vertices, sizeof(Vec3), vertex_count);
		VertexBuffer ib = render_context->createVertexBuffer(indices, sizeof(u16), index_count, RenderContext::BufferType::Index);
		render_context->bindShaderLayout(&skybox_layout);
		render_context->bindVertexBuffer(&vb, 0);
		render_context->bindIndexBuffer(&ib, RenderContext::Format::u16);
		render_context->sendDrawIndexed(RenderContext::Topology::TriangleList, index_count, 0, 0);
		render_context->destroyVertexBuffer(&vb);
		render_context->destroyVertexBuffer(&ib);
	}
	

	render_context->bindDefaultTextures(true);
	render_context->bindDepthStencilState(&no_depth_state);
	render_context->bindTexture2D(&hdr_color_render_texture.texture, 0);

	// Final blit
	render_context->bindShader(&assets->shaders.hdr_blit);

	{
		hdr_blit_constants_data.exposure = 1.0f;
		render_context->updateShaderConstant(&hdr_blit_constants, &hdr_blit_constants_data);
		render_context->bindShaderConstant(&hdr_blit_constants, -1, 0);
		renderFullScreenQuad(render_context);;
	}

	render_context->bindDepthStencilState(&depth_state);
	collision_world->debugDrawWorld();
}