Skip to content

Commit

Permalink
Fix SMAA shader for WebGL2
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Jun 22, 2019
1 parent 3dfedcd commit d1be58e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/js/shaders/SMAAShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ THREE.SMAAWeightsShader = {
"varying vec4 vOffset[3];",
"varying vec2 vPixcoord;",

"#if __VERSION__ == 100",
"vec2 round( vec2 x ) {",
"return sign( x ) * floor( abs( x ) + 0.5 );",
"}",
"#endif",

"float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {",
// Not required if searchTex accesses are set to point:
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/shaders/SMAAShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ var SMAAWeightsShader = {
"varying vec4 vOffset[3];",
"varying vec2 vPixcoord;",

"#if __VERSION__ == 100",
"vec2 round( vec2 x ) {",
"return sign( x ) * floor( abs( x ) + 0.5 );",
"}",
"#endif",

"float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {",
// Not required if searchTex accesses are set to point:
Expand Down

0 comments on commit d1be58e

Please sign in to comment.