summaryrefslogtreecommitdiffstats
path: root/DOCS/man
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2016-09-02 00:08:43 +0200
committerwm4 <wm4@nowhere>2016-09-02 09:29:16 +0200
commitce05413a87ee24e706bf3cc044bf7eec422d034a (patch)
tree298af065368594cd736221aa30fe1e7f361ecebe /DOCS/man
parent453fea87fa8e048b0b49eb7996c929792d7bfb40 (diff)
downloadmpv-ce05413a87ee24e706bf3cc044bf7eec422d034a.tar.bz2
mpv-ce05413a87ee24e706bf3cc044bf7eec422d034a.tar.xz
vo_opengl: remove pre/post/scale-shaders
Deprecated in favor of user-shaders, which are functionally equivalent but superior. (Except in the case of scaler-shader, which has no direct replacement, but it turned out to be a very unpopular feature either way - most custom scalers don't fit into the mpv kernel infrastructure and are therefore implemented as user shaders either way) Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'DOCS/man')
-rw-r--r--DOCS/man/vo.rst78
1 files changed, 15 insertions, 63 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index dda3ea61cd..2c7b995843 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -584,68 +584,9 @@ Available video output drivers are:
better than without it) since it will extend the size to match only the
milder of the scale factors between the axes.
- ``pre-shaders=<files>``, ``post-shaders=<files>``, ``scale-shader=<file>``
- Custom GLSL fragment shaders.
-
- pre-shaders (list)
- These get applied after conversion to RGB and before linearization
- and upscaling. Operates on non-linear RGB (same as input). This is
- the best place to put things like sharpen filters.
- scale-shader
- This gets used instead of scale/cscale when those options are set
- to ``custom``. The colorspace it operates on depends on the values
- of ``linear-scaling`` and ``sigmoid-upscaling``, so no assumptions
- should be made here.
- post-shaders (list)
- These get applied after upscaling and subtitle blending (when
- ``blend-subtitles`` is enabled), but before color management.
- Operates on linear RGB if ``linear-scaling`` is in effect,
- otherwise non-linear RGB. This is the best place for colorspace
- transformations (eg. saturation mapping).
-
- These files must define a function with the following signature::
-
- vec4 sample_pixel(sampler2D tex, vec2 pos, vec2 tex_size)
-
- (If there is no string ``sample_pixel`` in the shader script, it will
- use ``sample`` instead. This is a compatibility hack for older shader
- scripts, and is deprecated.)
-
- The meanings of the parameters are as follows:
-
- sampler2D tex
- The source texture for the shader.
- vec2 pos
- The position to be sampled, in coordinate space [0-1].
- vec2 tex_size
- The size of the texture, in pixels. This may differ from image_size,
- eg. for subsampled content or for post-shaders.
-
- In addition to these parameters, the following uniforms are also
- globally available:
-
- float random
- A random number in the range [0-1], different per frame.
- int frame
- A simple count of frames rendered, increases by one per frame and
- never resets (regardless of seeks).
- vec2 image_size
- The size in pixels of the input image.
- vec2 target_size
- The size in pixels of the visible part of the scaled (and possibly
- cropped) image.
-
- For example, a shader that inverts the colors could look like this::
-
- vec4 sample(sampler2D tex, vec2 pos, vec2 tex_size)
- {
- vec4 color = texture(tex, pos);
- return vec4(1.0 - color.rgb, color.a);
- }
-
``user-shaders=<files>``
- Custom GLSL hooks. These are similar to ``post-shaders`` etc., but more
- flexible: They can be injected at almost arbitrary points in the
+ Custom GLSL hooks. These are a flexible way to add custom fragment
+ shaders, which can be injected at almost arbitrary points in the
rendering pipeline, and access all previous intermediate textures.
.. admonition:: Warning
@@ -738,8 +679,19 @@ Available video output drivers are:
The raw bound texture itself. The use of this should be
avoided unless absolutely necessary.
- In addition, the global uniforms described in ``post-shaders`` are
- also available.
+ In addition to these parameters, the following uniforms are also
+ globally available:
+
+ float random
+ A random number in the range [0-1], different per frame.
+ int frame
+ A simple count of frames rendered, increases by one per frame and
+ never resets (regardless of seeks).
+ vec2 image_size
+ The size in pixels of the input image.
+ vec2 target_size
+ The size in pixels of the visible part of the scaled (and possibly
+ cropped) image.
Internally, vo_opengl may generate any number of the following
textures. Whenever a texture is rendered and saved by vo_opengl, all of