Newsgroups: comp.os.msdos.djgpp Subject: Re: Real-time lens flares w/ Allegro? From: root AT delorie DOT com (Demandred) Organization: Cerberus Software References: MIME-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII NNTP-Posting-Host: remote791.compusmart.ab.ca Message-ID: <3546829f.0@ntnews.compusmart.ab.ca> Date: 29 Apr 98 01:30:07 GMT Lines: 61 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article , ShawnH AT Probe DOT co DOT uk was heard to ramble thus: [snip] >Lensflare is an additive effect: a black flare value should leave >the original color unchanged, while lighter flare colors will >increase the brightness of the screen color. To do this in Allegro, >you will need to make a custom mapping table (using the >create_color_table() function). In your blender function callback, >just add the two rgb values, clamping to white if the result >overflows. Additive color. Thanks =) (An additive color table would be great for some other funky things... especially really cool explosions. I'm pretty sure I could get an effect similar to the Allegro demo's explosions, but generated on the fly. Then there's lightmaps and other funky lighting effects like fake speculars. Shawn: you should put an additive-color-map-generating function into Allegro, or an additive draw mode - just to make coding easier for poor lazy plebs like me =) >If you can't afford the memory for an extra mapping table, you can >get fairly decent effects using normal interpolating translucency, >if you draw the flares using very pale colors and not too solid. >I have to do them this way on the N64 at work (it doesn't support >additive color), and it doesn't look too far off as long as you >use sensible source images. That might work fairly well, too. >In terms of making things look nice, the important thing is not to >overdo it: make the flares quite subtle. Position them at irregular >intervals along your light vector: tweaking these numbers can make >a big difference to how smoothly they move as the light source moves >around the screen. If you can do variable translucency levels (by >using a truecolor mode, multiple color mapping tables, or different >versions of the flare graphics), try fading out the alpha as the >light source moves towards the edges of the screen. Instead of putting lens flares along a light vector (which would look supremely cool - hehe) I was actually thinking of blitting a single flare centered over the light source. Actually, I hadn't heard of the term 'light vector' until you mentioned it - I'm assuming (from the lens flare filters in my graphics package) that it's just a vector from the light source that passes through the center of the screen? Any other cool graphics tricks floating around this newsgroup's collective brain? -- Demandred, Lord of the 32-bit Registers mail to: demandrd 'at' compusmart 'dot' ab 'dot' ca http://www.nnetis.ca/~matt/dogfight.html BobCode: KOGktpdsh- lW ECsO m2 CPEIc B18 Oul LGM ScjC++++++++++ Tx A6AT H8o b2 D1