Afterimage 3D (WebGL API)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
<!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - postprocessing - afterimage</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <link type="text/css" rel="stylesheet" href="main.css"> </head> <body> <script src="../build/three.js"></script> <script src="js/shaders/CopyShader.js"></script> <script src="js/shaders/AfterimageShader.js"></script> <script src="js/postprocessing/EffectComposer.js"></script> <script src="js/postprocessing/RenderPass.js"></script> <script src="js/postprocessing/MaskPass.js"></script> <script src="js/postprocessing/ShaderPass.js"></script> <script src="js/postprocessing/AfterimagePass.js"></script> <script src="js/libs/dat.gui.min.js" type="text/javascript" charset="utf-8"></script> <script> var camera, scene, renderer, composer; var mesh; var afterimagePass; var params = { enable: true }; init(); createGUI(); animate(); function init() { renderer = new THREE.WebGLRenderer(); renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 ); camera.position.z = 400; scene = new THREE.Scene(); scene.fog = new THREE.Fog( 0x000000, 1, 1000 ); var geometry = new THREE.BoxBufferGeometry( 150, 150, 150, 2, 2, 2 ); var material = new THREE.MeshNormalMaterial(); mesh = new THREE.Mesh( geometry, material ); scene.add( mesh ); // postprocessing composer = new THREE.EffectComposer( renderer ); composer.addPass( new THREE.RenderPass( scene, camera ) ); afterimagePass = new THREE.AfterimagePass(); composer.addPass( afterimagePass ); window.addEventListener( 'resize', onWindowResize, false ); } function createGUI() { var gui = new dat.GUI( { name: 'Damp setting' } ); gui.add( afterimagePass.uniforms[ "damp" ], 'value', 0, 1 ).step( 0.001 ); gui.add( params, 'enable' ); } function onWindowResize() { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); composer.setSize( window.innerWidth, window.innerHeight ); } function animate() { requestAnimationFrame( animate ); mesh.rotation.x += 0.005; mesh.rotation.y += 0.01; if ( params.enable ) { composer.render(); } else { renderer.render( scene, camera ); } } </script> </body> </html> Source URL: https://raw.githubusercontent.com/mrdoob/three.js/master/examples/webgl_postprocessing_afterimage.html |
2010). Opposing effects of attention and consciousness on afterimages. Proceedings of the National Academy of Sciences
. (Plain numerical DOI: 10.1073/pnas.0913292107
DOI URL
directSciHub download
Show/hide publication abstract
2001). Effects of voluntary attention on structured afterimages. Perception
. (Plain numerical DOI: 10.1068/p3127
DOI URL
directSciHub download
Show/hide publication abstract
2015). The effect of eye movements and blinks on afterimage appearance and duration. Journal of Vision
. (Plain numerical DOI: 10.1167/15.3.20
DOI URL
directSciHub download
Show/hide publication abstract
2015). Afterimages are biased by top-down information. Perception
. (Plain numerical DOI: 10.1177/0301006615596900
DOI URL
directSciHub download
Show/hide publication abstract
2007). Attentional effects on afterimages: Theory and data. Vision Research
. (Plain numerical DOI: 10.1016/j.visres.2007.04.024
DOI URL
directSciHub download
Show/hide publication abstract
1995). The paradoxes of digital photography. Photography after Photography
. (Show/hide publication abstract
2005). Dynamic predictive coding by the retina. Nature
. (Plain numerical DOI: 10.1038/nature03689
DOI URL
directSciHub download