Debian Codegraph @

scene/resources/visual_shader_sdf_nodes.h

raw symbols SCIP
1 /**************************************************************************/
2 /* visual_shader_sdf_nodes.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "scene/resources/visual_shader.h"
34
35 class VisualShaderNodeSDFToScreenUV : public VisualShaderNode {
36 GDCLASS(VisualShaderNodeSDFToScreenUV, VisualShaderNode);
37
38 public:
39 virtual String get_caption() const override;
40
41 virtual int get_input_port_count() const override;
42 virtual PortType get_input_port_type(int p_port) const override;
43 virtual String get_input_port_name(int p_port) const override;
44
45 virtual int get_output_port_count() const override;
46 virtual PortType get_output_port_type(int p_port) const override;
47 virtual String get_output_port_name(int p_port) const override;
48
49 virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
50
51 virtual Category get_category() const override { return CATEGORY_TEXTURES; }
52
53 VisualShaderNodeSDFToScreenUV();
54 };
55
56 class VisualShaderNodeScreenUVToSDF : public VisualShaderNode {
57 GDCLASS(VisualShaderNodeScreenUVToSDF, VisualShaderNode);
58
59 public:
60 virtual String get_caption() const override;
61
62 virtual int get_input_port_count() const override;
63 virtual PortType get_input_port_type(int p_port) const override;
64 virtual String get_input_port_name(int p_port) const override;
65
66 virtual int get_output_port_count() const override;
67 virtual PortType get_output_port_type(int p_port) const override;
68 virtual String get_output_port_name(int p_port) const override;
69
70 virtual bool is_input_port_default(int p_port, Shader::Mode p_mode) const override;
71 virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
72
73 virtual Category get_category() const override { return CATEGORY_TEXTURES; }
74
75 VisualShaderNodeScreenUVToSDF();
76 };
77
78 class VisualShaderNodeTextureSDF : public VisualShaderNode {
79 GDCLASS(VisualShaderNodeTextureSDF, VisualShaderNode);
80
81 public:
82 virtual String get_caption() const override;
83
84 virtual int get_input_port_count() const override;
85 virtual PortType get_input_port_type(int p_port) const override;
86 virtual String get_input_port_name(int p_port) const override;
87
88 virtual int get_output_port_count() const override;
89 virtual PortType get_output_port_type(int p_port) const override;
90 virtual String get_output_port_name(int p_port) const override;
91
92 virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
93
94 virtual Category get_category() const override { return CATEGORY_TEXTURES; }
95
96 VisualShaderNodeTextureSDF();
97 };
98
99 class VisualShaderNodeTextureSDFNormal : public VisualShaderNode {
100 GDCLASS(VisualShaderNodeTextureSDFNormal, VisualShaderNode);
101
102 public:
103 virtual String get_caption() const override;
104
105 virtual int get_input_port_count() const override;
106 virtual PortType get_input_port_type(int p_port) const override;
107 virtual String get_input_port_name(int p_port) const override;
108
109 virtual int get_output_port_count() const override;
110 virtual PortType get_output_port_type(int p_port) const override;
111 virtual String get_output_port_name(int p_port) const override;
112
113 virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
114
115 virtual Category get_category() const override { return CATEGORY_TEXTURES; }
116
117 VisualShaderNodeTextureSDFNormal();
118 };
119
120 class VisualShaderNodeSDFRaymarch : public VisualShaderNode {
121 GDCLASS(VisualShaderNodeSDFRaymarch, VisualShaderNode);
122
123 public:
124 virtual String get_caption() const override;
125
126 virtual int get_input_port_count() const override;
127 virtual PortType get_input_port_type(int p_port) const override;
128 virtual String get_input_port_name(int p_port) const override;
129
130 virtual int get_output_port_count() const override;
131 virtual PortType get_output_port_type(int p_port) const override;
132 virtual String get_output_port_name(int p_port) const override;
133
134 virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;
135
136 virtual Category get_category() const override { return CATEGORY_TEXTURES; }
137
138 VisualShaderNodeSDFRaymarch();
139 };