Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualTom KQT

Posted 14 June 2013 - 05:52 AM

Out of all of the conjecture and philosophical discussion (which is also important...) nobody answered the original question from the OP.  He wants to know why his w value is initialized to 1 when he only has a XYZ format for his vertex information.  Its been really long since I worked with D3D9, so I couldn't say off the top of my head why that is.  Can you describe how you managed to determine that the value is 1?

The original question isn't really very clear.

I would guess that it may be about this: If you have a vertex declaration entry for vertex position (D3DDECLUSAGE_POSITION) with the type D3DDECLTYPE_FLOAT3 and your vertex shader input parameter for position is float4, then w is automatically filled with w = 1, because that's what points need. I don't know whether for normal it would put 0 there, but I guess it would.

Anyway, I personaly have always been consistent in this and with D3DDECLTYPE_FLOAT3 I use float3 in shaders. And I add w manually.


#1Tom KQT

Posted 14 June 2013 - 05:52 AM

Out of all of the conjecture and philosophical discussion (which is also important...) nobody answered the original question from the OP.  He wants to know why his w value is initialized to 1 when he only has a XYZ format for his vertex information.  Its been really long since I worked with D3D9, so I couldn't say off the top of my head why that is.  Can you describe how you managed to determine that the value is 1?

The original question isn't really very clear.

I would guess that it may be about this: If you have a vertex declaration entry for vertex position (D3DDECLUSAGE_POSITION) with the type D3DDECLTYPE_FLOAT3 and your vertex shader input parameter for position is float4, then w is automatically filled with w = 1, because that's what points need. I don't know whether for normal it would put 0 there, but I guess it would.

Anyway, I personaly have always been consistent in this and with D3DDECLTYPE_FLOAT3 I use float3 in shaders. And I add w manually.

But I've been always using float3 as the data type for position in my vertex shader input parameters and have been adding the 1 manually. To be honest, I don't even know whether you can have D3DDECLTYPE_FLOAT3 in the vertex declaration and float4 in the vertex shader input parameters


PARTNERS