2018-08-29 22:38:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*  visual_shader.h                                                       */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                         This file is part of:                          */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                             GODOT ENGINE                               */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                        https://godotengine.org                         */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Permission is hereby granted, free of charge, to any person obtaining  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* a copy of this software and associated documentation files (the        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* "Software"), to deal in the Software without restriction, including    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* without limitation the rights to use, copy, modify, merge, publish,    */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* distribute, sublicense, and/or sell copies of the Software, and to     */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* permit persons to whom the Software is furnished to do so, subject to  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* the following conditions:                                              */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* The above copyright notice and this permission notice shall be         */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* included in all copies or substantial portions of the Software.        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*                                                                        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# ifndef VISUAL_SHADER_H 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define VISUAL_SHADER_H 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-07 19:33:38 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "core/string/string_builder.h" 
  
						 
					
						
							
								
									
										
										
										
											2021-02-10 19:22:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "core/templates/safe_refcount.h" 
  
						 
					
						
							
								
									
										
										
										
											2019-05-27 17:33:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "scene/gui/control.h" 
  
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "scene/resources/shader.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeParameter ;  
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNode ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShader  :  public  Shader  {  
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDCLASS ( VisualShader ,  Shader ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enum  Type  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										TYPE_VERTEX , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										TYPE_FRAGMENT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										TYPE_LIGHT , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-15 10:57:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										TYPE_START , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-07 10:28:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										TYPE_PROCESS , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-15 10:57:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										TYPE_COLLIDE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										TYPE_START_CUSTOM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										TYPE_PROCESS_CUSTOM , 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-17 20:16:03 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										TYPE_SKY , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-03 04:28:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										TYPE_FOG , 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										TYPE_MAX 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Connection  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										int  from_node  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  from_port  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  to_node  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  to_port  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  DefaultTextureParam  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										StringName  name ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-04 14:43:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										List < Ref < Texture > >  params ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									enum  VaryingMode  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_MODE_VERTEX_TO_FRAG_LIGHT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_MODE_FRAG_TO_LIGHT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_MODE_MAX , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enum  VaryingType  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_TYPE_FLOAT , 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-24 12:41:42 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_INT , 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-27 20:49:11 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_UINT , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_VECTOR_2D , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_TYPE_VECTOR_3D , 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-12 19:09:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_VECTOR_4D , 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-24 12:41:42 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_BOOLEAN , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VARYING_TYPE_TRANSFORM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VARYING_TYPE_MAX , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Varying  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-22 09:25:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										VaryingMode  mode  =  VARYING_MODE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VaryingType  type  =  VARYING_TYPE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-22 09:25:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Varying ( )  { } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Varying ( String  p_name ,  VaryingMode  p_mode ,  VaryingType  p_type )  : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												name ( p_name ) ,  mode ( p_mode ) ,  type ( p_type )  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										bool  from_string ( const  String  & p_str )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Vector < String >  arr  =  p_str . split ( " , " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( arr . size ( )  ! =  2 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											mode  =  ( VaryingMode ) arr [ 0 ] . to_int ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											type  =  ( VaryingType ) arr [ 1 ] . to_int ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										String  to_string ( )  const  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  vformat ( " %s,%s " ,  itos ( ( int ) mode ) ,  itos ( ( int ) type ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2020-09-09 11:21:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Type  current_type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									struct  Node  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Ref < VisualShaderNode >  node ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Vector2  position ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-03 15:09:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										LocalVector < int >  prev_connected_nodes ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										LocalVector < int >  next_connected_nodes ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Graph  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-05-13 15:04:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										RBMap < int ,  Node >  nodes ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										List < Connection >  connections ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  graph [ TYPE_MAX ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Shader : : Mode  shader_mode  =  Shader : : MODE_SPATIAL ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 12:29:22 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									mutable  String  previous_code ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-05 20:35:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									TypedArray < Dictionary >  _get_node_connections ( Type  p_type )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Vector2  graph_offset ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < String ,  int >  modes ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-05-19 17:00:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									HashSet < StringName >  flags ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-05-13 15:04:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									HashMap < String ,  Varying >  varyings ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-11 16:20:25 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# ifdef TOOLS_ENABLED 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < String ,  Variant >  preview_params ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									List < Varying >  varyings_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-10 19:22:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									mutable  SafeFlag  dirty ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									void  _queue_update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									union  ConnectionKey  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										struct  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uint64_t  node  :  32 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											uint64_t  port  :  32 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										uint64_t  key  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										bool  operator < ( const  ConnectionKey  & p_key )  const  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  key  <  p_key . key ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-29 12:53:28 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Error  _write_node ( Type  p_type ,  StringBuilder  * p_global_code ,  StringBuilder  * p_global_code_per_node ,  HashMap < Type ,  StringBuilder >  * p_global_code_per_func ,  StringBuilder  & r_code ,  Vector < DefaultTextureParam >  & r_def_tex_params ,  const  VMap < ConnectionKey ,  const  List < Connection > : : Element  * >  & p_input_connections ,  const  VMap < ConnectionKey ,  const  List < Connection > : : Element  * >  & p_output_connections ,  int  p_node ,  HashSet < int >  & r_processed ,  bool  p_for_preview ,  HashSet < StringName >  & r_classes )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _input_type_changed ( Type  p_type ,  int  p_id ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-07 10:28:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  has_func_name ( RenderingServer : : ShaderMode  p_mode ,  const  String  & p_func_name )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-07 16:48:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  _check_reroute_subgraph ( Type  p_type ,  int  p_target_port_type ,  int  p_reroute_node ,  List < int >  * r_visited_reroute_nodes  =  nullptr )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  _update_shader ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _set ( const  StringName  & p_name ,  const  Variant  & p_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _get ( const  StringName  & p_name ,  Variant  & r_ret )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _get_property_list ( List < PropertyInfo >  * p_list )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-11 14:18:45 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  reset_state ( )  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-09 11:21:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								public :  // internal methods
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_shader_type ( Type  p_type ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-09 17:40:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Type  get_shader_type ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-09 11:21:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									enum  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										NODE_ID_INVALID  =  - 1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										NODE_ID_OUTPUT  =  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  add_node ( Type  p_type ,  const  Ref < VisualShaderNode >  & p_node ,  const  Vector2  & p_position ,  int  p_id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_node_position ( Type  p_type ,  int  p_id ,  const  Vector2  & p_position ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  add_varying ( const  String  & p_name ,  VaryingMode  p_mode ,  VaryingType  p_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  remove_varying ( const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  has_varying ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_varyings_count ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									const  Varying  * get_varying_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_varying_mode ( const  String  & p_name ,  VaryingMode  p_mode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VaryingMode  get_varying_mode ( const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_varying_type ( const  String  & p_name ,  VaryingType  p_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VaryingType  get_varying_type ( const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-11 16:20:25 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _set_preview_shader_parameter ( const  String  & p_name ,  const  Variant  & p_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Variant  _get_preview_shader_parameter ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _has_preview_shader_parameter ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									Vector2  get_node_position ( Type  p_type ,  int  p_id )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Ref < VisualShaderNode >  get_node ( Type  p_type ,  int  p_id )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-03 15:09:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									_FORCE_INLINE_  Ref < VisualShaderNode >  get_node_unchecked ( Type  p_type ,  int  p_id )  const  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  graph [ p_type ] . nodes [ p_id ] . node ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-06 20:16:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									_FORCE_INLINE_  const  LocalVector < int >  & get_next_connected_nodes ( Type  p_type ,  int  p_id )  const  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  graph [ p_type ] . nodes [ p_id ] . next_connected_nodes ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-03 15:09:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-06 20:16:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									_FORCE_INLINE_  const  LocalVector < int >  & get_prev_connected_nodes ( Type  p_type ,  int  p_id )  const  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  graph [ p_type ] . nodes [ p_id ] . prev_connected_nodes ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-03 15:09:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									Vector < int >  get_node_list ( Type  p_type )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_valid_node_id ( Type  p_type )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  find_node_id ( Type  p_type ,  const  Ref < VisualShaderNode >  & p_node )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  remove_node ( Type  p_type ,  int  p_id ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-30 11:45:31 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  replace_node ( Type  p_type ,  int  p_id ,  const  StringName  & p_new_class ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_node_connection ( Type  p_type ,  int  p_from_node ,  int  p_from_port ,  int  p_to_node ,  int  p_to_port )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-20 17:46:49 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_nodes_connected_relatively ( const  Graph  * p_graph ,  int  p_node ,  int  p_target )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									bool  can_connect_nodes ( Type  p_type ,  int  p_from_node ,  int  p_from_port ,  int  p_to_node ,  int  p_to_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Error  connect_nodes ( Type  p_type ,  int  p_from_node ,  int  p_from_port ,  int  p_to_node ,  int  p_to_port ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  disconnect_nodes ( Type  p_type ,  int  p_from_node ,  int  p_from_port ,  int  p_to_node ,  int  p_to_port ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  connect_nodes_forced ( Type  p_type ,  int  p_from_node ,  int  p_from_port ,  int  p_to_node ,  int  p_to_port ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 21:50:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_port_types_compatible ( int  p_a ,  int  p_b )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  attach_node_to_frame ( Type  p_type ,  int  p_node ,  int  p_frame ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  detach_node_from_frame ( Type  p_type ,  int  p_node ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-07 16:48:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  get_reroute_parameter_name ( Type  p_type ,  int  p_reroute_node )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  rebuild ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									void  get_node_connections ( Type  p_type ,  List < Connection >  * r_connections )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_mode ( Mode  p_mode ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Mode  get_mode ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_text_shader ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 21:54:59 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									void  set_graph_offset ( const  Vector2  & p_offset ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Vector2  get_graph_offset ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  generate_preview_shader ( Type  p_type ,  int  p_node ,  int  p_port ,  Vector < DefaultTextureParam >  & r_default_tex_params )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-02 12:49:46 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  validate_port_name ( const  String  & p_port_name ,  VisualShaderNode  * p_node ,  int  p_port_id ,  bool  p_output )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  validate_parameter_name ( const  String  & p_name ,  const  Ref < VisualShaderNodeParameter >  & p_parameter )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								VARIANT_ENUM_CAST ( VisualShader : : Type )  
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								VARIANT_ENUM_CAST ( VisualShader : : VaryingMode )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								VARIANT_ENUM_CAST ( VisualShader : : VaryingType )  
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								///
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								///
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								///
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNode  :  public  Resource  {  
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNode ,  Resource ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enum  PortType  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_SCALAR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_SCALAR_INT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_SCALAR_UINT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_VECTOR_2D , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_VECTOR_3D , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_VECTOR_4D , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_BOOLEAN , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_TRANSFORM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_SAMPLER , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PORT_TYPE_MAX , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enum  Category  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_NONE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_OUTPUT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_COLOR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_CONDITIONAL , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_INPUT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_SCALAR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_TEXTURES , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_TRANSFORM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_UTILITY , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_VECTOR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_SPECIAL , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_PARTICLE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										CATEGORY_MAX 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2020-09-07 12:29:44 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  port_preview  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  linked_parent_graph_frame  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-05-13 15:04:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									HashMap < int ,  bool >  connected_input_ports ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  int >  connected_output_ports ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  bool >  expanded_output_ports ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									HashMap < int ,  Variant >  default_input_values ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-07 12:29:44 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  simple_decl  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 22:17:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  disabled  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-09 18:31:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  closable  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 22:17:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2020-01-27 12:10:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_simple_decl ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 10:33:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_default_input_port ( PortType  p_type )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-01 11:32:01 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  set_input_port_default_value ( int  p_port ,  const  Variant  & p_value ,  const  Variant  & p_prev_value  =  Variant ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									Variant  get_input_port_default_value ( int  p_port )  const ;  // if NIL (default if node does not set anything) is returned, it means no default value is wanted if disconnected, thus no input var must be supplied (empty string will be supplied)
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 10:42:35 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Array  get_default_input_values ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  set_default_input_values ( const  Array  & p_values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-05 15:53:53 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  remove_input_port_default_value ( int  p_port ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  void  clear_default_input_values ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-22 11:09:16 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_input_port_default ( int  p_port ,  Shader : : Mode  p_mode )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-03 10:40:26 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									void  set_output_port_for_preview ( int  p_index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_output_port_for_preview ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  bool  is_port_separator ( int  p_index )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-26 04:04:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_output_port_connected ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_output_port_connected ( int  p_port ,  bool  p_connected ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-27 09:18:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_input_port_connected ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_input_port_connected ( int  p_port ,  bool  p_connected ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-01-19 11:35:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_any_port_connected ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-27 09:18:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_generate_input_var ( int  p_port )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-26 04:04:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 22:55:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  has_output_port_preview ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-20 18:45:53 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_output_port_expandable ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _set_output_ports_expanded ( const  Array  & p_data ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Array  _get_output_ports_expanded ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _set_output_port_expanded ( int  p_port ,  bool  p_expanded ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _is_output_port_expanded ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_expanded_output_port_count ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-26 04:04:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_code_generated ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-21 14:32:59 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_show_prop_names ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  bool  is_use_prop_slots ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-26 04:04:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 22:17:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_disabled ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_disabled ( bool  p_disabled  =  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_deletable ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_deletable ( bool  p_closable  =  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_frame ( int  p_node ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_frame ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-09 18:31:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									virtual  Vector < StringName >  get_editable_properties ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-05-13 15:04:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  HashMap < StringName ,  String >  get_editable_properties_names ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  Vector < VisualShader : : DefaultTextureParam >  get_default_texture_parameters ( VisualShader : : Type  p_type ,  int  p_id )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  generate_global ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type ,  int  p_id )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 08:46:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  generate_global_per_node ( Shader : : Mode  p_mode ,  int  p_id )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-12 12:14:34 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  generate_global_per_func ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type ,  int  p_id )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-20 12:07:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// If no output is connected, the output var passed will be empty. If no input is connected and input is NIL, the input var passed will be empty.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_warning ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									VisualShaderNode ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								VARIANT_ENUM_CAST ( VisualShaderNode : : PortType )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeCustom  :  public  VisualShaderNode  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeCustom ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Port  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										int  type  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_initialized  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									List < Port >  input_ports ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									List < Port >  output_ports ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  Property  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  DropDownListProperty  :  public  Property  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Vector < String >  options ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  int >  dp_selected_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  int >  dp_default_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									List < DropDownListProperty >  dp_props ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  properties ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									friend  class  VisualShaderEditor ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									friend  class  VisualShaderGraphPlugin ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 10:33:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_default_input_port ( PortType  p_type )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-01 11:32:01 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  set_input_port_default_value ( int  p_port ,  const  Variant  & p_value ,  const  Variant  & p_prev_value  =  Variant ( ) )  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  set_default_input_values ( const  Array  & p_values )  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-05 15:53:53 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  void  remove_input_port_default_value ( int  p_port )  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  void  clear_default_input_values ( )  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( String ,  _get_name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( String ,  _get_description ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( String ,  _get_category ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-15 20:33:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( PortType ,  _get_return_icon_type ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( int ,  _get_input_port_count ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-15 20:33:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( PortType ,  _get_input_port_type ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( String ,  _get_input_port_name ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( Variant ,  _get_input_port_default_value ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-22 10:33:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( int ,  _get_default_input_port ,  PortType ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( int ,  _get_output_port_count ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-15 20:33:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( PortType ,  _get_output_port_type ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( String ,  _get_output_port_name ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( int ,  _get_property_count ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( String ,  _get_property_name ,  int ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( int ,  _get_property_default_index ,  int ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( Vector < String > ,  _get_property_options ,  int ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-04 11:30:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL4RC ( String ,  _get_code ,  TypedArray < String > ,  TypedArray < String > ,  Shader : : Mode ,  VisualShader : : Type ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 22:58:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL2RC ( String ,  _get_func_code ,  Shader : : Mode ,  VisualShader : : Type ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-10 13:22:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL1RC ( String ,  _get_global_code ,  Shader : : Mode ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL0RC ( bool ,  _is_highend ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 22:58:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDVIRTUAL2RC ( bool ,  _is_available ,  Shader : : Mode ,  VisualShader : : Type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _is_valid_code ( const  String  & p_code )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-21 22:52:44 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _set_input_port_default_value ( int  p_port ,  const  Variant  & p_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 22:58:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_available ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 08:46:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  generate_global_per_node ( Shader : : Mode  p_mode ,  int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 22:58:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  generate_global_per_func ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type ,  int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeCustom ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  update_property_default_values ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  update_input_port_default_values ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  update_ports ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  update_properties ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 13:47:37 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _is_initialized ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _set_initialized ( bool  p_enabled ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _set_properties ( const  String  & p_properties ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  _get_properties ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-04 14:30:20 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  _get_name ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  _get_description ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  _get_category ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PortType  _get_return_icon_type ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _is_highend ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-15 13:27:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _set_option_index ( int  p_op ,  int  p_index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_option_index ( int  p_op )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-09 22:51:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/////
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeInput  :  public  VisualShaderNode  {  
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeInput ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									friend  class  VisualShader ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShader : : Type  shader_type  =  VisualShader : : TYPE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Shader : : Mode  shader_mode  =  Shader : : MODE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Port  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Shader : : Mode  mode  =  Shader : : Mode : : MODE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VisualShader : : Type  shader_type  =  VisualShader : : Type : : TYPE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PortType  type  =  PortType : : PORT_TYPE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										const  char  * name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										const  char  * string ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  const  Port  ports [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  const  Port  preview_ports [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  input_name  =  " [None] " ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-17 18:03:07 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_shader_type ( VisualShader : : Type  p_shader_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_shader_mode ( Shader : : Mode  p_shader_mode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-12 23:57:11 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _validate_property ( PropertyInfo  & p_property )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-22 20:31:23 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_output_port_expandable ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_input_name ( String  p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_input_name ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-03 16:38:03 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  get_input_real_name ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_input_index_count ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PortType  get_input_index_type ( int  p_index )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_input_index_name ( int  p_index )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PortType  get_input_type_by_name ( String  p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Vector < StringName >  get_editable_properties ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_INPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeInput ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								///
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeOutput  :  public  VisualShaderNode  {  
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeOutput ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									friend  class  VisualShader ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShader : : Type  shader_type  =  VisualShader : : Type : : TYPE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Shader : : Mode  shader_mode  =  Shader : : Mode : : MODE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Port  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Shader : : Mode  mode  =  Shader : : Mode : : MODE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VisualShader : : Type  shader_type  =  VisualShader : : Type : : TYPE_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PortType  type  =  PortType : : PORT_TYPE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										const  char  * name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										const  char  * string ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  const  Port  ports [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									Variant  get_input_port_default_value ( int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_port_separator ( int  p_index )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_OUTPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeOutput ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeParameter  :  public  VisualShaderNode  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeParameter ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									enum  Qualifier  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										QUAL_NONE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										QUAL_GLOBAL , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										QUAL_INSTANCE , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-14 13:38:22 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										QUAL_MAX , 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 11:29:23 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  parameter_name  =  " " ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Qualifier  qualifier  =  QUAL_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  global_code_generated  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  _get_qual_str ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-07 08:08:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# ifndef DISABLE_DEPRECATED 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _set ( const  StringName  & p_name ,  const  Variant  & p_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_parameter_name ( const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_parameter_name ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_qualifier ( Qualifier  p_qual ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Qualifier  get_qualifier ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_global_code_generated ( bool  p_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_global_code_generated ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_qualifier_supported ( Qualifier  p_qual )  const  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-04 15:09:29 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_convertible_to_constant ( )  const  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Vector < StringName >  get_editable_properties ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_warning ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-06 10:25:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_INPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeParameter ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								VARIANT_ENUM_CAST ( VisualShaderNodeParameter : : Qualifier )  
						 
					
						
							
								
									
										
										
										
											2020-05-05 11:25:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeParameterRef  :  public  VisualShaderNode  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeParameterRef ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									enum  ParameterType  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_FLOAT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_INT , 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-27 20:49:11 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PARAMETER_TYPE_UINT , 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PARAMETER_TYPE_BOOLEAN , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_VECTOR2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_VECTOR3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_VECTOR4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_TRANSFORM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PARAMETER_TYPE_COLOR , 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										UNIFORM_TYPE_SAMPLER , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  Parameter  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ParameterType  type ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2022-07-16 09:59:20 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									RID  shader_rid ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  parameter_name  =  " [None] " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ParameterType  param_type  =  ParameterType : : PARAMETER_TYPE_FLOAT ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									static  void  add_parameter ( RID  p_shader_rid ,  const  String  & p_name ,  ParameterType  p_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  clear_parameters ( RID  p_shader_rid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  bool  has_parameter ( RID  p_shader_rid ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-19 12:32:44 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_shader_valid ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 09:59:20 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_shader_rid ( const  RID  & p_shader ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_parameter_name ( const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_parameter_name ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  update_parameter_type ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 09:59:20 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  _set_parameter_type ( int  p_parameter_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  _get_parameter_type ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-21 14:32:59 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  get_parameters_count ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_parameter_name_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ParameterType  get_parameter_type_by_name ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ParameterType  get_parameter_type_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-12 10:34:40 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PortType  get_port_type_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  Vector < StringName >  get_editable_properties ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_INPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-27 12:22:43 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeParameterRef ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-28 11:02:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-04 12:11:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeResizableBase  :  public  VisualShaderNode  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeResizableBase ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2022-09-01 11:34:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Size2  size  =  Size2 ( 0 ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-04 12:11:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  allow_v_resize  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2022-09-01 11:34:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_size ( const  Size2  & p_size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Size2  get_size ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-04 12:11:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_allow_v_resize ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_allow_v_resize ( bool  p_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeResizableBase ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeFrame  :  public  VisualShaderNodeResizableBase  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeFrame ,  VisualShaderNodeResizableBase ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-21 11:33:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  title  =  " Title " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  tint_color_enabled  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Color  tint_color  =  Color ( 0.3 ,  0.3 ,  0.3 ,  0.75 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  autoshrink  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashSet < int >  attached_nodes ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-21 11:33:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_title ( const  String  & p_title ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_title ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_tint_color_enabled ( bool  p_enable ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_tint_color_enabled ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_tint_color ( const  Color  & p_color ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Color  get_tint_color ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_autoshrink_enabled ( bool  p_enable ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_autoshrink_enabled ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  add_attached_node ( int  p_node ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  remove_attached_node ( int  p_node ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_attached_nodes ( const  PackedInt32Array  & p_nodes ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PackedInt32Array  get_attached_nodes ( )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-21 11:33:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_NONE ;  } 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-07 02:37:26 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeFrame ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-21 11:33:55 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-18 02:39:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# ifndef DISABLE_DEPRECATED 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								// Deprecated, for compatibility only.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeComment  :  public  VisualShaderNodeFrame  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeComment ,  VisualShaderNodeFrame ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  description ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override  {  return  " Comment(Deprecated) " ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_NONE ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_description ( const  String  & p_description ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_description ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeComment ( )  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-04 12:11:58 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeGroupBase  :  public  VisualShaderNodeResizableBase  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeGroupBase ,  VisualShaderNodeResizableBase ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  _apply_port_changes ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  inputs  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  outputs  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  editable  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Port  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-09 18:24:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PortType  type  =  PortType : : PORT_TYPE_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-05-13 15:04:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									HashMap < int ,  Port >  input_ports ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  Port >  output_ports ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									HashMap < int ,  Control  * >  controls ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_inputs ( const  String  & p_inputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_inputs ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_outputs ( const  String  & p_outputs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_outputs ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-22 17:41:51 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  is_valid_port_name ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  add_input_port ( int  p_id ,  int  p_type ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  remove_input_port ( int  p_id ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  has_input_port ( int  p_id )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  clear_input_ports ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  add_output_port ( int  p_id ,  int  p_type ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  remove_output_port ( int  p_id ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  has_output_port ( int  p_id )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  clear_output_ports ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_input_port_type ( int  p_id ,  int  p_type ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_input_port_name ( int  p_id ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_output_port_type ( int  p_id ,  int  p_type ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_output_port_name ( int  p_id ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_free_input_port_id ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_free_output_port_id ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-24 14:33:50 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_ctrl_pressed ( Control  * p_control ,  int  p_index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Control  * is_ctrl_pressed ( int  p_index ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 08:09:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  set_editable ( bool  p_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  is_editable ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_SPECIAL ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeGroupBase ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeExpression  :  public  VisualShaderNodeGroupBase  {  
						 
					
						
							
								
									
										
										
										
											2019-03-19 14:35:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeExpression ,  VisualShaderNodeGroupBase ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-25 19:28:01 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bool  _is_valid_identifier_char ( char32_t  p_c )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  _replace_port_names ( const  Vector < Pair < String ,  String > >  & p_pairs ,  const  String  & p_expression )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 08:09:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2020-09-05 15:46:12 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									String  expression  =  " " ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_expression ( const  String  & p_expression ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_expression ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-19 11:49:10 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  bool  is_output_port_expandable ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-12 15:09:39 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeExpression ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 08:09:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeGlobalExpression  :  public  VisualShaderNodeExpression  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeGlobalExpression ,  VisualShaderNodeExpression ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 08:09:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-10 11:34:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  String  generate_global ( Shader : : Mode  p_mode ,  VisualShader : : Type  p_type ,  int  p_id )  const  override ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-18 08:09:05 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeGlobalExpression ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  VisualShaderNodeVarying  :  public  VisualShaderNode  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeVarying ,  VisualShaderNode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Varying  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										String  name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VisualShader : : VaryingMode  mode ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VisualShader : : VaryingType  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										bool  assigned  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
									
										
										
										
											2024-06-16 10:16:52 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									RID  shader_rid ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShader : : VaryingType  varying_type  =  VisualShader : : VARYING_TYPE_FLOAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  varying_name  =  " [None] " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  // internal
  
						 
					
						
							
								
									
										
										
										
											2024-06-16 10:16:52 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									static  void  add_varying ( RID  p_shader_rid ,  const  String  & p_name ,  VisualShader : : VaryingMode  p_mode ,  VisualShader : : VaryingType  p_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  clear_varyings ( RID  p_shader_rid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  bool  has_varying ( RID  p_shader_rid ,  const  String  & p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_shader_rid ( const  RID  & p_shader ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  get_varyings_count ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_varying_name_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader : : VaryingMode  get_varying_mode_by_name ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader : : VaryingMode  get_varying_mode_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader : : VaryingType  get_varying_type_by_name ( const  String  & p_name )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader : : VaryingType  get_varying_type_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PortType  get_port_type_by_index ( int  p_idx )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  void  _bind_methods ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								protected :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_type_str ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PortType  get_port_type ( VisualShader : : VaryingType  p_type ,  int  p_port )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_varying_name ( String  p_varying_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									String  get_varying_name ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  set_varying_type ( VisualShader : : VaryingType  p_varying_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShader : : VaryingType  get_varying_type ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									VisualShaderNodeVarying ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeVaryingSetter  :  public  VisualShaderNodeVarying  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeVaryingSetter ,  VisualShaderNodeVarying ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_OUTPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeVaryingSetter ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  VisualShaderNodeVaryingGetter  :  public  VisualShaderNodeVarying  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									GDCLASS ( VisualShaderNodeVaryingGetter ,  VisualShaderNodeVarying ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								public :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_caption ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_input_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_input_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_input_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  int  get_output_port_count ( )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  PortType  get_output_port_type ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  String  get_output_port_name ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									virtual  bool  has_output_port_preview ( int  p_port )  const  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-09 15:02:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									virtual  Category  get_category ( )  const  override  {  return  CATEGORY_INPUT ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-09 17:02:13 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									VisualShaderNodeVaryingGetter ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-05 22:57:24 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								extern  String  make_unique_id ( VisualShader : : Type  p_type ,  int  p_id ,  const  String  & p_name ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-07-14 18:15:42 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# endif  // VISUAL_SHADER_H