Skip to content

Commit

Permalink
Workaround for float literals problem
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Jul 2, 2023
1 parent d87af1f commit 2b4dbf9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addons/material_maker/shader_functions.tres
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ text = "float dot2(vec2 x) {
}
float rand(vec2 x) {
return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5453);
return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5);
}
vec2 rand2(vec2 x) {
return fract(cos(mod(vec2(dot(x, vec2(13.9898, 8.141)),
dot(x, vec2(3.4562, 17.398))), vec2(3.14))) * 43758.5453);
dot(x, vec2(3.4562, 17.398))), vec2(3.14, 3.14))) * 43758.5);
}
vec3 rand3(vec2 x) {
return fract(cos(mod(vec3(dot(x, vec2(13.9898, 8.141)),
dot(x, vec2(3.4562, 17.398)),
dot(x, vec2(13.254, 5.867))), vec3(3.14))) * 43758.5453);
dot(x, vec2(13.254, 5.867))), vec3(3.14, 3.14, 3.14))) * 43758.5);
}
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
Expand Down

0 comments on commit 2b4dbf9

Please sign in to comment.