• Advertisement

Jack Lumber

  • Content count

  • Joined

  • Last visited

Community Reputation

152 Neutral

About Jack Lumber

  • Rank
  1. Hello,   I'm new here and learning Direct3D. Usually I don't ask questions since Internet is already filled with answers, but failed to find a satisfying answer to the question I'm about to ask. Was thinking and thinking and couldn't find an appropriate solution... could be there's none. However, the problem.     Lets say I have a cube. In a file I could store vertex data in a compact way - 8 different vertex positions, 6 different vertex normals, 14 different texture coordinates, and finally, face definitions via respected indices. That should be the case of Wavefront OBJ file if I'm not mistaken. When reading documentation for IASetVertexBuffers I thought I was in luck and in the program can split the data in same manner in different vertex buffers, but apparently only one index buffer apply to all of them??   When loading OBJ files, then if vertex normal is different, then vertex should be duplicated. So, in memory I would have 24 vertices instead of 8, and when adding the texture coordinate attribute, I'd have them again 24 instead of 14. Bumping aside from these numbers for a moment, I managed to get to a decision that it's mesh designer's responsibility that sharp edges should have duplicated vertices / different vertex normals. But returning to the cube, is that waste considered okay since in reality I'm dealing with more complex objects than cubes and with smooth edges... unless I want to build a brick wall with individual bricks in it, lol. If so, I wouldn't even need to have cube texture unwrapped like the cross on a Bible, but just 6 sperate panes will do.     So, is that how it's meant to be or is there some better approach?
  • Advertisement