Re: [Algorithms] Shadowbuffers - ID + depth
Brought to you by:
vexxed72
From: Tom F. <tom...@ee...> - 2007-04-16 16:52:07
|
Rememeber that for an 8-bit surface, the numbers 0x00 =3D 0.0 and 0xff = =3D 1.0, *not* (255/256). So your tolerance and scale needs to be in units of = 1/255 not 1/256. Also note that these are not perfectly representable floating-point numbers. Even if they were, you'd be a fool to rely on = GPUs having the same sort of exact precision as x87 - there's certainly some console hardware where 1*a!=3Da and where 0*a!=3D0 (and that's on the = CPU!). TomF. -----Original Message----- From: gda...@li... [mailto:gda...@li...] On Behalf Of Fr=E9d=E9ric Brachfogel Sent: 16 April 2007 03:56 To: Game Development Algorithms Subject: Re: [Algorithms] Shadowbuffers - ID + depth I'm using a tolerance. Sorry, I was not clear on that point but my = problem is I strangly not arrive to find a tolerance smaller than the IDs = difference that work well for each IDs. =20 And I'm surprise that a tolerance is necessary. Numbers like 1.f/256.f, 2.f/256.f ... , if i'm not wrong, correspond to perfect floating point numbers with no precision errors. Since there is no calculus in the algorithm I was hoping not to have to use a tolerance. =20 Moreover, I find in the directx9 documentation that in a model 3 shader, = the ouput range depends of the render target format. Then I tried the = algorithm with integer ( store in float ) IDs outputed in a 32 bits floating point render target. The tolerance needed in this case was near 200 (???)..=20 =20 I'm confused. I'm thinking about a weird thing in my program which is = yet obvious...=20 =20 What are you using in your demo please ? =20 F.Brachfogel=20 --------------------------------------=20 Chronophage Games=20 3-5 rue Lashermes 43000 Le Puy en Velay=20 FRANCE=20 > From: tom...@ee... > To: gda...@li... > Date: Mon, 16 Apr 2007 03:10:05 -0700 > Subject: Re: [Algorithms] Shadowbuffers - ID + depth >=20 > These are floating-point numbers, so you have to include a tolerance = in your > comparison. So you have to do something like: >=20 > if ( abs(a-b) < 0.5/255 ) ... >=20 > rather than=20 >=20 > if ( a =3D=3D b ) ... >=20 >=20 > This is just floating-point numbers doing what they do. >=20 >=20 > TomF. >=20 >=20 > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...] On Behalf Of > Fr=E9d=E9ric Brachfogel > Sent: 16 April 2007 02:32 > To: Game Development Algorithms > Subject: Re: [Algorithms] Shadowbuffers - ID + depth >=20 >=20 > Hello,=20 >=20 > All is saying that I have a big problem of precision in my = implementation of > this. The problem occur when I tried to check if two IDs are the same. It's > never the same... >=20 > In the shadow map build pass, I tried to write floating point IDs in = the > shadow map ( power of 2 friendly , normally ) and integer IDs. The = problem > with integer IDs is that I need to divide them cause of the out color > clamping (that lead precision errors ). That's why I tried floating = point > IDs. >=20 > None of the 2 above solutions work. >=20 > Is that something you encounter (or is my program containing something > weird...) ? >=20 >=20 > F.Brachfogel=20 >=20 > --------------------------------------=20 > Chronophage Games=20 > 3-5 rue Lashermes > 43000 Le Puy en Velay=20 > FRANCE=20 >=20 >=20 >=20 >=20 >=20 > > From: tom...@ee... > > To: gda...@li... > > Date: Sat, 10 Mar 2007 20:48:40 -0800 > > Subject: [Algorithms] Shadowbuffers - ID + depth > >=20 > > I've been playing with shadowbuffers a bit more, finally got around = to > doing > > something I've wanted to figure out for a while. The trick is to = combine a > > traditional depth buffer with an ID buffer (also called a priority > buffer). > > You use the ID buffer for inter-object shadowing, while you use the depth > > buffer for object self-shdowing. > >=20 > > It works really well and I think it's far more robust than existing > > techniques. It's also faster and requires less fancy hardware. I'm pretty > > happy about the way it came out. I'm also annoyed I didn't figure = this out > > years ago :-) > >=20 > > Slides and a demo here - "Yet More Shadowbuffers": > > http://www.eelpi.gotdns.org/papers/papers.html > >=20 > >=20 > > TomF. > >=20 > >=20 > >=20 > > --=20 > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.446 / Virus Database: 268.18.7/710 - Release Date: 04/03/2007 > > 13:58 > >=20 > >=20 > >=20 > > -------------------------------------------------------------------------= > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to = share > your > > opinions on IT & business topics through brief surveys-and earn cash > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 >=20 >=20 > Soyez parmi les premiers =E0 essayer Windows Live Mail. Windows Live = Mail.=20 >=20 > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 269.4.0/759 - Release Date: = 12/04/2007 > 19:58 >=20 > --=20 > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 269.4.0/759 - Release Date: = 12/04/2007 > 19:58 >=20 >=20 >=20 > = -------------------------------------------------------------------------= > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > = http://sourceforge.net/mailarchive/forum.php?forum_name=3Dgdalgorithms-li= st Avec Windows Live Spaces, publiez directement des messages = =E9lectroniques sur votre blog ou ajoutez-y des photos, des blagues et d'autres infos. C'est gratuit !=20 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.4.0/759 - Release Date: = 12/04/2007 19:58 --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.4.0/759 - Release Date: = 12/04/2007 19:58 =20 |