Debian Codegraph @

doc/classes/Shader.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="Shader" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A shader implemented in the Godot shading language.
5 </brief_description>
6 <description>
7 A custom shader program implemented in the Godot shading language, saved with the [code].gdshader[/code] extension.
8 This class is used by a [ShaderMaterial] and allows you to write your own custom behavior for rendering visual items or updating particle information. For a detailed explanation and usage, please see the tutorials linked below.
9 </description>
10 <tutorials>
11 <link title="Shaders documentation index">$DOCS_URL/tutorials/shaders/index.html</link>
12 </tutorials>
13 <methods>
14 <method name="get_default_texture_parameter" qualifiers="const">
15 <return type="Texture" />
16 <param index="0" name="name" type="StringName" />
17 <param index="1" name="index" type="int" default="0" />
18 <description>
19 Returns the texture that is set as default for the specified parameter.
20 [b]Note:[/b] [param name] must match the name of the uniform in the code exactly.
21 [b]Note:[/b] If the sampler array is used use [param index] to access the specified texture.
22 </description>
23 </method>
24 <method name="get_mode" qualifiers="const">
25 <return type="int" enum="Shader.Mode" />
26 <description>
27 Returns the shader mode for the shader.
28 </description>
29 </method>
30 <method name="get_shader_uniform_list">
31 <return type="Array" />
32 <param index="0" name="get_groups" type="bool" default="false" />
33 <description>
34 Returns the list of shader uniforms that can be assigned to a [ShaderMaterial], for use with [method ShaderMaterial.set_shader_parameter] and [method ShaderMaterial.get_shader_parameter]. The parameters returned are contained in dictionaries in a similar format to the ones returned by [method Object.get_property_list].
35 If argument [param get_groups] is [code]true[/code], parameter grouping hints are also included in the list.
36 </description>
37 </method>
38 <method name="inspect_native_shader_code">
39 <return type="void" />
40 <description>
41 Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also [method Material.inspect_native_shader_code].
42 </description>
43 </method>
44 <method name="set_default_texture_parameter">
45 <return type="void" />
46 <param index="0" name="name" type="StringName" />
47 <param index="1" name="texture" type="Texture" />
48 <param index="2" name="index" type="int" default="0" />
49 <description>
50 Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [ShaderMaterial].
51 [b]Note:[/b] [param name] must match the name of the uniform in the code exactly.
52 [b]Note:[/b] If the sampler array is used use [param index] to access the specified texture.
53 </description>
54 </method>
55 </methods>
56 <members>
57 <member name="code" type="String" setter="set_code" getter="get_code" default="&quot;&quot;">
58 Returns the shader's code as the user has written it, not the full generated code used internally.
59 </member>
60 </members>
61 <constants>
62 <constant name="MODE_SPATIAL" value="0" enum="Mode">
63 Mode used to draw all 3D objects.
64 </constant>
65 <constant name="MODE_CANVAS_ITEM" value="1" enum="Mode">
66 Mode used to draw all 2D objects.
67 </constant>
68 <constant name="MODE_PARTICLES" value="2" enum="Mode">
69 Mode used to calculate particle information on a per-particle basis. Not used for drawing.
70 </constant>
71 <constant name="MODE_SKY" value="3" enum="Mode">
72 Mode used for drawing skies. Only works with shaders attached to [Sky] objects.
73 </constant>
74 <constant name="MODE_FOG" value="4" enum="Mode">
75 Mode used for setting the color and density of volumetric fog effect.
76 </constant>
77 </constants>
78 </class>