You can subscribe to this list here.
2000 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(390) 
_{Aug}
(767) 
_{Sep}
(940) 
_{Oct}
(964) 
_{Nov}
(819) 
_{Dec}
(762) 

2001 
_{Jan}
(680) 
_{Feb}
(1075) 
_{Mar}
(954) 
_{Apr}
(595) 
_{May}
(725) 
_{Jun}
(868) 
_{Jul}
(678) 
_{Aug}
(785) 
_{Sep}
(410) 
_{Oct}
(395) 
_{Nov}
(374) 
_{Dec}
(419) 
2002 
_{Jan}
(699) 
_{Feb}
(501) 
_{Mar}
(311) 
_{Apr}
(334) 
_{May}
(501) 
_{Jun}
(507) 
_{Jul}
(441) 
_{Aug}
(395) 
_{Sep}
(540) 
_{Oct}
(416) 
_{Nov}
(369) 
_{Dec}
(373) 
2003 
_{Jan}
(514) 
_{Feb}
(488) 
_{Mar}
(396) 
_{Apr}
(624) 
_{May}
(590) 
_{Jun}
(562) 
_{Jul}
(546) 
_{Aug}
(463) 
_{Sep}
(389) 
_{Oct}
(399) 
_{Nov}
(333) 
_{Dec}
(449) 
2004 
_{Jan}
(317) 
_{Feb}
(395) 
_{Mar}
(136) 
_{Apr}
(338) 
_{May}
(488) 
_{Jun}
(306) 
_{Jul}
(266) 
_{Aug}
(424) 
_{Sep}
(502) 
_{Oct}
(170) 
_{Nov}
(170) 
_{Dec}
(134) 
2005 
_{Jan}
(249) 
_{Feb}
(109) 
_{Mar}
(119) 
_{Apr}
(282) 
_{May}
(82) 
_{Jun}
(113) 
_{Jul}
(56) 
_{Aug}
(160) 
_{Sep}
(89) 
_{Oct}
(98) 
_{Nov}
(237) 
_{Dec}
(297) 
2006 
_{Jan}
(151) 
_{Feb}
(250) 
_{Mar}
(222) 
_{Apr}
(147) 
_{May}
(266) 
_{Jun}
(313) 
_{Jul}
(367) 
_{Aug}
(135) 
_{Sep}
(108) 
_{Oct}
(110) 
_{Nov}
(220) 
_{Dec}
(47) 
2007 
_{Jan}
(133) 
_{Feb}
(144) 
_{Mar}
(247) 
_{Apr}
(191) 
_{May}
(191) 
_{Jun}
(171) 
_{Jul}
(160) 
_{Aug}
(51) 
_{Sep}
(125) 
_{Oct}
(115) 
_{Nov}
(78) 
_{Dec}
(67) 
2008 
_{Jan}
(165) 
_{Feb}
(37) 
_{Mar}
(130) 
_{Apr}
(111) 
_{May}
(91) 
_{Jun}
(142) 
_{Jul}
(54) 
_{Aug}
(104) 
_{Sep}
(89) 
_{Oct}
(87) 
_{Nov}
(44) 
_{Dec}
(54) 
2009 
_{Jan}
(283) 
_{Feb}
(113) 
_{Mar}
(154) 
_{Apr}
(395) 
_{May}
(62) 
_{Jun}
(48) 
_{Jul}
(52) 
_{Aug}
(54) 
_{Sep}
(131) 
_{Oct}
(29) 
_{Nov}
(32) 
_{Dec}
(37) 
2010 
_{Jan}
(34) 
_{Feb}
(36) 
_{Mar}
(40) 
_{Apr}
(23) 
_{May}
(38) 
_{Jun}
(34) 
_{Jul}
(36) 
_{Aug}
(27) 
_{Sep}
(9) 
_{Oct}
(18) 
_{Nov}
(25) 
_{Dec}

2011 
_{Jan}
(1) 
_{Feb}
(14) 
_{Mar}
(1) 
_{Apr}
(5) 
_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}
(37) 
_{Sep}
(6) 
_{Oct}
(2) 
_{Nov}

_{Dec}

2012 
_{Jan}

_{Feb}
(7) 
_{Mar}

_{Apr}
(4) 
_{May}

_{Jun}
(3) 
_{Jul}

_{Aug}

_{Sep}
(1) 
_{Oct}

_{Nov}

_{Dec}
(10) 
2013 
_{Jan}

_{Feb}
(1) 
_{Mar}
(7) 
_{Apr}
(2) 
_{May}

_{Jun}

_{Jul}
(9) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2014 
_{Jan}
(14) 
_{Feb}

_{Mar}
(2) 
_{Apr}

_{May}
(10) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}
(3) 
_{Dec}

S  M  T  W  T  F  S 






1
(13) 
2
(10) 
3
(5) 
4
(20) 
5
(34) 
6
(16) 
7
(35) 
8
(19) 
9
(3) 
10
(2) 
11
(17) 
12
(16) 
13
(2) 
14

15
(1) 
16

17

18
(13) 
19
(21) 
20
(7) 
21
(4) 
22
(5) 
23
(1) 
24

25

26
(1) 
27

28
(7) 
29
(20) 
30
(10) 
From: Bill Baxter <wbaxter@gm...>  20050430 23:47:15

Does anyone know an algorithm for determining the rigid body transformation= =20 that best fits the motion of a set of N points? I.e. given a set of initial points p0 p1 ... pN, and their locations after= =20 some motion, q0 q1 ... qN, I want to find the rigid body transformation T(x= )=20 (rotation and translation only) that minimizes: Sum[i=3D0...N] (  T(pi)  qi ^2 ) The only thing I can think of is to treat it as a generic nonlinear=20 optimization problem, but it just seems like there should be something more= =20 efficient than that. =20 Bill 
From: Brian Hook <hook_l@bo...>  20050430 19:28:00

Thread necromancy at work! I read Hwa's paper, but I'm a little confused with some of the stuff in there to do with the diamond topology. In Fig 4 of the revised IEEE paper, the ancestors are labeled a0 to a3. a0 is the ancestor quad tree, a1/a2 are the immediate parents, but what is a2? It's not clear from the diagram what that's supposed to be. > You should also check out the BDAM papers by Cignoni and his group. How would you contrast the PBDAM stuff with Hwa's work? Brian 
From: metanet software <metanet_gda4@ya...>  20050430 17:23:03

hi, your tutorials are helpful, however.. it seems that you always end up with a vertexedge contact (i.e a single contact point). do you have any suggestions for how to handle edgeedge cases, where there are two contact points? (i.e when there are two colinear edges on the convex hull) i've tried "fixing" this in the MDconstruction phase (detecting parallel edges there and making a single MD edge instead of two colinear ones), and in the calculatepenetration phase, however none of the stuff i've tried thus far has been as simple, nice, and wellbehaved as the vertexedge stuff (which works every time). thanks, raigan  Paul_Firth@... wrote: > On 12/04/2005 09:26:30 gdalgorithmslistadmin > wrote: > > >Hello again, > > > > could you please outline the algorithm to > construct the minkowski sum of > two 2D > > polygons in linear time? > > Sure, its outlined roughly here > http://www.pfirth.co.uk/collision.html (at > the bottom of the page)... > > It relies on having a constant cost support mapping. > > In overview, for two polygons A and B: > > step around edges of A > { > finding supporting vertex in B of current > edge, > construct MD edge > } > > step around edges of B > { > find supporting vertex in A of current edge, > construct MD edge > } > > done! > > Cheers, Paul. > > ********************************************************************** > This email and any files transmitted with it are > confidential and > intended solely for the use of the individual or > entity to whom they > are addressed. If you have received this email in > error please notify > postmaster@... > > This footnote also confirms that this email message > has been checked > for all known viruses. > > ********************************************************************** > Sony Computer Entertainment Europe > > > >  > SF email is sponsored by  The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca 
From: Yordan Gyurchev <yg@gy...>  20050430 16:14:42

Hi, I'm not even sure this is the right term for these. In general what I'm talking about is data structures like trees, graphs (or anything that contains pointers to other items in the structure) that store instead of pointers indices relative to some base pointer (usually the pointer of the data structure itself). I'm sure everyone is familiar with those or some form of the idiom... This has for me direct application into concurrency algorithms (nextgen) especially where separate processors/cores have local "faster" memory. Complex structures can be moved from point A (main memory) to point B (local memory) and back without much hassle. What I'm after is the name for this kind of thing? Popular name, academic name... Then if available books, academic studies, etc. Someone probably researched this area in depth... Thanks, Yordan 
From: <c.schueler@ph...>  20050430 11:25:15

Certainly doable, even today :) I have an atmosphere model in a game environment here: http://www.4players.de/4players.php/spielinfo/PCCDROM/4180/Spellforce_2.= html It seems to be very similar to the Onimusha approach, without the = zbuffer thing. The sky texture is calculated per CPU every once in a while. If the Mie excentricity (g) is < 0.8, there's no need for a hi res = texture, so no memory problem. The transmittance term can easily be per vertex or per object. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Wolfgang Engel Sent: Saturday, April 30, 2005 1:39 AM To: gdalgorithmslist@... Subject: Re: [Algorithms] Sky gradients  vertex or pixel shaded? The advantage is, that it does not eat up texture memory ... so might be = a good option for upcoming consoles.  Wolf gdalgorithmslist@... schrieb am 30.04.05 00:49:16: >=20 > It's pretty expensive, and in the general case what it gives you could > be done through simpler/morecontrollable means like a lookup table. >=20 > The "cool looking" stuff, like the big sun effects around the horizon, > are actually really hard to control and make do what you want in a = "real=20 > game" scenario.=20 >=20 >=20 > Jason Rooks wrote: >=20 > > My question is why hasn't anyone expanded on Naty Hoffman's work=20 > > yet? > > I haven't seen anyone have close to as good a sky and its been 3 = years! > > slides: > > http://www.gdconf.com/archives/2002/naty_hoffman.ppt > > paper: > > http://www.ati.com/developer/dx9/ATILightScattering.pdf > > code and binaries: > > http://www.gdmag.com/src/aug02.zip > > > > Jason Rooks > > > > > > > > > >  > > This SF.Net email is sponsored by: NEC IT Guy Games. > > Get your fingers limbered up and give it your best shot. 4 great > > events, 4 > > opportunities to win big! Highest score wins.NEC IT Guy Games. Play = to > > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > > >=20 >=20 >=20 >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great=20 > events, 4 opportunities to win big! Highest score wins.NEC IT Guy=20 > Games. Play to win an NEC 61 plasma display. Visit=20 > http://www.necitguy.com/?r=3D20=20 > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 =A0 Wolfgang=A0F.=A0Engel 
From: Ben Garney <beng@ga...>  20050430 02:08:49

Jonathan Blow wrote: > Well it depends on what you consider fast or slow. I did implement > pretty much the vanilla technique (running the math, not lookup > tables) as the generalized fog mechanism in my last project. It was > okay, and not too big a chunk of my 110instruction pixel shader. So > if you can live with pixel shaders in that size range, it's fine. > There are definitely people who can live with that right this second, > so saying it's "a generation off" is excessive. I tend to assume a crappy ps1.4capable system as my baseline. :) But you're right, there are situations where this can be pretty workable, especially for demos or high end systems. > My beef though is that for as much as it costs, it is actually not > that good in terms of visual impact  there is better / > morecontrollable stuff that you could do, that is cheaper. Right, exactly. I think that the technique can give some pretty impressive results, but only at a higher cost  ie, when you start modelling stuff like varying atmospheric density and throw it on even a barebone heightfield, it looks pretty darn good IMHO. Even your city looks a lot better with the addition of the effect. It's a subtle thing but I think it helps sell the realism of a scene more so than simple fog can usually do... Ben 
From: Jonathan Blow <jon@nu...>  20050430 01:29:54

