On Mar 13, 2004, at 9:59 PM, Br'fin wrote:
> On Mar 13, 2004, at 6:15 PM, Dietrich Epp wrote:
>> On Mar 12, 2004, at 9:53 PM, Br'fin wrote:
>>> On Mar 12, 2004, at 11:37 PM, Daniel Monteiro wrote:
>>>> Well ...I=B4m a OpenGL programmer too =3D-)
>>>> If I were one of the devs ,I would use a pre-rendered sprite for=20
>>>> the static
>>> That is possibly awkward, because of the things that can be applied=20=
>>> static. It's not just Spht death, but you can apply this to wall=20
>>> surfaces, and even marine sprites. And it's supposed to be all=20
>>> flashy and stuff over the course of several frames even if the=20
>>> sprite itself isn't changing frames during those times.
>> You can use pre-rendered static if you change the texture's <u,v>=20
>> offset to a random value every frame.
> I'm not sure this would work, even with randomly H or V flipping as an=20=
> option each frame. It might not come out well enough as static, but=20
> instead come out as jitter as the human eye picks up the repeats in=20
> the singly used texture.
I'm sure it works. I created a demo app (no binaries, just source). =20
It includes the Mersenne Twister PRNG with the main() function ripped=20
This shows the effect. It's a GLUT application, so it should work with=20=
minor modifications (e.g., change #include <GLUT/glut.h> to whatever)=20
on most systems. You can rotate the object using "," and "." keys, you=20=
can make the texture larger with "-" and smaller with "+" (sorry about=20=
that), and you can toggle interpolation with the space bar.
The program generates a static texture, each frame that texture is=20
drawn at an arbitrary offset <u,v> with both u and v in [0.0, 1.0). =20
Now, there are several additions if this isn't good enough:
- Mipmaps are necessary. This doesn't look good from far away, like=20
lots of detailed textures.
- You can do channel swapping (color matrix): 6 possibilities.
- You could do rotations and flips: one more degree of freedom
- You could have two or three static textures, arbitrarily chosen=20
between for each polygon for each frame.
- Enable stencil writes when drawing the normal sprite, and enable=20
stencil tests when drawing the static.
The static texture could be drawn to screen coordinates at 1:1 -- would=20=
this be more like old-school Marathon?