Hallelujah!

Published August 22, 2010
Advertisement
I didn't get as much time in yesterday as I would have liked, because I was helping to deal with a constipated eighteen-month old. Fun times were had by none.

Last evening, though, I finally managed to solve the last real problem I was having with geometry instancing. Helpful tip: If you're sending a matrix through a vertex buffer, the hlsl variable should be declared as row_major float4x4. Why DirectX and hlsl don't default to the same matrix format is beyond me. (Actually, it says in the docs that hlsl defaults to column-major format for optimization purposes, but still...) So, I spent about an hour double checking my code before I came across the row_major type modifier in a sample application and decided to look it up. I couldn't find anywhere in the docs that said to use it in such a case, but that's what the sample did, and it worked for me :D

I was only testing the code using one instance per draw call, so I'm still calling Draw ~1600 times per frame. Still, since I'm not updating the world matrix per object, it's already running much smoother. Once I refactor it a bit I should be able to get it down to a single call for the maze. Then I'll be happy enough to move on to the rest of the game.

This doesn't really show anything about the instancing, but screenshots are fun, and DWN suggested the entire map should be visible for strategic purposes. I miss the maze looming in darkness, but I do like the new fade:
Dramatic angle of the maze
Dramatic angle of the maze

I need to add more visuals soon; I'm running out of dramatic angles!

Oh, and the kid finally pooped, so all is well again in the yckx household.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement