Update math.glsl

fixing the float
This commit is contained in:
onelsonic 2020-12-16 18:57:25 +01:00 committed by GitHub
parent 882dea8d6c
commit a89e3923e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,8 +20,8 @@ float rand(const vec2 co) { // Unreliable
}
vec2 rand2(const vec2 coord) {
const float width = 1100;
const float height = 500;
const float width = 1100.0;
const float height = 500.0;
float noiseX = ((fract(1.0 - coord.s * (width / 2.0)) * 0.25) + (fract(coord.t * (height / 2.0)) * 0.75)) * 2.0 - 1.0;
float noiseY = ((fract(1.0 - coord.s * (width / 2.0)) * 0.75) + (fract(coord.t * (height / 2.0)) * 0.25)) * 2.0 - 1.0;
return vec2(noiseX, noiseY);