From 62e0effed64f060a524db1d627f58e271eb260f2 Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 27 Dec 2017 12:31:21 +0800 Subject: [PATCH] Rename input variables --- data/shaders/sp_grass_pass.vert | 4 ++-- data/shaders/sp_normal_visualizer.vert | 4 ++-- data/shaders/sp_pass.vert | 10 +++++----- data/shaders/sp_skinning.vert | 12 ++++++------ data/shaders/sp_skinning_shadow.vert | 4 ++-- src/graphics/sp/sp_mesh_buffer.cpp | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/shaders/sp_grass_pass.vert b/data/shaders/sp_grass_pass.vert index 18cdb6467..9b9cca9ff 100644 --- a/data/shaders/sp_grass_pass.vert +++ b/data/shaders/sp_grass_pass.vert @@ -19,7 +19,7 @@ layout(location = 9) in vec4 i_rotation; #endif layout(location = 10) in vec4 i_scale; -layout(location = 12) in ivec2 i_misc_data_two; +layout(location = 12) in ivec2 i_misc_data; #if defined(Use_Bindless_Texture) layout(location = 13) in uvec4 i_bindless_texture_0; @@ -86,6 +86,6 @@ void main() normal = (u_view_matrix * vec4(world_normal, 0.0)).xyz; uv = i_uv; - hue_change = float(i_misc_data_two.y) * 0.01; + hue_change = float(i_misc_data.y) * 0.01; gl_Position = u_projection_view_matrix * world_position; } diff --git a/data/shaders/sp_normal_visualizer.vert b/data/shaders/sp_normal_visualizer.vert index f95b1a1a0..a6c53a21e 100644 --- a/data/shaders/sp_normal_visualizer.vert +++ b/data/shaders/sp_normal_visualizer.vert @@ -25,7 +25,7 @@ layout(location = 9) in vec4 i_rotation; #endif layout(location = 10) in vec4 i_scale; -layout(location = 12) in ivec2 i_misc_data_two; +layout(location = 12) in ivec2 i_misc_data; #stk_include "utils/get_world_location.vert" @@ -48,7 +48,7 @@ void main() vec4 skinned_position = vec4(0.0); vec4 skinned_normal = vec4(0.0); vec4 skinned_tangent = vec4(0.0); - int skinning_offset = i_misc_data_two.x; + int skinning_offset = i_misc_data.x; for (int i = 0; i < 4; i++) { diff --git a/data/shaders/sp_pass.vert b/data/shaders/sp_pass.vert index a63d23d38..e88e3fc60 100644 --- a/data/shaders/sp_pass.vert +++ b/data/shaders/sp_pass.vert @@ -25,8 +25,8 @@ layout(location = 9) in vec4 i_rotation; #endif layout(location = 10) in vec4 i_scale; -layout(location = 11) in vec2 i_misc_data; -layout(location = 12) in ivec2 i_misc_data_two; +layout(location = 11) in vec2 i_texture_trans; +layout(location = 12) in ivec2 i_misc_data; #if defined(Use_Bindless_Texture) layout(location = 13) in uvec4 i_bindless_texture_0; @@ -102,12 +102,12 @@ void main() ).xyz; normal = (u_view_matrix * vec4(world_normal, 0.0)).xyz; - uv = vec2(i_uv.x + (i_misc_data.x * i_normal.w), - i_uv.y + (i_misc_data.y * i_normal.w)); + uv = vec2(i_uv.x + (i_texture_trans.x * i_normal.w), + i_uv.y + (i_texture_trans.y * i_normal.w)); uv_two = i_uv_two; color = i_color.zyxw; camdist = length(u_view_matrix * world_position); - hue_change = float(i_misc_data_two.y) * 0.01; + hue_change = float(i_misc_data.y) * 0.01; gl_Position = u_projection_view_matrix * world_position; } diff --git a/data/shaders/sp_skinning.vert b/data/shaders/sp_skinning.vert index 5a2710eff..832d36d8b 100644 --- a/data/shaders/sp_skinning.vert +++ b/data/shaders/sp_skinning.vert @@ -32,8 +32,8 @@ layout(location = 9) in vec4 i_rotation; #endif layout(location = 10) in vec4 i_scale; -layout(location = 11) in vec2 i_misc_data; -layout(location = 12) in ivec2 i_misc_data_two; +layout(location = 11) in vec2 i_texture_trans; +layout(location = 12) in ivec2 i_misc_data; #if defined(Use_Bindless_Texture) layout(location = 13) in uvec4 i_bindless_texture_0; @@ -102,7 +102,7 @@ void main() vec4 skinned_position = vec4(0.0); vec4 skinned_normal = vec4(0.0); vec4 skinned_tangent = vec4(0.0); - int skinning_offset = i_misc_data_two.x; + int skinning_offset = i_misc_data.x; for (int i = 0; i < 4; i++) { @@ -145,12 +145,12 @@ void main() ).xyz; normal = (u_view_matrix * vec4(world_normal, 0.0)).xyz; - uv = vec2(i_uv.x + (i_misc_data.x * i_normal.w), - i_uv.y + (i_misc_data.y * i_normal.w)); + uv = vec2(i_uv.x + (i_texture_trans.x * i_normal.w), + i_uv.y + (i_texture_trans.y * i_normal.w)); uv_two = i_uv_two; color = i_color.zyxw; camdist = length(u_view_matrix * world_position); - hue_change = float(i_misc_data_two.y) * 0.01; + hue_change = float(i_misc_data.y) * 0.01; gl_Position = u_projection_view_matrix * world_position; } diff --git a/data/shaders/sp_skinning_shadow.vert b/data/shaders/sp_skinning_shadow.vert index 3251a8c6d..309b0899e 100644 --- a/data/shaders/sp_skinning_shadow.vert +++ b/data/shaders/sp_skinning_shadow.vert @@ -20,7 +20,7 @@ layout(location = 9) in vec4 i_rotation; #endif layout(location = 10) in vec4 i_scale; -layout(location = 12) in ivec2 i_misc_data_two; +layout(location = 12) in ivec2 i_misc_data; #if defined(Use_Bindless_Texture) layout(location = 13) in uvec4 i_bindless_texture_0; @@ -80,7 +80,7 @@ void main() vec4 idle_position = vec4(i_position, 1.0); vec4 skinned_position = vec4(0.0); - int skinning_offset = i_misc_data_two.x; + int skinning_offset = i_misc_data.x; for (int i = 0; i < 4; i++) { diff --git a/src/graphics/sp/sp_mesh_buffer.cpp b/src/graphics/sp/sp_mesh_buffer.cpp index 8c0e98a1d..2e4075c5f 100644 --- a/src/graphics/sp/sp_mesh_buffer.cpp +++ b/src/graphics/sp/sp_mesh_buffer.cpp @@ -415,7 +415,7 @@ void SPMeshBuffer::recreateVAO(unsigned i) glEnableVertexAttribArray(10); glVertexAttribPointer(10, 4, GL_HALF_FLOAT, GL_FALSE, 32, (void*)16); glVertexAttribDivisorARB(10, 1); - // Misc data (texture translation) + // Texture translation glEnableVertexAttribArray(11); glVertexAttribPointer(11, 2, GL_HALF_FLOAT, GL_FALSE, 32, (void*)24); glVertexAttribDivisorARB(11, 1);