提交 d3687ca3 编写于 作者: M Michal Polko

Changed SMAA to use base64 textures

上级 0c1f71e5
......@@ -188,7 +188,7 @@ THREE.SMAAShader = [ {
// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
// e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
"e.r = bias + e.r * scale;",
"return 255.0 * texture2D( searchTex, e, 0.0 ).a;",
"return 255.0 * texture2D( searchTex, e, 0.0 ).r;",
"}",
"float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
......
......@@ -33,14 +33,12 @@
var textureLoader = new THREE.TextureLoader();
textureLoader.load( "textures/smaa-area.png", function( areaTexture ) {
textureLoader.load( "textures/brick_diffuse.jpg", function( meshTexture ) {
init( areaTexture, meshTexture );
animate();
});
} );
textureLoader.load( "textures/brick_diffuse.jpg", function( meshTexture ) {
init( meshTexture );
animate();
});
function init( areaTexture, meshTexture ) {
function init( meshTexture ) {
renderer = new THREE.WebGLRenderer( { antialias: false } );
renderer.setPixelRatio( window.devicePixelRatio );
......@@ -67,7 +65,7 @@
composer = new THREE.EffectComposer( renderer );
composer.addPass( new THREE.RenderPass( scene, camera ) );
pass = new THREE.SMAAPass( window.innerWidth, window.innerHeight, areaTexture );
pass = new THREE.SMAAPass( window.innerWidth, window.innerHeight );
pass.renderToScreen = true;
composer.addPass( pass );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册