Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shader noise generation on GLES #2858

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1004,11 +1004,11 @@ class ShaderNoise : public ShaderPart
ShaderNoise(const opengl::GLInfo & _glinfo)
{
m_part =
"uniform float uNoiseSeed; \n"
"uniform mediump float uNoiseSeed; \n"
"lowp float snoise() \n"
"{ \n"
" mediump vec2 coord = floor(gl_FragCoord.xy/uScreenScale); \n"
" mediump vec3 p3 = vec3(uNoiseSeed, coord); \n"
" highp vec2 coord = floor(gl_FragCoord.xy/uScreenScale);\n"
" highp vec3 p3 = vec3(uNoiseSeed, coord); \n"
// hash13 from https://www.shadertoy.com/view/4djSRW
" p3 = fract(p3 * .1031); \n"
" p3 += dot(p3, p3.zyx + 31.32); \n"
Expand Down Expand Up @@ -1068,8 +1068,8 @@ class ShaderDither : public ShaderPart
m_part +=
" lowp float mult = 1.0; \n";
m_part +=
" mediump vec2 coord = floor(mult * (gl_FragCoord.xy/uScreenScale)); \n"
" mediump vec3 p3 = vec3(uNoiseSeed, coord); \n"
" highp vec2 coord = floor(mult * (gl_FragCoord.xy/uScreenScale));\n"
" highp vec3 p3 = vec3(uNoiseSeed, coord); \n"
// hash33 from https://www.shadertoy.com/view/4djSRW
" p3 = fract(p3 * vec3(.1031, .1030, .0973)); \n"
" p3 += dot(p3, p3.yxz+33.33); \n"
Expand All @@ -1087,8 +1087,8 @@ class ShaderDither : public ShaderPart
" lowp float mult = 1.0; \n";
m_part +=
" \n"
" mediump vec2 coord = floor(mult * (gl_FragCoord.xy/uScreenScale)); \n"
" mediump vec3 p3 = vec3(uNoiseSeed, coord); \n"
" highp vec2 coord = floor(mult * (gl_FragCoord.xy/uScreenScale));\n"
" highp vec3 p3 = vec3(uNoiseSeed, coord); \n"
// hash13 from https://www.shadertoy.com/view/4djSRW
" p3 = fract(p3 * .1031); \n"
" p3 += dot(p3, p3.zyx + 31.32); \n"
Expand Down