Well it depends on what you consider fast or slow. I did implement pretty much the vanilla technique (running the math, not lookup tables) as the generalized fog mechanism in my last project. It was okay, and not too big a chunk of my 110instruction pixel shader. So if you can live with pixel shaders in that size range, it's fine. There are definitely people who can live with that right this second, so saying it's "a generation off" is excessive. My beef though is that for as much as it costs, it is actually not that good in terms of visual impact  there is better / morecontrollable stuff that you could do, that is cheaper. Ben Garney wrote: > You can do a REALLY nice atmospheric scattering model in about 3 TU's > and a nottoobig VS/PS. Of course, that's gonna leave you not very > much in the way of resources for the rest of your scene, cuz for > things to look right you have to apply it over the whole scene... > > Or you could do the effect via a deferred shading technique, but you'd > have to read back the depth info per pixel to apply the effect, which > is also a bit costly. And unlike glow or refraction, you pretty much > have to do it per pixel for it to look right, which raises the cost > yet more... > > Or you could simplify the effect, dropping TU's, but it's still a big > chunk of math in the vertex and pixel shaders... > > I think this is still a generation off for general use (ie as a > replacement for the generic fog model) although in specific situations > it can be done quite well. > > Ben > > Jonathan Blow wrote: > >> It's pretty expensive, and in the general case what it gives you >> could be done through simpler/morecontrollable means like a lookup >> table. >> >> The "cool looking" stuff, like the big sun effects around the >> horizon, are actually really hard to control and make do what you >> want in a "real game" scenario. >> >> Jason Rooks wrote: >> >>> My question is why hasn't anyone expanded on Naty Hoffman's work >>> yet? I haven't seen anyone have close to as good a sky and its been >>> 3 years! >>> slides: >>> http://www.gdconf.com/archives/2002/naty_hoffman.ppt >>> paper: >>> http://www.ati.com/developer/dx9/ATILightScattering.pdf >>> code and binaries: >>> http://www.gdmag.com/src/aug02.zip >>> >>> Jason Rooks >>> >>> >>> >>> >>>  >>> This SF.Net email is sponsored by: NEC IT Guy Games. >>> Get your fingers limbered up and give it your best shot. 4 great >>> events, 4 >>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to >>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 >>> _______________________________________________ >>> GDAlgorithmslist mailing list >>> GDAlgorithmslist@... >>> https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_id=6188 >>> >> >> >> >>  >> This SF.Net email is sponsored by: NEC IT Guy Games. >> Get your fingers limbered up and give it your best shot. 4 great >> events, 4 >> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to >> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 >> _______________________________________________ >> GDAlgorithmslist mailing list >> GDAlgorithmslist@... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=6188 >> > > > >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great > events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > 
From: Ben Garney <beng@ga...>  20050430 01:20:41

You can do a REALLY nice atmospheric scattering model in about 3 TU's and a nottoobig VS/PS. Of course, that's gonna leave you not very much in the way of resources for the rest of your scene, cuz for things to look right you have to apply it over the whole scene... Or you could do the effect via a deferred shading technique, but you'd have to read back the depth info per pixel to apply the effect, which is also a bit costly. And unlike glow or refraction, you pretty much have to do it per pixel for it to look right, which raises the cost yet more... Or you could simplify the effect, dropping TU's, but it's still a big chunk of math in the vertex and pixel shaders... I think this is still a generation off for general use (ie as a replacement for the generic fog model) although in specific situations it can be done quite well. Ben Jonathan Blow wrote: > It's pretty expensive, and in the general case what it gives you could > be done through simpler/morecontrollable means like a lookup table. > > The "cool looking" stuff, like the big sun effects around the horizon, > are actually really hard to control and make do what you want in a > "real game" scenario. > > Jason Rooks wrote: > >> My question is why hasn't anyone expanded on Naty Hoffman's work >> yet? I haven't seen anyone have close to as good a sky and its been >> 3 years! >> slides: >> http://www.gdconf.com/archives/2002/naty_hoffman.ppt >> paper: >> http://www.ati.com/developer/dx9/ATILightScattering.pdf >> code and binaries: >> http://www.gdmag.com/src/aug02.zip >> >> Jason Rooks >> >> >> >> >>  >> This SF.Net email is sponsored by: NEC IT Guy Games. >> Get your fingers limbered up and give it your best shot. 4 great >> events, 4 >> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to >> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 >> _______________________________________________ >> GDAlgorithmslist mailing list >> GDAlgorithmslist@... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=6188 >> > > > >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great > events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > 
From: <christer_ericson@pl...>  20050430 00:53:22

Greg Seegert wrote: > There was a GDC session in 2004 where Thomas Engel talked about implementing > this on the Game Cube. I believe it was for Star Wars: Rebel Strike. He > gave a pretty thorough list of the pros and cons. I can't find the slides, > but the title was, "Light Scattering: Oh, that Looks Cool! Can we Have it in > the Game, Real Quick?" There's also a description here http://www.watch.impress.co.jp/game/docs/20030916/oni3_2.htm on how light scattering was implemented in Onimusha 3 on the PS2. The text is in Japanese, but the pertinent slide is in English. Christer Ericson http://realtimecollisiondetection.net/ 
From: Greg Seegert <greg@st...>  20050430 00:24:35

There was a GDC session in 2004 where Thomas Engel talked about implement= ing this on the Game Cube. I believe it was for Star Wars: Rebel Strike. He gave a pretty thorough list of the pros and cons. I can't find the slide= s, but the title was, "Light Scattering: Oh, that Looks Cool! Can we Have it= in the Game, Real Quick?" > Original Message > From: gdalgorithmslistadmin@... > [mailto:gdalgorithmslistadmin@...]On Behalf Of > Wolfgang Engel > Sent: Friday, April 29, 2005 7:39 PM > To: gdalgorithmslist@... > Subject: Re: [Algorithms] Sky gradients  vertex or pixel shaded? > > > The advantage is, that it does not eat up texture memory ... so > might be a good option for upcoming consoles. > >  Wolf > > gdalgorithmslist@... schrieb am 30.04.05 00:49:16: > > > > It's pretty expensive, and in the general case what it gives you coul= d > > be done through simpler/morecontrollable means like a lookup table. > > > > The "cool looking" stuff, like the big sun effects around the horizon= , > > are actually really hard to control and make do what you want > in a "real > > game" scenario. > > > > > > Jason Rooks wrote: > > > > > My question is why hasn't anyone expanded on Naty Hoffman's > work yet? > > > I haven't seen anyone have close to as good a sky and its > been 3 years! > > > slides: > > > http://www.gdconf.com/archives/2002/naty_hoffman.ppt > > > paper: > > > http://www.ati.com/developer/dx9/ATILightScattering.pdf > > > code and binaries: > > > http://www.gdmag.com/src/aug02.zip > > > > > > Jason Rooks > > > > > > > > > > > > > > >  > > > This SF.Net email is sponsored by: NEC IT Guy Games. > > > Get your fingers limbered up and give it your best shot. 4 great > > > events, 4 > > > opportunities to win big! Highest score wins.NEC IT Guy Games. Play= to > > > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > > > _______________________________________________ > > > GDAlgorithmslist mailing list > > > GDAlgorithmslist@... > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > > > > > > > > > > >  > > This SF.Net email is sponsored by: NEC IT Guy Games. > > Get your fingers limbered up and give it your best shot. 4 > great events, 4 > > opportunities to win big! Highest score wins.NEC IT Guy Games. Play t= o > > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > > _______________________________________________ > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > > =A0 > Wolfgang=A0F.=A0Engel > > > >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events= , 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_ida88 > 
From: Wolfgang Engel <wolfgang.engel@we...>  20050429 23:39:26

The advantage is, that it does not eat up texture memory ... so might be a= good option for upcoming consoles.  Wolf gdalgorithmslist@... schrieb am 30.04.05 00:49:16: >=20 > It's pretty expensive, and in the general case what it gives you could=20 > be done through simpler/morecontrollable means like a lookup table. >=20 > The "cool looking" stuff, like the big sun effects around the horizon,=20 > are actually really hard to control and make do what you want in a "real= =20 > game" scenario.=20 >=20 >=20 > Jason Rooks wrote: >=20 > > My question is why hasn't anyone expanded on Naty Hoffman's work yet=3F = =20 > > I haven't seen anyone have close to as good a sky and its been 3 years= ! > > slides: > > http://www.gdconf.com/archives/2002/naty=5Fhoffman.ppt > > paper: > > http://www.ati.com/developer/dx9/ATILightScattering.pdf > > code and binaries: > > http://www.gdmag.com/src/aug02.zip > > > > Jason Rooks > > > > > > > > > >  > > This SF.Net email is sponsored by: NEC IT Guy Games. > > Get your fingers limbered up and give it your best shot. 4 great=20 > > events, 4 > > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to= > > win an NEC 61 plasma display. Visit http://www.necitguy.com/=3Fr=3D20 > > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > > GDAlgorithmslist mailing list > > GDAlgorithmslist@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > > Archives: > > http://sourceforge.net/mailarchive/forum.php=3Fforum=5Fid=3D6188 > > >=20 >=20 >=20 >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events,= 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/=3Fr=3D20 > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php=3Fforum=5Fid=3D6188 =A0 Wolfgang=A0F.=A0Engel 
From: Jonathan Blow <jon@nu...>  20050429 22:47:12

It's pretty expensive, and in the general case what it gives you could be done through simpler/morecontrollable means like a lookup table. The "cool looking" stuff, like the big sun effects around the horizon, are actually really hard to control and make do what you want in a "real game" scenario. Jason Rooks wrote: > My question is why hasn't anyone expanded on Naty Hoffman's work yet? > I haven't seen anyone have close to as good a sky and its been 3 years! > slides: > http://www.gdconf.com/archives/2002/naty_hoffman.ppt > paper: > http://www.ati.com/developer/dx9/ATILightScattering.pdf > code and binaries: > http://www.gdmag.com/src/aug02.zip > > Jason Rooks > > > > >  > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great > events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > 
From: Jason Rooks <jasonrookslist@ho...>  20050429 20:25:18

My question is why hasn't anyone expanded on Naty Hoffman's work yet? I haven't seen anyone have close to as good a sky and its been 3 years! slides: http://www.gdconf.com/archives/2002/naty_hoffman.ppt paper: http://www.ati.com/developer/dx9/ATILightScattering.pdf code and binaries: http://www.gdmag.com/src/aug02.zip Jason Rooks 
From: Jarkko Lempiainen <Jarkko.L<empiainen@ub...>  20050429 19:17:15

