Jump to content

  • Log In with Google      Sign In   
  • Create Account


Joakitex

Member Since 10 Feb 2012
Offline Last Active Mar 17 2013 01:48 PM
-----

Posts I've Made

In Topic: Problem passing matrices to shader

27 February 2012 - 02:55 AM

Yay! thanks everyone. Transposing the matrices before passing them to the video card did the trick!

In Topic: Problem passing matrices to shader

27 February 2012 - 02:32 AM

I do something similar, in D3D11 - differences are:

-- using XMFLOAT4X4 for the matrix variable format
-- loading to XMMATRIX and transposing with XMMatrixTranspose before storing back to XMFLOAT4X4 and mapping to cbuffer
-- not using packoffset in the cbuffer declaration
-- register(cb0) instead of register(b0) for the cbuffer

I'll look closer at what you did later, but those are differences I've found and mine works fine..

Also, your PIX doesn't exactly show the problem, for me - are those cbuffer variables in the debugger not reasonable? they're definitely not zeroed out or something.. in what way are they wrong?


Thanks, I'll try that out.

About the PIX thing, I am concerned about the pre and post Vertex shader thing, shouldn't the post Vertex shader output be equal or at least similar to the pre Vertex shader output?

In Topic: Is it possible to dynamically allocate memory in HLSL?

20 February 2012 - 10:39 PM

Thanks again, I'll take a look at that.

In Topic: Is it possible to dynamically allocate memory in HLSL?

19 February 2012 - 11:45 AM

Thanks both of you, this helped me a lot.

Also, a noob question. Do the constant buffers always get padded out to a multiple of the size of the biggest member of the buffer?

If I had this in the shader

struct PointLight
{
	 float4 LightColor;
	 float2 SomeData;
};

The code in C++ would be like this, am I right?

struct PointLight
{
	 D3DXVECTOR4 LColor;
	 D3DXVECTOR2 SomeData;
	 D3DXVECTOR2 Padding;
};

In Topic: Local to World space

12 February 2012 - 12:47 PM

Thanks, that helped me with the rotation problem, I haven't solved it completely yet but now I know where this is going. I will have to keep looking in the lightning thing to see what is wrong.

PARTNERS