Optimization..
Quake 3 sends 4 floats for each vertex, x, y, z, w. They do this because it gets proper alignment then.. Does this matter THAT much?
osu!
I don''t thinks so, this alignment can even cause stalls (or whats the name).
This will slow down your program...
I must confess - I really don''t have a clue what''s the w is for. A fourth dimension? whoooaah....
Interresting
This will slow down your program...
I must confess - I really don''t have a clue what''s the w is for. A fourth dimension? whoooaah....
Interresting
x,y,z and w are the component names of vectors/points if you use homogeneous transformations. This way you can use a 4x4 matrix to represent rotations, translations, scale, shear, perspective projections and so on (all linear operations). It mainly simplifies your gfx pipeline.
In a plan update Caramc states that he uses 4 components to have room for optimizations for simd cpu architectures (isse alias katmai or 3dnow! or altivec).
Nevertheless to get maximum performance on geforce cards you only send x,y, and z to the card (in a vertex array).
So or so in a well designed oop program you can insert a fourth component to your vertex class without any side effects - so you can try later if you get a better performance.
Bjoern
In a plan update Caramc states that he uses 4 components to have room for optimizations for simd cpu architectures (isse alias katmai or 3dnow! or altivec).
Nevertheless to get maximum performance on geforce cards you only send x,y, and z to the card (in a vertex array).
So or so in a well designed oop program you can insert a fourth component to your vertex class without any side effects - so you can try later if you get a better performance.
Bjoern
GOOD GOD YES!
4*4 -> 32byte alignment
It takes LONGER to move 24bytes, because processors have commands built-in to move 128bits & 256bits at a time (MMX stuff)
So to move 24bytes it takes two operatations A 128move & a 64bit move. It also takes more microcode (the procedures that the processors use to execute op codes) instructions to do the byte alignment on non-32 byte boundries.
Also all modern 3D graphics pipelines use affine space, which is represented by 4x4 matrices & 4 value vectors. In certain cases the "w" value matters, in some cases not. If the w is 0 it means the vector really is a vector, if w is 1 it means the vector really is a point. This will determine whether or not the translation portion of an affine transformation matrix will be applied to the vector or not.
-Magmai Kai Holmlor
I am brazen and fear no flames.
(So long as I don't lose this Ring of Fire Protection +5)
Edited by - Magmai Kai Holmlor on July 9, 2000 5:36:40 PM
4*4 -> 32byte alignment
It takes LONGER to move 24bytes, because processors have commands built-in to move 128bits & 256bits at a time (MMX stuff)
So to move 24bytes it takes two operatations A 128move & a 64bit move. It also takes more microcode (the procedures that the processors use to execute op codes) instructions to do the byte alignment on non-32 byte boundries.
Also all modern 3D graphics pipelines use affine space, which is represented by 4x4 matrices & 4 value vectors. In certain cases the "w" value matters, in some cases not. If the w is 0 it means the vector really is a vector, if w is 1 it means the vector really is a point. This will determine whether or not the translation portion of an affine transformation matrix will be applied to the vector or not.
-Magmai Kai Holmlor
I am brazen and fear no flames.
(So long as I don't lose this Ring of Fire Protection +5)
Edited by - Magmai Kai Holmlor on July 9, 2000 5:36:40 PM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
In other words: if the fourth coordinate is 0, the point is situated behind another polygon (so, being invisible to the player anyway), and can be omitted when calculating the next frame. BTW, in math, if your working with n+1 coordinates for a n-dimensional space, the last coordinate is used to express whether or not the actual point is situated in the infinite (0 is in the infinite, 1 in the finite).
HTH
Edited by - Koen Vossen on July 13, 2000 9:09:06 PM
HTH
Edited by - Koen Vossen on July 13, 2000 9:09:06 PM
Fear Is Your Only God
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement