Friday, June 24, 2016

Day 40: Itty Bitty Baby Trees

Yeesh, this billboarding certainly gave me the runaround. Turns out that by using the matrix calculations inside the GPU, the billboards were all wrong. That is, rotating around strange points, much like the previous post.

What's the problem? Not sure, but I know I can shuffle in the rotations as a parameter in the instance buffer.

Wait...why not do the whole world matrix? Crazy, I know, but possible. The catch? I'm working on a fairly high warning level, so the memory won't be set as 16-bit aligned with regular mallocs. What to do? Override the operators! _mm_malloc(size, 16) did the trick. The same applies to array new operators.

With that, I can now use the matrix (properly set at row_major in the shader) and get proper rotations of a rich and lush land of...mini-trees.


I'll have to scale it at a less tired time.

No comments:

Post a Comment