You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Makes cube maps to be works in visual shaders
This commit is contained in:
@@ -1067,7 +1067,16 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
|
||||
|
||||
VisualShaderNodeUniform *uniform = (VisualShaderNodeUniform *)graph[type].nodes[from_node].node.ptr();
|
||||
if (uniform) {
|
||||
inputs[i] = uniform->get_uniform_name();
|
||||
inputs[i] = "";
|
||||
switch (uniform->get_uniform_type()) {
|
||||
case VisualShaderNodeUniform::UTYPE_CUBEMAP:
|
||||
inputs[i] += "cube_";
|
||||
break;
|
||||
case VisualShaderNodeUniform::UTYPE_SAMPLER2D:
|
||||
inputs[i] += "s2d_";
|
||||
break;
|
||||
}
|
||||
inputs[i] += uniform->get_uniform_name();
|
||||
} else {
|
||||
inputs[i] = "";
|
||||
}
|
||||
@@ -1973,7 +1982,16 @@ void VisualShaderNodeUniform::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "uniform_name"), "set_uniform_name", "get_uniform_name");
|
||||
}
|
||||
|
||||
int VisualShaderNodeUniform::get_uniform_type() const {
|
||||
return (int)uniform_type;
|
||||
}
|
||||
|
||||
void VisualShaderNodeUniform::set_uniform_type(int p_type) {
|
||||
uniform_type = (UniformType)p_type;
|
||||
}
|
||||
|
||||
VisualShaderNodeUniform::VisualShaderNodeUniform() {
|
||||
uniform_type = UTYPE_NONE;
|
||||
}
|
||||
|
||||
////////////// GroupBase
|
||||
|
||||
Reference in New Issue
Block a user