what does 'w' mean in shader assembler

Started by
20 comments, last by Icebone1000 10 years, 10 months ago

it seems to be the fourth component of input register, and D3DDECLTYPE_FLOAT3 sets it to 1

Advertisement

It's the homogeneous coordinate. I would strongly suggest reading more graphics theory before proceeding.

It's the homogeneous coordinate. I would strongly suggest reading more graphics theory before proceeding.

thanks a lot

but i do not agree with your opinion, i am using api, not designing api

but i do not agree with your opinion, i am using api, not designing api

I do not agree with your opinion. Even if you are just using the API, you will have to deal with matrix transformations at some point in your game and you will have to understand what are homogeneous coordinates to do it right.

Even if your API provides a complete math framework, you will have to know how to use it. To know how to use it you will have to learn maths and linear algebra.

Just to reinforce what renega_666 already said: in the context of any graphics programming (and if you have to touch shaders, you are way in), not knowing about homogeneous coordinates is like taking a job as a driver, then get into the car, point at the steering wheel and ask 'What's that?'.

Just to reinforce what renega_666 already said: in the context of any graphics programming (and if you have to touch shaders, you are way in), not knowing about homogeneous coordinates is like taking a job as a driver, then get into the car, point at the steering wheel and ask 'What's that?'.

thanks for the info about 'homogeneous', i only see it in 'D3DFVF_XYZRHW', is there some concrete context 'homogeneous' applies

you and renega_666 misunderstand what i mean, for example, i do not know rsa, but i can use it easily with CryptoAPI, of course rsa is important

you and renega_666 misunderstand what i mean, for example, i do not know rsa, but i can use it easily with CryptoAPI, of course rsa is important

Maybe you can get some result from it, encrypt some strings, but to be able to actually write a secure application, you also need to know some crypto theory to use it properly (know when its actually meaningful to use, make your keys secure, use the right algorithms for setting up sessions, verify they work as intended, etc etc)

Similarly, you need to know a subset of linear algebra, dealing with transformations and projections, to be able to write and debug 3D graphics code.

you and renega_666 misunderstand what i mean, for example, i do not know rsa, but i can use it easily with CryptoAPI, of course rsa is important

And here you misunderstand what we mean. Homogeneous coordinates are not some arcane detail of graphics programming - they are central to it and no one can seriously use a graphics API without knowing about them.

is there some concrete context 'homogeneous' applies

Yes it applies to transforms (translation, projection,...) which are used extensively in every game.

If you don't understand homogeneous coordinate how can you understand perspective projection? If you don't understand perspective projection, how do you setup a camera for your 3D game? Of course you can follow a tutorial/manual without understanding what's happening and have a working 3D camera but whenever you will have to debug or adapt the code you'll be lost.

Linear algebra is something that every game developer should know!

no one can seriously use a graphics API without knowing about [Homogeneous coordinates].

If you don't understand perspective projection, how do you setup a camera for your 3D game? Of course you can follow a tutorial/manual without understanding what's happening...

You just answered that wink.png
I was using GL/D3D for years (and building games/toy-engines with them), just with the knowledge that "'w' is some kind of magic", and that "matricies are some kind of magic" before I got around to learning linear algebra and the theory behind all the computer graphics magic tongue.png

I had an intuitive understanding of how to use vectors/matrices/euler-angles/quaternions/dot-products/cross-products/etc, without knowing anything about how they really worked. In the case of dot and cross, I didn't even know the right terminology, but knew them by their function names in the Half-Life code base, which was something cryptic like vecfma, etc (or "that function that returns 1.0 when two normals are aligned" and "that function that gives you right angles").As long as I had an API, or some code I could copy-paste, I was set laugh.png

Magic.

This topic is closed to new replies.

Advertisement