Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Voxel rendering optimizations

Started by khyperia 4 replies 1.5k views
Original Post
khyperia
khyperia
Ok, so. I head about a thing called "hardware instancing" and have a few questions. (I am using XNA)
First: Is it possible to store a transformation matrix, texture coordinate, and color in the "many times" part of hardware instancing? I was thinking I could simply start with a single square, and transform that everywhere there was a visible face.
Second: Would it be faster to transform the entire cube around, acknowledging that most faces will not be visible, or just transform a face?
Third: Is it possible to combine a transformation AND rotation matrix into the same matrix, then apply the final matrix to whatever you want to transform? (I just want to store a single matrix in the hardware instancing thing, transformation and rotation)
Answer any question(s) that you want, any help is appreciated.
Adaline
Adaline
Hello

Third: Is it possible to combine a transformation AND rotation matrix into the same matrix, then apply the final matrix to whatever you want to transform? (I just want to store a single matrix in the hardware instancing thing, transformation and rotation)


Yes of course that's possible : you can set each step of the complete transform with a matrix and multiply them together to get a single matrix that contains the whole transform
(see matrices multiplication as transform composition)
Hope that helps wink.gif

hupsilardee
hupsilardee
Are the cubes axis aligned, like Minecraft?
Ben Bowen
Ben Bowen

Are the cubes axis aligned, like Minecraft?


They're voxels, buddy.
hupsilardee
hupsilardee

[quote name='hupsilardee' timestamp='1321736791' post='4885706']
Are the cubes axis aligned, like Minecraft?


They're voxels, buddy.
[/quote]

If you read the original post, you might notice the mention of rotation matrices, "buddy".

OP: If they are axis aligned, it would be faster to transform the entire cube around several times, because then you need only apply a translation which is much faster than a matrix multiply. If you are, as I suspect, thinking of rotating a single 2-tri face with combinations of 90 degree rotations to create a cube, this probably will be much slower.


Ben Bowen
Ben Bowen
If you read the original post, you might notice the mention of rotation matrices, "buddy".[/quote]

So there's no point to your question? And, I did read it. Thanks for the -1

EDIT:
Oh, sorry if I sounded like a jerk. I'll keep my head down now.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.