Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Mclankyman

Member Since 22 Apr 2013
Offline Last Active May 28 2013 02:59 AM

Posts I've Made

In Topic: Cannot get textured quad visible

09 May 2013 - 10:56 AM

I've sorted it. I wasn't clearing the depth buffer.

 

Although to be fair I thought this would have just rendered the image first frame then stuck like that.

 

Obviously being a problem once other objects had to be rendered.


In Topic: Cannot get textured quad visible

09 May 2013 - 10:04 AM

Thanks, I was looking how to debug a pixel rather than a vertex.

 

It has told me that it is discarded because it has failed the depth test.

 

The vertices have a depth of 0.25 post vertex shader. Meaning they should be visible. Plus it is the only geometry being rendered so it cant be underneath anything else.

 

So it must either be my raster code

 

D3D11_RASTERIZER_DESC rastDesc;
	ZeroMemory( &rastDesc, sizeof( rastDesc ) );
	rastDesc.FillMode =  D3D11_FILL_SOLID ;
	rastDesc.CullMode =  D3D11_CULL_NONE   ;
	rastDesc.FrontCounterClockwise = false;
    rastDesc.DepthBias = 0.0f;
	rastDesc. DepthBiasClamp = 0.0f;
	rastDesc. SlopeScaledDepthBias = 0.0f;
	rastDesc.DepthClipEnable = true;
	rastDesc.ScissorEnable = false;
	rastDesc.MultisampleEnable = false;
	rastDesc.AntialiasedLineEnable = false;

	Program::GetInstance()->GetD3DDevice()->CreateRasterizerState(&rastDesc, & m_rasterizerState);
	Program::GetInstance()->GetD3DDeviceContext()->RSSetState(m_rasterizerState);

 

Or the projection Matrix's final two values.

 

Matrix view = XMMatrixIdentity( );
Matrix projection = XMMatrixOrthographicOffCenterLH( 0.0f, 1000.0f, 0.0f, 1000.0f, 0.0f, 2.0f );
m_viewProj = XMMatrixMultiply( view, projection );

But I thought what I had wrote meant anything between 0.0 and 2.0 in world space would be visible.


In Topic: Diffuse light on mesh not working - normals missing / wrong

23 April 2013 - 08:03 AM

Well i create a matrix using MatrixScaling(x,y,z)  SCALING

 

then have world as 

 

(SCALING * TRANSFORMATION)

 

so the only problem I could think of is that the w value of a normal is not scaled. But that confuses me a little.


In Topic: Diffuse light on mesh not working - normals missing / wrong

23 April 2013 - 01:35 AM

Worked straight away. Case closed. Do these forums have like a topic finished option or anything.


In Topic: Diffuse light on mesh not working - normals missing / wrong

23 April 2013 - 01:31 AM

Well the sphere is grey when I transform the normals but multicoloured (as expected) when I just render the normal as it came in the model. So it's something to do with the transformation for sure. I am going to try and use the transpose inverse matrix of the world matrix instead, even though I just thought that was necessary with non-uniform scaling.


PARTNERS