Re: Static noise generation questions...

New Message Reply Date view Thread view Subject view Author view

Morten Eriksen (Morten.Eriksen++at++due.unit.no)
Tue, 16 Jul 1996 11:53:07 +0200 (METDST)


> I'm trying to simulate a noisy video image. I'm generating the video
> image with Performer, then adding a postdraw function to overwrite
> a noisy image with alpha blending.
>
> I use the glDrawPixel function to draw a generated random grayscale image
> with alpha (to show noise level) using the GL_LUMINANCE_ALPHA format and
> the GL_UNSIGNED_BYTE type.
>
> Kinda works, but two problems:
>
> 1) The random image generation is slow. I use rand() for generating
> random pixel values between 0-255 for each 256x256 of the pixels. Is
> there a faster way, such as a "memory block" randomizer?

I'd suggest that you make a static buffer that is larger than the size
of the image buffer really needed - for example twice as big. Then you
could just use glDrawPixels with a random *pointer* into the first
half of the "noise buffer". Then you'd only have to fill the "noise
buffer" once.

I haven't actually tried this, but it was just an idea that popped
into my head when I was reading your mail.

Regards,
Morten Eriksen

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:11 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.