Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: New shader features? [Re: jcl] #17888
10/07/03 03:08
10/07/03 03:08
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hmm, ok..dont pay any attention on this.. seems to be siilly words i spoke, just saw that thing at an example and got confused, too.


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: New shader features? [Re: ello] #17889
10/07/03 07:43
10/07/03 07:43
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i am not completely sure but i think wolfgang engel's per pixel lighting examples use a transposed world matrix. maybe this would be useful?

Re: New shader features? [Re: jcl] #17890
10/07/03 09:02
10/07/03 09:02
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
I think access to the transformation matrices could make sense in some situations. As game developer I know which objects are fixed and which are not. For a fixed object I need only one time the inverse worldmatrix, in a loop I would transform the eyepositon to objectspace and set them in the entity or material skills which are used as constant values (one calculation per model). In vertexshader the transformation would be calculated for each vertex, which could be expensive depending on the number of vertices.

Re: New shader features? [Re: ventilator] #17891
10/07/03 09:20
10/07/03 09:20
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
As you set the worldmatrix in constants which are vectors of four floats the worldmatrix we get from the engine is already transposed.

Re: New shader features? [Re: mss] #17892
10/07/03 09:27
10/07/03 09:27
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
oh! i see! some of this matrices stuff still confuses me...

Re: New shader features? [Re: ventilator] #17893
10/07/03 17:09
10/07/03 17:09
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
Maybe the following try to explain it could help you.

Code:
  .


Multiply a vector with a Matrix:

M11 M12 M13
[x’ y’ z’] =[x y z] * M21 M22 M23
M31 M32 M33

/////////////////////////////////////////////////////
x’=(x*M11)+(y*M21)+(z*M31)
y’=(x*M12)+(y*M22)+(z*M32)
z’=(x*M13)+(y*M23)+(z*M33)
/////////////////////////////////////////////////////
the Matrix set as it is in constants:

c0=(M11,M12,M13)
c1=(M21,M22,M23)
c3=(M31,M32,M33)
/////////////////////////////////////////////////////////
would not lead to the expected solution in the dot product:

x’=(x*M11)+(y*M12)+(z*M13)
y’=(x*M21)+(y*M22)+(z*M23)
z’=(x*M31)+(y*M32)+(z*M33)
/////////////////////////////////////////////////////
Transposing a Matrix means to exchange the rows with the columns:

M11 M12 M13 M11 M21 M31
A = M21 M22 M23 A transposed = M12 M22 M32
M31 M32 M33 M13 M23 M33
//////////////////////////////////////////////////////////////////////////////////
Set the transposed Matrix in constants:

c0=(M11,M21,M31)
c1=(M12,M22,M32)
c2=(M13,M23,M33)
//////////////////////////////////////////////////////////////////////////////////
Now we have the same result as multiplication a vector with a matrix.

x’=(x*M11)+(y*M21)+(z*M31)
y’=(x*M12)+(y*M22)+(z*M32)
z’=(x*M13)+(y*M23)+(z*M33)



This explanation is not perfect, but I think it could be helpful.

The stuff is more confusing, if you don’t know how Direct3D deals with those matrices and in a tutorial this is required like in the tuts from Wolfgang Engel.



Re: New shader features? [Re: jcl] #17894
10/07/03 18:24
10/07/03 18:24
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
Some information from the D3DCaps8 structure would be useful, like the shader versions and max simultaneous texture.

Re: New shader features? [Re: jcl] #17895
10/08/03 15:48
10/08/03 15:48
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
its me again. i found the use of a cv_color(maybe that is a colorvector) in the toonshading example of the NVeffectsbrowser.

and i came across many times the "eyepoint" - what vector is that?


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: New shader features? [Re: ello] #17896
10/08/03 16:15
10/08/03 16:15
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
mss, thanks for the explanation!

...
i guess the eyepoint is the view position. you can get it from the worldview matrix.

VertexShaderConstant[8]=<matWorldView>;
c10 is the view position then. (i guess in modelspace)

Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1