You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms: -'global' -'instance' This allows them to reference values outside the material.
This commit is contained in:
@@ -57,6 +57,7 @@ public:
|
||||
ShaderLanguage::ShaderNode::Uniform::Hint hint;
|
||||
ShaderLanguage::TextureFilter filter;
|
||||
ShaderLanguage::TextureRepeat repeat;
|
||||
bool global;
|
||||
};
|
||||
|
||||
Vector<Texture> texture_uniforms;
|
||||
@@ -70,6 +71,7 @@ public:
|
||||
String fragment;
|
||||
String light;
|
||||
|
||||
bool uses_global_textures;
|
||||
bool uses_fragment_time;
|
||||
bool uses_vertex_time;
|
||||
};
|
||||
@@ -86,6 +88,8 @@ public:
|
||||
int base_texture_binding_index = 0;
|
||||
int texture_layout_set = 0;
|
||||
String base_uniform_string;
|
||||
String global_buffer_array_variable;
|
||||
String instance_uniform_index_variable;
|
||||
uint32_t base_varying_index = 0;
|
||||
};
|
||||
|
||||
@@ -113,6 +117,8 @@ private:
|
||||
|
||||
DefaultIdentifierActions actions;
|
||||
|
||||
static ShaderLanguage::DataType _get_variable_type(const StringName &p_type);
|
||||
|
||||
public:
|
||||
Error compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user