diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-01-11 22:50:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-01-12 02:51:15 +0300 |
commit | 9f6e09bd8c14ca7ae61f6f1a0b71801e06429d8b (patch) | |
tree | a4ea7a8e2240188bac0d0eabe79b5a30e26d1fbc /source/blender/gpu | |
parent | 0bd20aa7df2ad7710f92e00d9dc72d826f16762a (diff) |
Drawing API: shgroup_instance and shgroup_instance_alpha clarification
shgroup_instance_alpha was getting a color[4] but would only use the
alpha defined upon creation of the shading group.
This was very limiting since it wouldn't allow for different instances
to have different alpha values.
Patch made with Clément Foucault (he made the code of it, while I fixed
all the parts of the code that were relying on shgroup_instance_alpha.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl index 1ec158ae15c..0d0413fef94 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl @@ -1,13 +1,12 @@ uniform mat4 ViewProjectionMatrix; -uniform float alpha; /* ---- Instantiated Attribs ---- */ in vec3 pos; /* ---- Per instance Attribs ---- */ in mat4 InstanceModelMatrix; -in vec3 color; +in vec4 color; #ifdef UNIFORM_SCALE in float size; #else @@ -19,5 +18,5 @@ flat out vec4 finalColor; void main() { gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pos * size, 1.0); - finalColor = vec4(color, alpha); + finalColor = color; } |