<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_FilmGrain_%28GLSL%29</id>
	<title>Vapoursynth FilmGrain (GLSL) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_FilmGrain_%28GLSL%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_FilmGrain_(GLSL)&amp;action=history"/>
	<updated>2026-11-20T08:18:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_FilmGrain_(GLSL)&amp;diff=561&amp;oldid=prev</id>
		<title>Selur: New filter page (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_FilmGrain_(GLSL)&amp;diff=561&amp;oldid=prev"/>
		<updated>2026-11-16T08:50:23Z</updated>

		<summary type="html">&lt;p&gt;New filter page (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;FilmGrain (GLSL)&amp;#039;&amp;#039;&amp;#039; adds fine Gaussian film grain to the luma, computed on the GPU by a small mpv shader through libplacebo. The pattern changes every frame.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → Add Grain&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_GLSLFilmGrain.png|none|FilmGrain (GLSL) controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
For every pixel a Gaussian random value is added to the brightness, scaled by &amp;#039;&amp;#039;Intensity&amp;#039;&amp;#039;; chroma is not changed. At the default 0.05 the grain has a standard deviation of about 1 % of the full range (roughly 3 levels at 8 bit); at 0.2 about 4.5 %. Above about 0.2 it looks more like noise than grain.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* vs-placebo (libplacebo) and a GPU with Vulkan.&lt;br /&gt;
* Hybrid&amp;#039;s GLSL shader folder; without it the filter is disabled.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Intensity || INTENSITY || 0.01 – 100 || 0.05 || Amount of grain added to the normalized luma.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (640x356):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adjusting color space from YUV420P10 to YUV444P16 for vsGLSLFilmGrain&lt;br /&gt;
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)&lt;br /&gt;
# Adding grain using GLSL AddGrain&lt;br /&gt;
with open(&amp;quot;F:/Hybrid/64bit/vsfilters/GLSL/parameterized/filmgrain.glsl&amp;quot;) as glslf:&lt;br /&gt;
  glsl = glslf.read()&lt;br /&gt;
glsl = glsl.replace(&amp;#039;#define INTENSITY 0.05&amp;#039;, &amp;#039;#define INTENSITY 0.05&amp;#039;)&lt;br /&gt;
clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height, matrix=1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* Hybrid writes the Intensity into the film grain shader of its GLSL folder and runs it with vs-placebo&amp;#039;s Shader at the current frame size and the clip&amp;#039;s matrix.&lt;br /&gt;
* The clip is converted to 16-bit YUV 4:4:4 first, which vs-placebo needs; the output is 16-bit YUV 4:4:4 as well.&lt;br /&gt;
* The grain differs per frame but is the same on every run.&lt;br /&gt;
* In the default filter order FilmGrain (GLSL) is the last of the grain filters.&lt;br /&gt;
* FilmGrain (GLSL) also offers the [[Vapoursynth common filter options|common options]] (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== The shader ===&lt;br /&gt;
The shader is mpv&amp;#039;s &amp;quot;gaussian film grain&amp;quot; user shader by haasn. It hooks into the luma plane, takes libplacebo&amp;#039;s per-frame random value, feeds it through a hash-based random number generator and turns the result into Gaussian noise with an approximation of the inverse normal distribution.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/Lypheo/vs-placebo vs-placebo README]&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>