• Advertisement


  • Content count

  • Joined

  • Last visited

  1. Unity is a engine/ framework, DirectXMath is just a math library. You could create a camera class yourself, and give it 3 vectors (up, right, look) and then use the DirectXMath library/functions to perform the needed calculations.
  2. Some general advice: - enable/ use the d3d/dx11 debug layer, it will tell you if you forgot to release (COM) DX objects - I personally also use VLD (visual leak detector) which checks for memory leaks in C++ in general and outputs them in the console/debugger output - always release what you create
  3. My few cents; are you setting the reference in your Start() function? If so, perhaps try it using 'Awake', so it's done at the earliest possible time + it doesn't repeat for each game object using the script (unless you explicitly want that).
  4. C# Common question of Unity begginers

    If you're beginning I would use as much default functionalities of Unity first, so for physics just add physics components to your GameObjects. And then build up from there. If you want specific responses other then physical responses to colliding game objects, you can add new script to your GameObjects and makes functions like OnColliderEnter, OnExit... (not the correct namings, but similar :))
  5. Hi all, A month ago I joined the Global Game Jam and made a fun 2.5D platformer in 48h. The last weeks I've been brushing things up, adding features etc. This is the mission statement of the game (to give some context): "The Crown Jewels is a coop puzzle and discovery game where 2 players need to solve puzzles to escape the Big Ben with the stolen crown jewels. The game is presented to the player from a side perspective(3d rendered, stationary camera; maybe moving left/right)." Below are also some screenshots. I think it would be fun to add some one liner voice recordings to the game. In this coop game the 2 players are burglars from Britain, so I'm trying to match that atmosphere in the voice recordings. Please send me a PM if you want to help out/ join, so I can share the project/GDD. Note that's there's no commercial purpose, but ofcourse you could add it to your portfolio
  6. I think you need to download and install the legacy june 2010 directx SDK, because the bewerkt SDK's dont include d3dx11, which is used in luna's book and examples. You can find it on github, might need to build the libs (debug and release) yourself. Which should be relatively easy with some googling (if you've never did this before).
  7. Reinventing the wheel

    My 2 cents; what is your goal? Do you want to learn tech programming because eventually you want to be part of a team/ studio as a engine/ tech developer? Or is learning in general the goal, then you should do and try things you want to learn more about. If your goal is to finish a full game within the shortest time with minimal resources, then using an existing engine and/or framework could work. In short; I'd always start with some goal
  8. Thanks Kylotan. The .data works great. I've decided to stick with reading and writing of uint's, size_t and float. The first 2 I write and read as uint_32t.
  9. Hey. I went for a std::vector of floats which can hold all vertex data independent of the elements. With this I have an enum that tells which elements there are per vertex. This same enum I can now also use for my inputlayouts. Also added a simple helper to retrieve the number of floats for one of the enum values.
  10. Thanks, I think I understand what you mean. For now I've split the pre-processing of the asset to a tool. The resulting mesh file is then read into the runtime engine.
  11. Thanks guys and sorry for the late response. I've adder the ReadXxx and WriteXxx helpers, the code's much cleaner now. I decided to stick with writing/ casting only the individual standard types (float, uint etc). What I didn't figure out yet is how I can read a full chunk of data and "place" that in a std::vector. For example, say that I know that there are 100 floats in the file, would it be possible to read them all at once and place them in a std::vector<float> (with a size of 100)?
  12. Thanks. I actually already splitted that up to the asset pipeline tool. The mesh data I'm loading is already "made ready" to be loaded at runtime. The only problem is that I want to store the mesh data in my intermediate data structure, in a way that I can directly send it to the GPU (in the mesh class). Which so far I only schiefer by having a std::vector of all possible vertex formats in the struct (and using the one that's applicable for the specific mesh. If I use one big struct with all possible vertex elementen and just use the ones I need, then I need to copy all data to the correct struct right before creating the buffer (within the mesh class).
  13. Hi all, I'm struggling with the following workflow I have in my engine: 1. Prepare mesh in my asset tool, resulting in a nicely organized/ stripped chunk of mesh data (in a binary file) 2. Load the binary file with meshdata (deserialization) 3. Create a mesh object with it's GPU buffers etc. Currently I've split the deserialization from the mesh class, because I think it's a good idea to have all binary IO/ serealization code separated from the logics that use the data. When something has to change on the IO side, I can simply change that piece of code. The downside of this, is that steps 2 and 3 need some intermediate data structure, where the mesh data is stored, and which is then used by the mesh class for creating buffers, setting properties etc. Consider this struct: struct MESHDATA { std::vector<Vertex::PosNormTanTex> VerticesA; std::vector<uint> Indices; uint NrChunks; PHYSMATH::CR_BV BoundingVolume; std::vector<SUBMESH> Chunks; MESHDATA() : NrChunks(0) { } }; This all works fine as long as the mesh's vertices have a Position, Normal, Tangent and texcoord. One solution would be to give the meshdata struct a vector of the 'maxxed out' vertex type (with all possible elements), and then only store the elements that are available (leaving the rest empty). This would work, but then right before I create the GPU vertexbuffer, I would need to copy over all data to a vector of the right struct, before I create the buffer. My goal is to prevent this additional copy of all vertices on the CPU side. The only solution I've come up with so far, is this: struct MESHDATA { std::vector<Vertex::PosNormTanTex> VerticesA; std::vector<Vertex::PosNormCol> VerticesB; std::vector<Vertex::PosNormCol> .... ; // for all vertex types Vertex::Type VertexType; // used to select the applicable std::vector std::vector<uint> Indices; uint NrChunks; PHYSMATH::CR_BV BoundingVolume; std::vector<SUBMESH> Chunks; MESHDATA() : VertexType(Vertex::Type::UNKNOWN), NrChunks(0) { } }; I know this works, but I was wondering if someone has better thoughts on how to tackle this. The only downside here, I think, is having a bunch of unused std::vector's, but this doesn't really has to be an issue since it's only temporary/ on the stack when I load up meshes. Note; I understand how I can determine the inputlayout/ vertexlayout, it's just that I'm looking for a way to store the data in the intermediate datastructure, and being able to use the data directly for sending it to the GPU (in the right format/ struct). Any input is appreciated.
  14. Do you mean first writing everything to a char array (aka buffer) and then write that buffer to file? That could work, but then I have to calculate the index manually, which could be a risk if some type has a different bytesize on another problem (writing per variable and using sizeof, I think prevents this). In your example, shouldn't 3 be 4 (bytes for a float)? But perhaps there's a way to use a buffer while keeping this in mind (or don't manually calculate the index of each variable).
  15. Thanks. The VECTOR3 is my struct, so it's working for both an individual struct as a std::vector of them. Thanks
  • Advertisement