Re: Static noise generation questions...

New Message Reply Date view Thread view Subject view Author view

Rob Jenkins (robj++at++barney.reading.sgi.com)
Tue, 16 Jul 1996 16:32:05 +0100


On Jul 16, 11:53am, Morten Eriksen wrote:
> Subject: Re: Static noise generation questions...
> > 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
>-- End of excerpt from Morten Eriksen

I did something along these lines to simulate noise on a sonar once. It worked
pretty well. I was displaying a new 1 pixel line of noise per frame, with the
data cascading downwards as new info came in. We made an array of noise at
start up and just jumped around in it at random. The idea above is the same
thing but more '2D' so I guess the difference would be experimenting to see how
big your noise buffer would need to be in order that your random start point
didn't give repetetive looking patterns.

Cheers
Rob

-- 
________________________________________________________________
Rob Jenkins, Software Support Group, Silicon Graphics UK Ltd.       
Forum 1, Station Road, Theale, Reading, UK, RG7 4SB. 
tel 01734 257736, fax 01734 257553, email robj++at++reading.sgi.com,

======================================================================= 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.