diff options
Diffstat (limited to 'scene/resources/shader_graph.h')
-rw-r--r-- | scene/resources/shader_graph.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 55d09b4c38..5c34bedadd 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -66,12 +66,15 @@ public: NODE_VEC_TO_XFORM, // 3 vec input, 1 xform output NODE_SCALAR_INTERP, // scalar interpolation (with optional curve) NODE_VEC_INTERP, // vec3 interpolation (with optional curve) - NODE_SCALAR_INPUT, // scalar uniform (assignable in material) + NODE_COLOR_RAMP, //take scalar, output vec3 + NODE_CURVE_MAP, //take scalar, otput scalar + NODE_SCALAR_INPUT, // scalar uniform (assignable in material) NODE_VEC_INPUT, // vec3 uniform (assignable in material) NODE_RGB_INPUT, // color uniform (assignable in material) NODE_XFORM_INPUT, // mat4 uniform (assignable in material) NODE_TEXTURE_INPUT, // texture input (assignable in material) NODE_CUBEMAP_INPUT, // cubemap input (assignable in material) + NODE_DEFAULT_TEXTURE, NODE_OUTPUT, // output (shader type dependent) NODE_COMMENT, // comment NODE_TYPE_MAX @@ -172,6 +175,7 @@ private: void _update_shader(); void _request_update(); + void _plot_curve(const Vector2& p_a,const Vector2& p_b,const Vector2& p_c,const Vector2& p_d,uint8_t* p_heights,bool *p_useds); void _add_node_code(ShaderType p_type,Node *p_node,const Vector<String>& p_inputs,String& code); Array _get_node_list(ShaderType p_type) const; @@ -313,6 +317,13 @@ public: void vec_func_node_set_function(ShaderType p_which,int p_id,VecFunc p_func); VecFunc vec_func_node_get_function(ShaderType p_which,int p_id) const; + void color_ramp_node_set_ramp(ShaderType p_which,int p_id,const DVector<Color>& p_colors, const DVector<real_t>& p_offsets); + DVector<Color> color_ramp_node_get_colors(ShaderType p_which,int p_id) const; + DVector<real_t> color_ramp_node_get_offsets(ShaderType p_which,int p_id) const; + + void curve_map_node_set_points(ShaderType p_which, int p_id, const DVector<Vector2>& p_points); + DVector<Vector2> curve_map_node_get_points(ShaderType p_which,int p_id) const; + void input_node_set_name(ShaderType p_which,int p_id,const String& p_name); String input_node_get_name(ShaderType p_which,int p_id); @@ -395,7 +406,6 @@ VARIANT_ENUM_CAST( ShaderGraph::GraphError ); class MaterialShaderGraph : public ShaderGraph { OBJ_TYPE( MaterialShaderGraph, ShaderGraph ); - RES_BASE_EXTENSION("sgp"); public: @@ -405,4 +415,17 @@ public: } }; +class CanvasItemShaderGraph : public ShaderGraph { + + OBJ_TYPE( CanvasItemShaderGraph, ShaderGraph ); + +public: + + + CanvasItemShaderGraph() : ShaderGraph(MODE_CANVAS_ITEM) { + + } +}; + + #endif // SHADER_GRAPH_H |