Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


trick

Member Since 29 Dec 2006
Offline Last Active Dec 20 2012 06:23 PM

Posts I've Made

In Topic: Runs in debug, not release

29 March 2012 - 03:32 AM

Awesome, managed to get it fixed! The problem was happening around this code:
if(numVSBuffers > 0){
  DevCon->VSSetConstantBuffers(0, numVSBuffers, reinterpret_cast<ID3D11Buffer* const*>(g_pVSConstantBuffers));
}
where numVSBuffers is an int. I added "numVSBuffers = 0;" to the constructor for the class, and the problem went away.
Thanks!

In Topic: Why would this fail?

05 March 2012 - 08:23 PM

Thanks for the help! I downloaded the Application Verifier, and although the results from it didn't help me to find the problem, I ended up finding it by manually following each step in the program. It was indeed due to writing to memory outside the array size, and now it's working great!

In Topic: Why would this fail?

03 March 2012 - 07:50 PM

Thanks for quick response!
Is there any easier way to track that down than to follow every step of the program, manually tracking those items?

In Topic: Vertex Shader Problem

01 February 2012 - 07:37 PM

Thanks for quick response! Managed to see what was going on, after checking that.

In Topic: Advice for 2d in a 3d world

23 January 2012 - 05:00 AM

One last question on the subject. If the object here is to use instancing, to reduce the number of draw calls being made, I see two things I want to know if I'm correct on.

1) The textures need to be in one sprite-sheet for all sprites, so that the texture buffer can be updated once prior to calling draw function.

2) Couldn't the same idea be applied without the ortho matrix, like the vertex shader below?

//Sprites.vs
//--------------------------------------------------------------------------------------
// Buffers
//--------------------------------------------------------------------------------------
cbuffer OnScreenUpdate : register( b0 )
{
float sWidth;
float sHeight;
}
//--------------------------------------------------------------------------------------
// Typedefs
//--------------------------------------------------------------------------------------
struct VertexInput{
float4 Pos : POSITION;
	    float2 Tex : TEXCOORD0;
	    float2 sPos : TEXCOORD1;
};
//sPos = screen position

struct PixelInput{
	    float4 Pos : SV_POSITION;
	    float2 Tex : TEXCOORD0;
};

//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PixelInput VS( VertexInput input )
{
	    PixelInput output;
output.Pos = input.Pos;
output.Pos[0] = (((output.Pos[0] + sPos[0]) * 2) / sWidth) - 1;
output.Pos[1] = (((output.Pos[1] + sPos[1]) * 2) / sHeight) - 1;
output.Tex = input.Tex;
  
	    return output;
}

PARTNERS