Film Noise

Started by Calin Leafshade, Sun 30/08/2009 14:32:41

Previous topic - Next topic

Calin Leafshade

Does anyone know of a decent way to create film noise over your room?

the only way i can think of doing it is using a sprite overlay with an 8 bit alpha channel but to get convincing noise you would need at least 20fps and im not sure if the engine could handle 20 full size sprites a second.

plus not all my rooms are exactly the same size.. and i only want the actual room to have the noise.. not the whole viewport.

any ideas?

Akatosh

A cheap way would be a screen-sized half-transparent unclickable animated GUI. I'm not sure what this would do to the frame rate, but it'd certainly be easier on the engine than a giant sprite overlay.

Additionally, if you set the z-Order correctly, you can get the film noise to be displayed BEHIND other GUIs. That could go a long way in getting the effect you're after.

Calin Leafshade

i havent really looked at guis yet.

how do you animate one? isnt that just the same as wacking a sprite over the top.. except now you have a gui too?

GarageGothic

Yup, Akatosh's suggested method is exactly how I do it, and it looks great. I'm not even using alpha channels, just a 50% transparency - even if white scratches and black hairs would in reality be non-transparent, I find that it disturbs the image a bit too much during normal gameplay.

I'm currently using only 5 frames of noise but was considering making it a bit less repetitive by displaying dust, hairs and scratches on GUI buttons at randomized positions.

As for animating it, simply set up a timer in repeatedly_execute_always and change the background frame on the GUI every time it expires.

Akatosh

Well, I don't know if GUIs can be "animated" as such, but you can certainly keep manipulating their background graphic via repeatedly_execute_always.

It IS basically just whacking a sprite over the top, but with reduced hassle.

/EDIT: Effing ninjas.

Calin Leafshade

yes that does look very cool.

and no frame rate hit as far as i can tell.

Vince Twelve

#6
I did this same thing in Linus Bruckman.  The top half of the screen had a film grain effect and the bottom half has an analog TV effect.

I used a GUI and animated it just as every one else suggests.  For the film grain, if I remember correctly, I had six frames.  Then, I also had a vertical line that would move and dance around the screen randomly, and a couple different hairs and scratches that would appear at random places for random amounts of time.

I think it wound up looking rather nice.  You can download the game for a look (see sig).

(I did find that it impacted the frame rate on some slower computers, though.  So I included the option to turn it off.)

Gord10

#7
Let me explain my own method:

I have got a dozen of pre-made noise sprites that constitutes the noise animation view.   http://coolbluefiles.net/noise2.png is one of those.


noise.Transparency=92;
noise.SetView(Noiseview);
noise.Animate(0, Noiseview, eRepeat, eNoBlock, eForwards);

is the code that's put in function room_Load() of the room. The appropriate transparency value changes according to the room itself, it needs to be obtained seperately. (I use a debug script that changes the object transparency according on the keys pressed, then it's easier to obtain the appropriate value.)
Games are art!
My horror game, Self

SMF spam blocked by CleanTalk