RE: [Algorithms] packing textures : normals & lightmaps
Brought to you by:
vexxed72
From: Tom F. <tom...@bl...> - 2003-12-19 19:34:14
|
So do (texture*(0.5,1,0.5)*2) and ignore the top bit of green. Everything is 555 now. Problem solved (erm... might be 31/63 instead of 0.5 - I forget). The hardware doing the 1/3 and 2/3 interpolation in broken ways is a separate problem, and isn't the cause of purple/green tinting. TomF. > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...] On > Behalf Of Jon Watte > Sent: 19 December 2003 18:48 > To: gda...@li... > Subject: RE: [Algorithms] packing textures : normals & lightmaps > > > > My point is that you CANNOT choose colors for interpolators > that represent > pure gray. You can represent pure white, and pure black, but > not any of the > shades of gray inbetween, because of the way that the maximum > binary value > maps to 1.0 for each of the components for each of the two > colors, and the > way that the different components have different resolution. > > You will get green/purple banding if you try to do pure gray > in DXT1. No way > around it (except perhaps dithering...) > > Some hardware implementations hide this a little bit because > they play fast > and loose with the "1/3" and "2/3" rules, but I've seen it on > all the major > PC hardware families, and the math holds out that it's > fundamentally broken > to try and represent gray in a reperesentation where > different colors have > different numbers of bits, but they all have the same exact > dynamic range. > > If green was allowed to go "slightly brighter" than red and blue, thus > wouldn't be a problem. But that's not the spec. > > Cheers, > > / h+ > > > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On > Behalf Of Conor > Stokes > Sent: Friday, December 19, 2003 10:37 AM > To: gda...@li... > Subject: Re: [Algorithms] packing textures : normals & lightmaps > > > > I thought DXT1 was fundamentally broken for light mapping, > at least when > > your lights are generally not tinted. The reason is that > for R,B, 0x1f > means > > "fullbright" and 0x00 means "black" but for G, 0x3f means > "fullbright" > which > > means that there aren't any points along the way where you can make > > post-scaling R,B and G exactly match up. This leads to purple/green > banding. > > Woah there - DXT1 (apart from black) is entirely based on the > colours you > have as interpolators. It's all about being careful choosing > your original > two colours. > > > > > If you're doing something with lots of saturation in light > colors, perhaps > > it'll work better? > > Indeed. > > > > > If you're doing light maps in DXT5, then I'd just stuff > light color in the > > color channel, and put the brightness part in DXT5 alpha -- > the variable > > dynamic range makes it really quite nice for smooth > flat-color gradients. > > > > That was the instinctual feeling... > > Conor > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign > up for IBM's > Free Linux Tutorials. Learn everything from the bash shell > to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign > up for IBM's > Free Linux Tutorials. Learn everything from the bash shell > to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > |