fix Stage 1 water effect on Intel UHD (#189)
This commit is contained in:
parent
f4a3207f61
commit
00cd15af21
3 changed files with 7 additions and 1 deletions
BIN
resources/00-taisei.pkgdir/shader/lib/.util.glslh.swp
Normal file
BIN
resources/00-taisei.pkgdir/shader/lib/.util.glslh.swp
Normal file
Binary file not shown.
|
@ -5,6 +5,7 @@
|
|||
#include "defs.glslh"
|
||||
|
||||
const float pi = 3.141592653589793; // as supplied by google
|
||||
const float tau = 2 * pi;
|
||||
|
||||
vec2 dir(float a) {
|
||||
return vec2(cos(a), sin(a));
|
||||
|
|
|
@ -12,8 +12,13 @@ float smoothNoise(vec2 p) {
|
|||
p -= f;
|
||||
f *= f * (3 - f - f);
|
||||
|
||||
// Intel's sin() function breaks down with values over 1e4 (yes, really)
|
||||
// get rid of some bits here w/o sacrificing the nice effect
|
||||
vec4 a = vec4(0, 1, 27, 28) + p.x + p.y * 27;
|
||||
vec4 b = mod(a, tau);
|
||||
|
||||
// WARNING: Some versions of the Windows AMD driver choke on temp_mat = mat2(temp_vec)
|
||||
vec4 temp_vec = fract(sin(vec4(0, 1, 27, 28) + p.x + p.y * 27) * 1e5);
|
||||
vec4 temp_vec = fract(sin(b) * 1e5);
|
||||
mat2 temp_mat = mat2(temp_vec.x, temp_vec.y, temp_vec.z, temp_vec.w);
|
||||
|
||||
return dot(temp_mat * vec2(1 - f.y, f.y), vec2(1 - f.x, f.x));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue