diff options
author | brendor <brendorrmt@gmail.com> | 2018-03-20 01:28:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-20 01:28:41 +0100 |
commit | 7061c28df7bac641351431af20342b44fc439fd5 (patch) | |
tree | 205c8ffdd5bc3574ef1ec0f1e758e86ebf68e0e4 /scene/3d | |
parent | aeb1c67b5b55c769256a8ffc2f9d9095d6fc74da (diff) |
Particles 2D and 3D - fix hue variation not working by transposing the hue matrix
The hue variation matrix is hardcoded as transposed and thus the multiplication always yielded the original color value.
I wanted to keep the matrix and get the same result by switching the operands (getting a result as if the matrix was transposed).
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/particles.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 8617bbc2f6..693b416f6d 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -849,9 +849,9 @@ void ParticlesMaterial::_update_shader() { code += " vec4(1.250, -1.050, -0.203, 0.0),\n"; code += " vec4(0.000, 0.000, 0.000, 0.0)) * hue_rot_s;\n"; if (color_ramp.is_valid()) { - code += " COLOR = textureLod(color_ramp,vec2(CUSTOM.y,0.0),0.0) * hue_rot_mat;\n"; + code += " COLOR = hue_rot_mat * textureLod(color_ramp,vec2(CUSTOM.y,0.0),0.0);\n"; } else { - code += " COLOR = color_value * hue_rot_mat;\n"; + code += " COLOR = hue_rot_mat * color_value;\n"; } if (emission_color_texture.is_valid() && emission_shape >= EMISSION_SHAPE_POINTS) { code += " COLOR*= texelFetch(emission_texture_color,emission_tex_ofs,0);\n"; |