I did basically the same but went to the final formula by: q=3D[qv, w] v'=3D2((qv.v)qv  (qv.qv)v + w(qv x v)) + v by using the triple product again: :(a.c)b  (a.b)c =3D a x (b x c), a=3Db=3Dqv, c=3Dv v'=3D2(qv x (qv x v) + w(qv x v))+v :a x b + a x c =3D a x (b + c) v'=3D2(qv x (qv x v) + (qv x wv))+v v'=3D2(qv x (qv x v + wv)) + v Was a good way to refresh the dusted vector math part of my brain again = ;) Jarkko Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: April 29, 2005 2:47 PM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader Ok, knowing what the final result was supposed to be I managed to derive = it from my original expression. Funny how much easier it is when you = know what you're supposed to end up with :) Here's the derivation for anyone who's interested: Multiplication of two quaternions: Qr =3D Q1.Q2 =3D ( w1.w2  v1.v2, w1.v2 + w2.v1 + v1 x v2 ) where v1 =3D (x,y,z) of Q1 w1 =3D (w) of Q1 v2 =3D (x,y,z) of Q2 w2 =3D (w) of Q2 and both . and x are the standard vector dot and cross products. Rotate a vector by a quaternion: v' =3D q.v.q* I'd already expanded this through to get: v' =3D (s.v)s + w(wv + s x v) + s x (wv + s x v) Where s is the vector part of the quaternion and w is the scalar part (q = =3D (w, s)) Expanding this out further gives: v' =3D (s.v)s + (w^2)v + 2w(s x v) + s x (s x v) The cunning trick which I hadn't spotted before is then to use the = vector triple product identity: a x (b x c) =3D b(a.c)  c(a.b) To give v' + s(s.v)  v(s.s) =3D (s.v)s + (w^2)v + 2w(s x v) + 2(s x (s x v)) Cancelling to: v' =3D (w^2 + s.s)v + 2(s x (s x v + wv)) From the definition of a quaternion representing a rotation, w =3D = cos(a/2), s =3D sin(a/2)*r where r is a unit vector representing the = axis of the rotation. So (w^2 + s.s) =3D (cos(a/2))^2 + (sin(a/2))^2 =3D = 1, giving us the final formula: v' =3D v + 2(s x (s x v + vw)) Neat :) Thanks, Matt. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Friday, April 29, 2005 11:12 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader Cool, that works if I change the  Q.w * x to + Q.w * x. Now I just have = to try and figure out how it works :) Thanks a lot, I was beginning to think it wasn't possible to get it down = to 6 instructions after playing around with it for quite a while = yesterday.=20 Matt. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Christian Sch=FCler Sent: Friday, April 29, 2005 2:16 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader off the top of my head, try this x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) if it doesnt work, try changing  with + or reverse the cross prod = arguments. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Thursday, April 28, 2005 11:59 PM To: gdalgorithmslist@... Subject: [Algorithms] Fastest way to rotate a vector by a quaternion in = a shader Looking through the list archives I came across this snippet from Jarkko = Lempiainen regarding rotating a vector by a quaternion in a shader: "Yeah, last time I checked rotating a vector with a quaternion was total = of 6 instructions, which is the same as your 2*crossprod + 2 mads I = guess" I've been playing around with the definitions for quaternion = multiplication and rotating a vector by a quaternion and the best I've = been able to do is 8 instructions. Can anyone enlighten me on how it's = done in 6? Bonus points for a derivation I can follow :) This was my = best effort: Multiplication of two quaternions: Qr =3D Q1.Q2 =3D ( w1.w2  v1.v2, w1.v2 + w2.v1 + v1 x v2 ) where v1 =3D (x,y,z) of Q1 w1 =3D (w) of Q1 v2 =3D (x,y,z) of Q2 w2 =3D (w) of Q2 and both . and x are the standard vector dot and cross products. Rotate a vector by a quaternion: v' =3D q.v.q* Expanding this out and simplifying as best I could I got this down to = the following hlsl: float3 RotateVectorByQuaternion(float3 v, float4 q) { float3 vq =3D q.xyz; float3 vqcrossv =3D cross(vq, v); float3 wvplusvqcrossv =3D q.w * v + vqcrossv; float3 vqcrosswvplusvqcrossv =3D cross(vq, wvplusvqcrossv); float3 res =3D q.w * wvplusvqcrossv + vqcrosswvplusvqcrossv; res =3D dot(vq, v) * vq + res; return res; } Which works out to 8 clocks (2 cross products =3D 4 clocks, 1 dot = product, 3 mads). What's the secret of getting this down to 6? Thanks, Matt.  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, = 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to = win an NEC 61 plasma display. Visit http://www.necitguy.com/?r = _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, = 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to = win an NEC 61 plasma display. Visit http://www.necitguy.com/?r = _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: Newport, Matthew <mnewport@ea...>  20050429 18:47:10

Ok, knowing what the final result was supposed to be I managed to derive = it from my original expression. Funny how much easier it is when you = know what you're supposed to end up with :) Here's the derivation for anyone who's interested: Multiplication of two quaternions: Qr =3D Q1.Q2 =3D ( w1.w2  v1.v2, w1.v2 + w2.v1 + v1 x v2 ) where v1 =3D (x,y,z) of Q1 w1 =3D (w) of Q1 v2 =3D (x,y,z) of Q2 w2 =3D (w) of Q2 and both . and x are the standard vector dot and cross products. Rotate a vector by a quaternion: v' =3D q.v.q* I'd already expanded this through to get: v' =3D (s.v)s + w(wv + s x v) + s x (wv + s x v) Where s is the vector part of the quaternion and w is the scalar part (q = =3D (w, s)) Expanding this out further gives: v' =3D (s.v)s + (w^2)v + 2w(s x v) + s x (s x v) The cunning trick which I hadn't spotted before is then to use the = vector triple product identity: a x (b x c) =3D b(a.c)  c(a.b) To give v' + s(s.v)  v(s.s) =3D (s.v)s + (w^2)v + 2w(s x v) + 2(s x (s x v)) Cancelling to: v' =3D (w^2 + s.s)v + 2(s x (s x v + wv)) From the definition of a quaternion representing a rotation, w =3D = cos(a/2), s =3D sin(a/2)*r where r is a unit vector representing the = axis of the rotation. So (w^2 + s.s) =3D (cos(a/2))^2 + (sin(a/2))^2 =3D = 1, giving us the final formula: v' =3D v + 2(s x (s x v + vw)) Neat :) Thanks, Matt. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Friday, April 29, 2005 11:12 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader Cool, that works if I change the  Q.w * x to + Q.w * x. Now I just have = to try and figure out how it works :) Thanks a lot, I was beginning to think it wasn't possible to get it down = to 6 instructions after playing around with it for quite a while = yesterday.=20 Matt. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Christian Sch=FCler Sent: Friday, April 29, 2005 2:16 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader off the top of my head, try this x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) if it doesnt work, try changing  with + or reverse the cross prod = arguments. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Thursday, April 28, 2005 11:59 PM To: gdalgorithmslist@... Subject: [Algorithms] Fastest way to rotate a vector by a quaternion in = a shader Looking through the list archives I came across this snippet from Jarkko = Lempiainen regarding rotating a vector by a quaternion in a shader: "Yeah, last time I checked rotating a vector with a quaternion was total = of 6 instructions, which is the same as your 2*crossprod + 2 mads I = guess" I've been playing around with the definitions for quaternion = multiplication and rotating a vector by a quaternion and the best I've = been able to do is 8 instructions. Can anyone enlighten me on how it's = done in 6? Bonus points for a derivation I can follow :) This was my = best effort: Multiplication of two quaternions: Qr =3D Q1.Q2 =3D ( w1.w2  v1.v2, w1.v2 + w2.v1 + v1 x v2 ) where v1 =3D (x,y,z) of Q1 w1 =3D (w) of Q1 v2 =3D (x,y,z) of Q2 w2 =3D (w) of Q2 and both . and x are the standard vector dot and cross products. Rotate a vector by a quaternion: v' =3D q.v.q* Expanding this out and simplifying as best I could I got this down to = the following hlsl: float3 RotateVectorByQuaternion(float3 v, float4 q) { float3 vq =3D q.xyz; float3 vqcrossv =3D cross(vq, v); float3 wvplusvqcrossv =3D q.w * v + vqcrossv; float3 vqcrosswvplusvqcrossv =3D cross(vq, wvplusvqcrossv); float3 res =3D q.w * wvplusvqcrossv + vqcrosswvplusvqcrossv; res =3D dot(vq, v) * vq + res; return res; } Which works out to 8 clocks (2 cross products =3D 4 clocks, 1 dot = product, 3 mads). What's the secret of getting this down to 6? Thanks, Matt.  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, = 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to = win an NEC 61 plasma display. Visit http://www.necitguy.com/?r = _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: <c.schueler@ph...>  20050429 18:29:43

