[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to add assembler?



Erik wrote:

> I don't know jazz jackrabbit2, but starcraft doesn't have lighting and only
> basic translucency. The lighting in starcraft is all from the same point
> every time on every map on every thing, so I'm gonna guess the rendered the
> graphics with lighting in them. Translucency is done like a 1 bit alpha, so
> a simple bitmask blit would do that job, I d'no if 2d hw accelerators do
> that :/ The only hw accel I've looked at or really care about is 3d, focused
> on ogl :)

You are exactly right. There are often ways to avoid having to do
effects dynamically. The fastest way to do something is to do as little
as you can. If you do the lighting *once* and store the (reusable)
lighted sprite, you can move it to video memory (or some other "near and
fast" place) and blit it very fast to the screen very often.

For example, a XShmPutImage is about 30 MB/s on my computer, and a
DirectDraw memory to video blit on a slower machine than mine is 56
MB/s, which, although faster, isn't that much. What *is* faster, is a
DirectDraw video to video blit (on the same computer that is slower than
mine) goes at 474 MB/s, which rather makes me want to hide in a closet.

Most video cards support colorkey blitting (1 bit alpha).

-- 
Pierre Phaneuf
http://ludusdesign.com/