Skip to content

Commit

Permalink
-Fixed shader lang to not be able to get scalar from matrix (ie mat.x…
Browse files Browse the repository at this point in the history
…), to make it more GLSL compatible

-Fixed referencing of world_transform in fragment shader not working
-Fixed unsycn bug related to getting shader param list from the server
-Fixed getting all textures from shader properly, fixes godotengine#8353
  • Loading branch information
reduz authored and amugana committed Jun 28, 2017
1 parent 7a2b863 commit 04bf87e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion drivers/gles3/rasterizer_storage_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,11 @@ void RasterizerStorageGLES3::shader_get_param_list(RID p_shader, List<PropertyIn

for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) {

order[E->get().order] = E->key();
if (E->get().texture_order >= 0) {
order[E->get().texture_order + 100000] = E->key();
} else {
order[E->get().order] = E->key();
}
}

for (Map<int, StringName>::Element *E = order.front(); E; E = E->next()) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ VERTEX_SHADER_CODE
*/

uniform highp mat4 world_transform;

#define M_PI 3.14159265359

/* Varyings */
Expand Down
2 changes: 0 additions & 2 deletions scene/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,8 +1370,6 @@ void SpatialMaterial::_bind_methods() {
BIND_CONSTANT(BILLBOARD_ENABLED);
BIND_CONSTANT(BILLBOARD_FIXED_Y);
BIND_CONSTANT(BILLBOARD_PARTICLES);


}

SpatialMaterial::SpatialMaterial()
Expand Down
6 changes: 4 additions & 2 deletions servers/visual/shader_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2549,12 +2549,14 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons

} break;

default: {}
default: {
ok = false;
}
}

if (!ok) {

_set_error("Invalid member for expression: ." + ident);
_set_error("Invalid member for " + get_datatype_name(dt) + " expression: ." + ident);
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion servers/visual/visual_server_wrap_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class VisualServerWrapMT : public VisualServer {
FUNC2(shader_set_code, RID, const String &)
FUNC1RC(String, shader_get_code, RID)

FUNC2C(shader_get_param_list, RID, List<PropertyInfo> *)
FUNC2SC(shader_get_param_list, RID, List<PropertyInfo> *)

FUNC3(shader_set_default_texture_param, RID, const StringName &, RID)
FUNC2RC(RID, shader_get_default_texture_param, RID, const StringName &)
Expand Down

0 comments on commit 04bf87e

Please sign in to comment.