[Effect] Film Grain

Share your Construct 2 effect files

Post » Tue Sep 08, 2015 6:43 pm

Hi all, apologies for the delay in getting this up here but a mystery illness since last Thursday has kept me at bay - I managed to get this working a week ago but I'm only just getting round to sorting it out. I'll try to sort a screenshot at some point. A few notes:

This is adapted from code originally done and kindly shared by Martins Upitis http://devlog-martinsh.blogspot.fi/2013/05/image-imperfections-and-film-grain-post.html with the exception that I have removed the element that crates coloured noise. I did this because I didn't personally feel the extra processing is necessary, and film grain should be kept subtle. I've always preferrred mono noise/grain. It wouldn't be difficult to add this back in, however - this is the first time I've ever looked at a shader and I was just keeping things simple.

I also borrowed a little bit of code from the implementation here http://www.html5gamedevs.com/topic/8393-phaser-filterkit-vignette-and-filmgrain/ which was ported from the same source but adapted slightly. I can't remember exactly what the additions were but I think there was a slightly different function for randomising/rotating some coordinates - I left it in as I was experimenting with the various methods. There were some issues while testing where the noise would create repeating distracting patterns and I thought this might have been the cause - it likely wasn't, so it might just be adding unnecessary processing.

Another slight change I made was altering the luminence coefficients to Rec 709 - the original is still commented out in the code, as are a few other things, if you want to experiment. Hope you find it useful.

Default settings for params are 0.05 for grain amount (0 to 0.10 is a logical range for intensity), 2.5 for grain size (1.5 to 4.0 and beyond if you like, bigger would probably suit a nightvision effect) and luminance stays at 1.0, but can be tweaked - experiment.

Also many thanks to @Gigatron for the effort put into converting despite me having already finished it, apologies for not responding sooner - see above :) And to @chrisbrobs

Link to zip containing fx and xml file

If anyone has any optimisations or ideas, please feel free to improve and share with the community.

Cheers
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Tue Sep 08, 2015 8:30 pm

Much as I would love to try this out, it just gives me a black screen (it makes the layer appear black). W10, NVIDIA GTX 750 Ti.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,215
Reputation: 43,852

Post » Tue Sep 08, 2015 8:37 pm

Colludium wrote:Much as I would love to try this out, it just gives me a black screen (it makes the layer appear black). W10, NVIDIA GTX 750 Ti.


What else is on your layer? Newest drivers etc? I tested it right before I packaged it up... I think I'm on a gtx 680
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Tue Sep 08, 2015 9:15 pm

@untune - I doubt it's anything you've done incorrectly - it's almost certainly a W10 driver problem. The driver self-updated a couple of days ago. It's not like Microsoft to roll out a new software without all features working properly... I just commented because anyone who uses it on W10 may experience similar problems. :/
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,215
Reputation: 43,852

Post » Tue Sep 08, 2015 9:21 pm

I'm also getting a black screen, Win8.1. No other effects seem to have a problem.
ImageImageImage
B
71
S
21
G
232
Posts: 3,696
Reputation: 129,868

Post » Wed Sep 09, 2015 1:54 am

Thanks @untune, the effect looks great!
When you apply the effect to the layout the background turns black in the layout screen, but anything in layers remains unchanged.
If you run the project everything looks as it should, or at least for me it does.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Fri Feb 12, 2016 9:45 pm

thanx a lot
B
18
S
5
Posts: 35
Reputation: 1,127

Post » Thu Sep 14, 2017 8:08 pm

@untune How I can apply this effect and affect all layers without the black screen?
B
34
S
11
G
3
Posts: 33
Reputation: 4,444

Post » Wed Sep 20, 2017 8:25 pm

i use this on layout properties and works fine. Thanks
B
109
S
26
G
46
Posts: 1,886
Reputation: 35,168


Return to Effects

Who is online

Users browsing this forum: No registered users and 2 guests