Skip to content

Commit d3687ca

Browse files
committed
Changed SMAA to use base64 textures
1 parent 0c1f71e commit d3687ca

File tree

4 files changed

+23
-63
lines changed

4 files changed

+23
-63
lines changed

examples/js/postprocessing/SMAAPass.js

Lines changed: 16 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/shaders/SMAAShader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ THREE.SMAAShader = [ {
188188
// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
189189
// e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
190190
"e.r = bias + e.r * scale;",
191-
"return 255.0 * texture2D( searchTex, e, 0.0 ).a;",
191+
"return 255.0 * texture2D( searchTex, e, 0.0 ).r;",
192192
"}",
193193

194194
"float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",

examples/textures/smaa-area.png

-32.4 KB
Binary file not shown.

examples/webgl_postprocessing_smaa.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@
3333

3434
var textureLoader = new THREE.TextureLoader();
3535

36-
textureLoader.load( "textures/smaa-area.png", function( areaTexture ) {
37-
textureLoader.load( "textures/brick_diffuse.jpg", function( meshTexture ) {
38-
init( areaTexture, meshTexture );
39-
animate();
40-
});
41-
} );
36+
textureLoader.load( "textures/brick_diffuse.jpg", function( meshTexture ) {
37+
init( meshTexture );
38+
animate();
39+
});
4240

43-
function init( areaTexture, meshTexture ) {
41+
function init( meshTexture ) {
4442

4543
renderer = new THREE.WebGLRenderer( { antialias: false } );
4644
renderer.setPixelRatio( window.devicePixelRatio );
@@ -67,7 +65,7 @@
6765
composer = new THREE.EffectComposer( renderer );
6866
composer.addPass( new THREE.RenderPass( scene, camera ) );
6967

70-
pass = new THREE.SMAAPass( window.innerWidth, window.innerHeight, areaTexture );
68+
pass = new THREE.SMAAPass( window.innerWidth, window.innerHeight );
7169
pass.renderToScreen = true;
7270
composer.addPass( pass );
7371

0 commit comments

Comments
 (0)