Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Minimeshes, setting matrices without extracting pos & rot  (Read 460 times)
Baiame
Customers
Community Member
*****
Posts: 45


« on: December 21, 2011, 06:55:36 AM »

For the enormous minimeshes in my game, when I use SetPositionArray and SetRotationArray, I get around 150 fps. With SetMatrixArray instead, I get only 70. This was curious, until I found my answer in an unrelated topic:

Whenever you set a matrix, the engine will try to extract scale,rotation and translation from it.

Is there any way to disable this behvaior in Truevision? I'm guessing not but hoping so, because I'll have to jump ship to another engine otherwise. Thanks.
Logged
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #1 on: December 22, 2011, 03:39:33 PM »

Just out of interest, I would think SetPositionArray and SetRotationArray is using SetMatrixArray with the other attributes stripped out, that is just setting what you need, which would be the quickest way. If you need to manipulate minimeshes per each frame, which it seems that you might be, do the manipulation in the shader to keep the fps up.

Also is there an engine out there available to indie developers which is faster at minimesh rendering than TV3D? Which ship would you jump to? just for information,

cheers.
Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
Baiame
Customers
Community Member
*****
Posts: 45


« Reply #2 on: December 28, 2011, 10:02:06 PM »

Sorry it took so long to reply- I forgot I'd posted this topic.

Just out of interest, I would think SetPositionArray and SetRotationArray is using SetMatrixArray with the other attributes stripped out, that is just setting what you need, which would be the quickest way.

To be more specific about my problem, the project is a large-scale 6DOF space shooter. It's fully data-oriented, and I've my own class for representing transformations. Each minimesh is used to render all mesh instances of a single type. So my transforms are passed to Truevision via SetPositionArray & SetRotationArray, or just SetMatrixArray (I'm not using scale yet).

I need to be able to get the up/right/forward vectors of the rotation for each object, of which there are be tens of thousands, possibly several times per frame. Converting from Euler to matrix every time wasn't gonna cut it, so I adapted a quaternion class, and used that in my transforms in lieu of an Euler vector. In theory, this would allow me to store rotations compactly, while letting me retrieve the up/right/forward vectors quickly, and it'd also eliminate any trig function calls when passing my transforms to Truevision (via SetMatrixArray).

In practice, Truevision must infer the Euler rotation from each matrix when you call SetMatrixArray, as per that quote from Sylvian. Makes sense, but it kind of screws me over. Euler angles are totally worthless for this project. Truevision's insistence on making them available all the times must be what's causing the massive performance hit.

If you need to manipulate minimeshes per each frame, which it seems that you might be, do the manipulation in the shader to keep the fps up.

I do need to change the transform of all minimesh instances each frame. Can you please explain what exactly you mean here? I'm new to real-time graphics.

Also is there an engine out there available to indie developers which is faster at minimesh rendering than TV3D? Which ship would you jump to?

There's no such engine that I know of. I'd have to start learning raw DirectX.
Logged
jviper
Community Member
*
Posts: 2130

Discipline in training


« Reply #3 on: January 01, 2012, 01:35:47 PM »

Quote
Quote from: arnienet on 2011-12-22, 15:39:33

If you need to manipulate minimeshes per each frame, which it seems that you might be, do the manipulation in the shader to keep the fps up.

I do need to change the transform of all minimesh instances each frame. Can you please explain what exactly you mean here? I'm new to real-time graphics.

I think you would have to go to GPGPU Programming (General Purpose - Graphics Processing Unit). That's where you write a shader to do massive arithmetic rather then rendering. First you would do your reagular rendering (not doing anything with the minimeshes). Then after that you write a shader that manipulates data. It's a trick, and rather tricky. You would need to look up how to do GPGPU, where you pass data in the form of a texture to a shader, and then output the data to another texture, then write that data out where the minimesh data is in memory.

He could also mean instead of using the built-in minimesh rendering system, use a minimesh shader. Then when you have done that, do your matrix manipulation inside the minimesh shader instead of on the CPU.
Logged

JAbstract.....Don't just imagine, make it happen!
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks