Skip to main content
gamedev.net
🔒 Locked

Rendering Problems (SOLVED)

Started by Prog101 Jan 15, 2007 at 5:09 PM 2 replies 500+ views
Original Post
Prog101
Prog101
i am making a quad ground with a texture, the problem i am having is the ground does not render, but if i comment out the for loop to render my mesh objects , then the ground renders?

	// call our render function
	dxMgr.beginRender();	
	dxMgr.pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
        // render the quad ground with texture
	RenderGround();
	dxMgr.pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
	
	// Render all the mesh objects in the scene
	for (unsigned int i=0; i<objects.size(); i++)			//=========== Render all the objects in the scene
		if (objects->Active == true)				//=========== But only render if the object is active
		{
			objects->render(dxMgr.getD3DDevice());
		}
	
	// Render the font
	render_Font();
	dxMgr.endRender();



[Edited by - Prog101 on January 18, 2007 10:31:04 AM]
Vorpy
Vorpy
Are your objects possibly changing the render state and then not putting it back to the way it was afterwards?
Squirell
Squirell
In particular, check your cull mode, that often messes things up.
Prog101
Prog101
solved it

	// call our render function	dxMgr.beginRender();		dxMgr.pd3dDevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);	dxMgr.pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE);	dxMgr.pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE);	//......actually render them		for (unsigned int i=0; i<objects.size(); i++)			//=========== Render all the objects in the scene		if (objects->Active == true && objects->sObjectName != SkyBoxName)	//=========== But only render if 		{																		//the object is active or not the sky box			objects->render(dxMgr.getD3DDevice());		}	//RenderGround();	// Render the font	render_Font();	//Render translucent scene objects	dxMgr.pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE);	//......set other states and actually render them	//Render the particles	dxMgr.pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );	dxMgr.pd3dDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);	dxMgr.pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);		for (unsigned int i=0; i<objects.size(); i++)			//=========== Render the sky box		if (objects->sObjectName == SkyBoxName)				{																					objects->render(dxMgr.getD3DDevice());		}	dxMgr.pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);	dxMgr.pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);	dxMgr.pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_BLENDDIFFUSEALPHA);	gWater.process(); // Update the water's position	gWater.render();  // Draw the water	dxMgr.endRender();

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.