Pixelated Film Grain Shader

Pixelated Film Grain Shader

Postby Nash » Tue Aug 13, 2019 2:19 am



This is a port of the film grain shader from https://www.shadertoy.com/view/Mdj3zd but combined with the concept of a pixelated screen shader from https://gamedev.stackexchange.com/quest ... ion-shader

What makes this shader different from your typical film grain shader? Have you noticed that with usual film grain shaders, the effect becomes harder to see as your video resolution goes up? That is because the effect is applied per-pixel, so at 640x480, for example, the effect is very clear, but at 4k resolution, you almost can't see the effect because the pixels are too tiny. Then you compensate for this by cranking the "amount", but then it starts to look bad because you are just making the viewport harder to see.

With this shader, the size of one "grain" stays constant no matter resolution you're using. You can use the options to adjust the pixel size - lower number produces larger, blockier grains.

This shader is best understood by just running it and playing with the options, while changing resolutions. The film grain effect and intensity will remain consistent regardless of whatever resolution you set.

Have fun!
Attachments
PixelatedFilmGrainShader.pk3
(2.46 KiB) Downloaded 52 times
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Pixelated Film Grain Shader

Postby Tormentor667 » Tue Aug 13, 2019 5:33 pm

This is cool!
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Pixelated Film Grain Shader

Postby Nash » Tue Aug 13, 2019 7:00 pm

Thanks. Feel free to use in BoA if you want - I know you love shaders. ;)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Pixelated Film Grain Shader

Postby Ozymandias81 » Wed Aug 14, 2019 3:22 pm

Will check this and replace actual noise filter on BoA with this one :)
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Pixelated Film Grain Shader

Postby Ozymandias81 » Thu Aug 15, 2019 7:42 pm

Aaaand it has been added, wonder if there are some fallbacks or issues since I kept zscript version at 3.7.2 as present on BoA instead of 4.2.0 (which generated a little pack of deprecated warnings not belonging only to Film Grain anyway)
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Pixelated Film Grain Shader

Postby Nash » Thu Aug 15, 2019 9:20 pm

ZScript version should be irrelevant, as far as I can tell, I didn't use any new ZScript-side features for this shader. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Pixelated Film Grain Shader

Postby Ozymandias81 » Sat Aug 17, 2019 9:57 am

Noticed it in the end... Thanks a lot for this shader!
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Modern GZDoom)


Return to Shaders

Who is online

Users browsing this forum: No registered users and 0 guests