Skip to content

Commit

Permalink
Fix result on android
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Apr 9, 2024
1 parent 6ba12c9 commit 8f0687c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shader/rand/stratified.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export const stratified_functions = /* glsl */`
// tile the small noise texture across the entire screen
ivec2 noiseSize = ivec2( textureSize( stratifiedOffsetTexture, 0 ) );
pixelSeed = texelFetch( stratifiedOffsetTexture, ivec2( screenCoord.xy ) % noiseSize, 0 );
ivec2 pixel = ivec2( screenCoord.xy ) % noiseSize;
vec2 pixelWidth = 1.0 / vec2( noiseSize );
vec2 uv = vec2( pixel ) * pixelWidth + pixelWidth * 0.5;
// note that using "texelFetch" here seems to break Android for some reason
pixelSeed = texture( stratifiedOffsetTexture, uv );
}
Expand Down

0 comments on commit 8f0687c

Please sign in to comment.