I did the Q*v*Q~ expansion in geometric algebra, a long time back, and = buried the result some .h file somewhere. I could have a look if I find = the original derivation and post it later. My quaternions are "GA"quaternions, not Hamiltonians. This explains the different sign :) Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Friday, April 29, 2005 8:03 PM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader I actually reached exactly the same result by manipulation of my = original version on further investigation yesterday. My orignal version = (presented more compactly than in my original email) was: float3 RotateVectorByQuaternion(float3 v, float4 q) { float3 wv_plus_qcrossv =3D q.w * v + cross(q.xyz, v); return dot(q.xyz, v) * q.xyz + (q.w * wv_plus_qcrossv + cross(q.xyz, wv_plus_qcrossv)); } Which compiles down to 8 instructions. My version of the routine you = give below was this: float3 RotateVectorByQuaternion2(float3 v, float4 q) { return 2 * (dot(q.xyz, v) * q.xyz + (q.w * q.w  0.5) * v + q.w * cross(q.xyz, v)); } Which compiles to 9 instructions but has a scalar operation which some = hardware may be able to do in parallel with one of the vector ops so = it's probably the same speed.=20 Your original derivation is a lot simpler than the working I went = through to get the second routine though :) Thanks, Matt. Original Message From: gdalgorithmslistadmin@... [mailto:gdalgorithmslistadmin@...] On Behalf Of = Willem de Boer Sent: Friday, April 29, 2005 5:14 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader Hi, > off the top of my head, try this >=20 > x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) >=20 After some mulling over the result I previously obtained, I arrived at = the following routine for rotating a vector v by a unit quaternion q: float3 RotateVector3ByQuaternion( float3 v, float4 q ) { w =3D q.xyz; float3 vww =3D dot(v,w)*w; float3 res =3D 2.f * (vww + (q.w*q.w  0.5f) * v + q.w*cross(v,w) ); return res; } That's 1 dot product, 1 cross product, 7 adds, 11 multiplies, compared = to 2 cross products, 6 adds, 6 multiplies for Christian's solution.  Willem H. de Boer Homepage: http://www.whdeboer.com=20  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, = 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to = win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: Newport, Matthew <mnewport@ea...>  20050429 18:12:29

Cool, that works if I change the  Q.w * x to + Q.w * x. Now I just have = to try and figure out how it works :) Thanks a lot, I was beginning to think it wasn't possible to get it down = to 6 instructions after playing around with it for quite a while = yesterday.=20 Matt. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Christian Sch=FCler Sent: Friday, April 29, 2005 2:16 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader off the top of my head, try this x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) if it doesnt work, try changing  with + or reverse the cross prod = arguments. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Newport, Matthew Sent: Thursday, April 28, 2005 11:59 PM To: gdalgorithmslist@... Subject: [Algorithms] Fastest way to rotate a vector by a quaternion in = a shader Looking through the list archives I came across this snippet from Jarkko = Lempiainen regarding rotating a vector by a quaternion in a shader: "Yeah, last time I checked rotating a vector with a quaternion was total = of 6 instructions, which is the same as your 2*crossprod + 2 mads I = guess" I've been playing around with the definitions for quaternion = multiplication and rotating a vector by a quaternion and the best I've = been able to do is 8 instructions. Can anyone enlighten me on how it's = done in 6? Bonus points for a derivation I can follow :) This was my = best effort: Multiplication of two quaternions: Qr =3D Q1.Q2 =3D ( w1.w2  v1.v2, w1.v2 + w2.v1 + v1 x v2 ) where v1 =3D (x,y,z) of Q1 w1 =3D (w) of Q1 v2 =3D (x,y,z) of Q2 w2 =3D (w) of Q2 and both . and x are the standard vector dot and cross products. Rotate a vector by a quaternion: v' =3D q.v.q* Expanding this out and simplifying as best I could I got this down to = the following hlsl: float3 RotateVectorByQuaternion(float3 v, float4 q) { float3 vq =3D q.xyz; float3 vqcrossv =3D cross(vq, v); float3 wvplusvqcrossv =3D q.w * v + vqcrossv; float3 vqcrosswvplusvqcrossv =3D cross(vq, wvplusvqcrossv); float3 res =3D q.w * wvplusvqcrossv + vqcrosswvplusvqcrossv; res =3D dot(vq, v) * vq + res; return res; } Which works out to 8 clocks (2 cross products =3D 4 clocks, 1 dot = product, 3 mads). What's the secret of getting this down to 6? Thanks, Matt.  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: Newport, Matthew <mnewport@ea...>  20050429 18:02:58

I actually reached exactly the same result by manipulation of my original version on further investigation yesterday. My orignal version (presented more compactly than in my original email) was: float3 RotateVectorByQuaternion(float3 v, float4 q) { float3 wv_plus_qcrossv =3D q.w * v + cross(q.xyz, v); return dot(q.xyz, v) * q.xyz + (q.w * wv_plus_qcrossv + cross(q.xyz, wv_plus_qcrossv)); } Which compiles down to 8 instructions. My version of the routine you give below was this: float3 RotateVectorByQuaternion2(float3 v, float4 q) { return 2 * (dot(q.xyz, v) * q.xyz + (q.w * q.w  0.5) * v + q.w * cross(q.xyz, v)); } Which compiles to 9 instructions but has a scalar operation which some hardware may be able to do in parallel with one of the vector ops so it's probably the same speed.=20 Your original derivation is a lot simpler than the working I went through to get the second routine though :) Thanks, Matt. Original Message From: gdalgorithmslistadmin@... [mailto:gdalgorithmslistadmin@...] On Behalf Of Willem de Boer Sent: Friday, April 29, 2005 5:14 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion in a shader Hi, > off the top of my head, try this >=20 > x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) >=20 After some mulling over the result I previously obtained, I arrived at the following routine for rotating a vector v by a unit quaternion q: float3 RotateVector3ByQuaternion( float3 v, float4 q ) { w =3D q.xyz; float3 vww =3D dot(v,w)*w; float3 res =3D 2.f * (vww + (q.w*q.w  0.5f) * v + q.w*cross(v,w) ); return res; } That's 1 dot product, 1 cross product, 7 adds, 11 multiplies, compared to 2 cross products, 6 adds, 6 multiplies for Christian's solution.  Willem H. de Boer Homepage: http://www.whdeboer.com=20  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus IDC's 2005 lookahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: jarkko lempiainen <jarkko@vi...>  20050429 17:45:38

Hmh, seems my email got stuck somewhere. Anyway, Christians method is actually 4 muls less than yours with 18 muls + 12 adds vs. 22 muls + 12 adds. Jarkko  Original Message  From: "Willem de Boer" <wdeboer@...> To: <gdalgorithmslist@...> Sent: Friday, April 29, 2005 9:48 AM Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion in a shader > I guess it's not very optimal since there seems to be a > longer dependency chain on scalar values. Ah, that's a pity; if I'm not mistaken our methods require the same number of adds, but mine requires 2 fewer multiplies. Shame that doesn't carry over into the actual number of instructions.. :( Cheers, Willem  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus IDC's 2005 lookahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgibin/survey?id5hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: Stephen J Baker <sjbaker@li...>  20050429 16:16:39

J. Perkins wrote: > On 4/28/05, Megan Fox <shalinor@...> wrote: > >>Or is our solution, just using sprites for any flares below a >>particular size, what most use? > > > It has been quite some time since I last looked at it, but FlightGear > (http://www.flightgear.org) has a great looking sky including sun, > moon, and stars, and it is opensource. Might be a good place to look > for ideas. The sky model they use is very simple (no shaders, no nothing)  but the version that's in the FlightGear code is hard to integrate with. There is a simplified version of it in my PLIB library: http://plib.sf.net Look in the ssgAux area. >>From memory, I believe they were using a sprite for sun and moon, > don't recall how they did the stars. A bunch of GL_POINTS I believe. That code is pretty crude by modern standards...although it produces astronomically correct solar eclipses and such!  The second law of Frisbee throwing states: "Never precede any maneuver by a comment more predictive than "Watch this!"...it turns out that this also applies to writing Fragment Shaders.  Steve Baker (817)6192657 (Vox/VoxMail) L3Com/Link Simulation & Training (817)6192466 (Fax) Work: sjbaker@... http://www.link.com Home: sjbaker1@... http://www.sjbaker.org 
From: Willem de Boer <wdeboer@pl...>  20050429 13:48:31

> I guess it's not very optimal since there seems to be a=20 > longer dependency chain on scalar values. Ah, that's a pity; if I'm not mistaken our methods require the same number of adds, but mine requires 2 fewer multiplies. Shame that doesn't carry over into the actual number of instructions.. :( Cheers, Willem 
From: <c.schueler@ph...>  20050429 13:46:03

Might add that the 32x64 texture is hemispherical, with 64 pixels = latitude. Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Christian Sch=FCler Sent: Friday, April 29, 2005 11:00 AM To: gdalgorithmslist@... Subject: RE: [Algorithms] Sky gradients  vertex or pixel shaded? I would recommend to go for sprites. I have a dynamic sky, and I use a 32 x 64 pixel texture for the = gradient, and both the artists and I found it to be sufficient, = resolution wise. This is, I use the texture for the gradient only, no = clouds, celestial objects or flares. Christian Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Megan Fox Sent: Thursday, April 28, 2005 11:46 PM To: gdalgorithmslist@... Subject: Re: [Algorithms] Sky gradients  vertex or pixel shaded? Looks nice, though I should clarify, I'm working on a freeroaming RPG  my reason for using gradients is that the entire sky system needs to = be dynamic. From sunrise to sunset to dusk to night, dynamic clouds and = weather during any of the above conditions, etc. Unless I misunderstand, yours is more of a static texture solution  = great for FPSs, but probably not ideal for my purposes? ... that said, you're controlling white point via pixel shader  = question on that: are you doing some manner of linear falloff for the = light edges? or exponential? or something else entirely? Megan Fox On 4/28/05, Emanuele Salvucci <info@...> wrote: > Objects for us too, no vertex coloring though. > =20 > We chose to use highres FDRI skyboxes. They're generated and "baked" > skyes with HDRI data. White point is dynamically controlled via pixel=20 > shader: http://www.forwardgames.com ...follow the technology/research page=20 > and the highres texturing link. > =20 > A 1024x1024x6 skybox can take as little as 6 Mbytes, with no DXT1 > compression (blocky skyes aren't very beautiful :), compared to around = > 25Mbytes for uncompressed version, same resolution. > =20 > ...they can be layered...alpha blended...animated etc... > =20 > =20 > =20 > Best, > =20 >=20 > Emanuele Salvucci > MayaLightwave > Game Technical Artist > Lscript developer > =20 > http://www.forwardgames.com > emanueles@... > =20 > "#3. He causes things to look different so it would appear time has > passed." ________________________________ >=20 > =20 > =20 > =20 >  Original Message  > From: "Megan Fox" <shalinor@...> > To: <gdalgorithmslist@...> > Sent: Thursday, April 28, 2005 7:29 PM > Subject: [Algorithms] Sky gradients  vertex or pixel shaded? >=20 > I have an excellent sky gradient system going using "just" vertex > shading, where I can smoothly animate all the values, smoothly animate = > the falloff, etc... very nice... but I'm finding that the system is=20 > incapable of representing small flares, like daytime sun, short of an=20 > EXTREMELY tesselated skydome. (it of course represents large flare=20 > sunset conditions excellently, and does a great hazetosky fade, it=20 > just has trouble with small flares) >=20 > Now in our case, we're going to get around it with a sun sprite (and > just alpha fade it out as we fade in the larger sunset gradient), but=20 > I'm curious, is it common to use some other method for this? Maybe=20 > people DO commonly have 30k tri hemisphere domes? Maybe pixel shading = > is the key (though I'm calling a pow at every point, that can't be a=20 > good idea for pixel shading)? >=20 > Or is our solution, just using sprites for any flares below a > particular size, what most use? >=20 > Thanks, > Megan Fox >=20 >=20 >  > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a oneyear sub to SourceForge.net=20 > Plus IDC's 2005 lookahead and a copy of this survey Click here to=20 > start! http://www.idcswdc.com/cgibin/survey?id=105hix >=20 > _______________________________________________ > GDAlgorithmslist mailing list GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 >=20 >  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus IDC's 2005 lookahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88  SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a oneyear sub to SourceForge.net Plus IDC's 2005 lookahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: <c.schueler@ph...>  20050429 13:37:39

I guess it's not very optimal since there seems to be a longer = dependency chain on scalar values. HLSL says this float4 q; float4 test( float3 v : POSITION ) : POSITION { float3 w =3D q.xyz; float3 vww =3D dot(v,w)*w; float3 res =3D 2.f * (vww + (q.w*q.w  0.5f) * v + q.w*cross(v,w) ); return float4( res, 1 ); } // "q" is c1 vs_1_1 def c0, 0.5, 1, 0, 0 dcl_position v0 mov r0.x, c1.w mad r0.w, r0.x, r0.x, c0.x mul r1.xyz, r0.w, v0 dp3 r2.x, v0, c1 mul r0.xyz, v0.zxyw, c1.yzxw mad r1.xyz, r2.x, c1, r1 mad r0.xyz, v0.yzxw, c1.zxyw, r0 mad r0.xyz, c1.w, r0, r1 add oPos.xyz, r0, r0 mov oPos.w, c0.y Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Willem de Boer Sent: Friday, April 29, 2005 3:23 PM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader > ...? > I count 6 instructions: Sure, I was just comparing methods by counting the number of _actual_ additions and multiplications they take up; I wasn't = counting vertex shader instructions. I'm not very good at handoptimising vertex shader assembly, if someone more in the know could translate the following routine into = assembly, we can start comparing instruction counts: > float3 RotateVector3ByQuaternion( float3 v, float4 q ) { > w =3D q.xyz; > float3 vww =3D dot(v,w)*w; > float3 res =3D 2.f * (vww + > (q.w*q.w  0.5f) * v + > q.w*cross(v,w) > ); > return res; > } Cheers, Willem  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 
From: Willem de Boer <wdeboer@pl...>  20050429 13:23:25

> ...? > I count 6 instructions: Sure, I was just comparing methods by counting the number of _actual_ additions and multiplications they take up; I wasn't counting vertex shader instructions. I'm not very good at handoptimising vertex shader assembly, if someone more in the know could translate the following routine into assembly, we can start comparing instruction counts: > float3 RotateVector3ByQuaternion( float3 v, float4 q ) { > w =3D q.xyz; > float3 vww =3D dot(v,w)*w; > float3 res =3D 2.f * (vww + > (q.w*q.w  0.5f) * v + > q.w*cross(v,w) > ); > return res; > } Cheers, Willem 
From: <c.schueler@ph...>  20050429 13:12:18

...? I count 6 instructions: // cross( Q.xyz, X ) mul r0, Q.yzx, X.zxy mad r0, Q.zxy, X.yzx =20 // ...  Q.w * X mad r0, Q.w, X, r0 // cross( Q.xyz, ... ) mul r1, Q.yzx, r0.zxy mad r1, Q.zxy, r0.yzx // X' =3D X + 2 * ... mad r0, 2, r1, X =20 Original Message From: gdalgorithmslistadmin@... = [mailto:gdalgorithmslistadmin@...] On Behalf Of = Willem de Boer Sent: Friday, April 29, 2005 2:14 PM To: gdalgorithmslist@... Subject: RE: [Algorithms] Fastest way to rotate a vector by a quaternion = in a shader Hi, > off the top of my head, try this >=20 > x' =3D x + 2 * cross( Q.xyz, cross( Q.xyz, x )  Q.w * x ) >=20 After some mulling over the result I previously obtained, I arrived at the following routine for rotating a vector=20 v by a unit quaternion q: float3 RotateVector3ByQuaternion( float3 v, float4 q ) { w =3D q.xyz; float3 vww =3D dot(v,w)*w; float3 res =3D 2.f * (vww + (q.w*q.w  0.5f) * v + q.w*cross(v,w) ); return res; } That's 1 dot product, 1 cross product, 7 adds, 11 multiplies, compared = to 2 cross products, 6 adds, 6 multiplies for Christian's solution.  Willem H. de Boer Homepage: http://www.whdeboer.com=20  SF.Net email is sponsored by: Tell us your software development plans! = Take this survey and enter to win a oneyear sub to SourceForge.net Plus = IDC's 2005 lookahead and a copy of this survey Click here to start! = http://www.idcswdc.com/cgibin/survey?id=105hix _______________________________________________ GDAlgorithmslist mailing list GDAlgorithmslist@... https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 