Browse Source

fixed rand() function

master
parent
commit
a95bf9c0f8
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      neercs/video/noise.lolfx
  2. +1
    -1
      neercs/video/render.cpp

+ 1
- 1
neercs/video/noise.lolfx View File

@@ -21,7 +21,7 @@ uniform vec3 retrace;


float rand(in vec2 p,in float t,in float v) float rand(in vec2 p,in float t,in float v)
{ {
return fract(sin(dot(p+t,vec2(12.9898,78.233)))*v);
return fract(sin(dot(p+mod(t,2.0),vec2(12.9898,78.2333)))*v);
} }


void main(void) void main(void)


+ 1
- 1
neercs/video/render.cpp View File

@@ -979,7 +979,7 @@ void Render::Draw3D()
shader_noise->Bind(); shader_noise->Bind();
shader_noise->SetUniform(shader_noise_texture, fbo_front->GetTexture(), 0); shader_noise->SetUniform(shader_noise_texture, fbo_front->GetTexture(), 0);
shader_noise->SetUniform(shader_noise_screen_size, (vec2)screen_size); shader_noise->SetUniform(shader_noise_screen_size, (vec2)screen_size);
shader_noise->SetUniform(shader_noise_time, fmodf(fx_angle, 1.0f));
shader_noise->SetUniform(shader_noise_time, fx_angle);
shader_noise->SetUniform(shader_noise_offset, noise_offset); shader_noise->SetUniform(shader_noise_offset, noise_offset);
shader_noise->SetUniform(shader_noise_noise, noise_noise); shader_noise->SetUniform(shader_noise_noise, noise_noise);
shader_noise->SetUniform(shader_noise_retrace, noise_retrace); shader_noise->SetUniform(shader_noise_retrace, noise_retrace);


Loading…
Cancel
Save