Jump to content

  • Log In with Google      Sign In   
  • Create Account

Irlan

Member Since 08 May 2012
Offline Last Active Yesterday, 02:15 PM

Posts I've Made

In Topic: LOL - I wrote a poem about OpenGL

02 October 2014 - 04:20 PM

Good one.

Now, write  one about DirectX 11... Bye, I'll be back next year.


In Topic: Problem with DirectX 11 Vertex Layout

30 September 2014 - 05:34 PM

 


NORMAL1 = 16 (POSITION0) + 8 (TEXCOORD0) + 16 (NORMAL0) = 40 

 

Since you don't need to specify these offsets at all to solve your problem this is pretty tangential to the solution, but I'm with kauna in asking why would NORMAL0 create an offset of 16 and not 12?

 

Yeah you're right. I need to take a sleep a little. he correct is:

 

POSITION0 = 0
TEXCOORD0 = 16 (POSITION0) 
NORMAL0 = 16 (POSITION0) + 8 (TEXCOORD0) = 24
NORMAL1 = 16 (POSITION0) + 8 (TEXCOORD0) + 12 (NORMAL0) = 36
etc.

In Topic: Problem with DirectX 11 Vertex Layout

30 September 2014 - 05:10 PM

{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 2, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 1, DXGI_FORMAT_R32G32B32_FLOAT, 3, 40, D3D11_INPUT_PER_VERTEX_DATA, 0 }

 

I think that you have made a calculation error here : 24 + 3 x float = 36

 

You could/should use the automated location calculator (ie. D3D11_APPEND_ALIGNED_ELEMENT flag).

 

Cheers!

 

As megadan said, I'm using per component vertex buffers. I have my problem solved. Anyway, I think it was correct.
 
POSITION0 = 0
TEXCOORD0 = 16 (POSITION0) 
NORMAL0 = 16 (POSITION0) + 8 (TEXCOORD0) = 24
NORMAL1 = 16 (POSITION0) + 8 (TEXCOORD0) + 16 (NORMAL0) = 40 
etc.

In Topic: Problem with DirectX 11 Vertex Layout

30 September 2014 - 03:18 PM

Since you are using one vertex buffer per component, the AlignedByteOffset value in D3D11_INPUT_ELEMENT_DESC should be 0 because the data in each vertex buffer starts at offset 0.

"The problems of porting OpenGL to DirectX 11 starts here.". I forgot that. It solved my problem.

Thank you.


In Topic: Event/Action Management

08 September 2014 - 02:04 PM

Little off-topic but is very rare the use of events in a well structured game. They are just IDs that you pass to objects instead of calling the object function. My recommendation is that you try to solve your problem without the use of events. If you're thinking that input are events they aren't. Search on the forums and you will see. Using strings to declare an event is the worst approach I think. Since all objects can know about the event, why give it a name instead of a constant ID? Games aren't that Java Application that use events for everything, they're real time simulations.


PARTNERS