File: AddFragmentShader.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (60 lines) | stat: -rw-r--r-- 1,969 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>AddFragmentShader</title>
    <category>Global</category>
    <version>8.0 OC</version>
    <syntax>
      <rtype>int</rtype>
      <params>
        <param>
          <type>string</type>
          <name>category</name>
          <desc>
            Shader category or shader name the slices are added to. Known categories:
            <table>
              <rowh>
                <col>Category</col>
                <col>Description</col>
              </rowh>
              <row>
                <col>Common</col>
                <col>Applies to everything.</col>
              </row>
              <row>
                <col>Object</col>
                <col>Applies to all objects and sprites.</col>
              </row>
              <row>
                <col>Landscape</col>
                <col>Applies to the landscape.</col>
              </row>
            </table>
          </desc>
        </param>
        <param>
          <type>string</type>
          <name>shader</name>
          <desc>The GLSL shader code.</desc>
        </param>
      </params>
    </syntax>
    <desc>Adds shader slices to a category of shaders or to a single shader. Returns an identifier for removal.</desc>
    <remark>
      Consider using built-in functions such as <funclink>SetGamma</funclink>, <funclink>SetMatAdjust</funclink>, or <funclink>SetClrModulation</funclink> for changing colors instead of writing a custom shader.
    </remark>
    <examples>
      <example>
        <code>AddFragmentShader("Landscape", "slice(color+1) { fragColor.r = 1.f; }");</code>
        <text>Makes the landscape very red.</text>
      </example>
    </examples>
    <related>
      <funclink>RemoveShader</funclink>
    </related>
  </func>
  <author>Luchs</author><date>2016-10</date>
</funcs>