RE: [GD-General] software for artwork
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2002-11-14 11:11:19
|
The premultiply is pretty simple. The standard blend equation is this: result = texture.C * texture.A + fb.C * (1-texture.A) ...which means that when texture.A is close to zero, the values of texture.C really aren't very exciting - they produce only small changes. Perceptually, the only thing that matters is (texture.C*texture.A). So do the multiply: texture2.C = texture.C * texture.A texture2.A = texture.A Then palettise. Many (myself included) then say you should keep it in this form right to the actual blend, so you do a ONE:INVSRCALPHA blend instead of the more normal SRCALPHA:INVSRCALPHA blend. But the PS2 can't actually do this blend (doh!), so you need to convert back to the original form once you've palettised and do: texture3.C = texture2.C / texture2.A texture3.A = texture2.A (cope with the singularities at texture2.A==0 by making texture3.C anything you like, usually black). ...and there you go. The pallising was done in a much more perceptually-significant colourspace, so it should be much higher quality. (note that the PS2 can do ONE:SRCALPHA blending, so you could just invert the alpha channel, but then the rest of the blend pipeline is a pain if you want to fade stuff in and out and so on). Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Lionel Fumery [mailto:li...@mi...] > Sent: 13 November 2002 22:13 > To: gam...@li... > Subject: Re: [GD-General] software for artwork > > > Hello, > > I have currently exactly this kind of stuff to write : > something to convert > 32bits pictures into 8bits with palette ARGB for the > PlayStation 2. I never > really though to this question, so I though it would be easy > to do (simple > octree in 4D space, or something like that). > > Could you give me more details about the alpha channel > multiplication ? > A quick search with Google shows me a lot of answers about > the Kohonon nets. > But is there somewhere a not-too-bad free lib with source > that could help me > ? (in fact, I didn't give a lot of time in my schedule to do > that task :)) > > Thank you for any advice, > > Lionel. > > ----- Original Message ----- > From: "Tom Forsyth" <to...@mu...> > To: <gam...@li...> > Sent: Wednesday, November 13, 2002 3:30 PM > Subject: RE: [GD-General] software for artwork > > > > Yep - we premultiply, palettise, and then un-premultiply > again. Works > well. > > We've also spent quite a lot of effort finding good palettisers. > > Kohonon-network based ones are good, and weused that for > the last project. > > The new one is a mad mix of various perceptual techniques > and stuff (we > have > > a chap fascinated by this stuff), works in an arbitrary number of > > dimensions, but is very very slow. We plan to use the old > kohonen one for > > quick previews, and then overnight crunch away at the > textures with the > > slow-but-superb one. > > > > But we never found any decent out-of-the-box ones. > > > > > > Tom Forsyth - Muckyfoot bloke and Microsoft MVP. > > > > This email is the product of your deranged imagination, > > and does not in any way imply existence of the author. > > > > > -----Original Message----- > > > From: Javier Arevalo [mailto:ja...@py...] > > > Sent: 13 November 2002 09:11 > > > To: gam...@li... > > > Subject: Re: [GD-General] software for artwork > > > > > > > > > Mickael Pointier <mpo...@ed...> wrote: > > > > > > > Standard quantization algorithms create artefacts, but thats not > > > > visually to disturbing when applied to color components, > > > surprisingly > > > > if you extend these algorithm to 4d, the final result is really, > > > > really crappy... > > > > > > > > I think the reasons are multiples, the first beeing > that when A tend > > > > toward 0, you do not really care about the true values of RGB > > > > components (they are almost invisible at this point), > so a lot of > > > > colors are used in semi translucent tints, that could > have been used > > > > in nearly opaque areas. > > > > > > Yeah that's one of the places where premultiplied alpha > > > textures help... > > > > > > Javier Arevalo > > > Pyro Studios > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: Are you worried about > > your web server security? Click here for a FREE Thawte > > Apache SSL Guide and answer your Apache SSL security > > needs: http://www.gothawte.com/rd523.html > > _______________________________________________ > > Gamedevlists-general mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=557 > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Are you worried about > your web server security? Click here for a FREE Thawte > Apache SSL Guide and answer your Apache SSL security > needs: http://www.gothawte.com/rd523.html > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 > |