# AfterImagePass on white scene background?

**URL:** <https://discourse.threejs.org/t/afterimagepass-on-white-scene-background/51939>\
**Category:** Questions\
**Tags:** afterimagepass\
**Created:** [May 24, 2023, 12:01am UTC](https://discourse.threejs.org/t/afterimagepass-on-white-scene-background/51939 "2023-05-24T00:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unix](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/unix/32/23661_2.png) [@unix](https://discourse.threejs.org/u/unix)\
**Post date:** [May 24, 2023, 12:01am UTC](https://discourse.threejs.org/t/afterimagepass-on-white-scene-background/51939/1 "2023-05-24T00:01:31Z")

</div>

Hello,

I have a simple scene with rotating an object, when the scene background is set to black, you can cleary see the AfterImagePass and the result looks amazing, howerer if you switch to light mode where the scene background is set to white, you dont see that AfterImagePass effect anymore and during the rotation the model is looking more transparent instead.  
Is this how it is intended to be or am I missing something?

```javascript
const afterimagePass = new AfterimagePass();

const composer = new EffectComposer(renderer);
composer.addPass(new RenderPass(scene, camera));
composer.addPass(afterimagePass);

```

here is how I initilize the passes,  
and here is how it is animated:

```javascript
   function render() {
      requestAnimationFrame(render);

      stats.update();

      composer.render();
    }

```

render() is initialized as soon as the model is loaded.

Any tips or advices are welcomed.  
Thank you!

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [May 24, 2023, 1:39am UTC](https://discourse.threejs.org/t/afterimagepass-on-white-scene-background/51939/2 "2023-05-24T01:39:49Z")

</div>

If you look at the source code for AfterImagePass here, the effect is really driven by brighter areas of the scene:

> <https://github.com/mrdoob/three.js/blob/c0f9764c0224e97f33f2487c4123b96429e18d21/examples/jsm/shaders/AfterimageShader.js#L45-L50>

If the background is white (max brightness) you’ll get the reverse effect, where the background creates an “after image” over the content. It might be best to modify this example to create the effect you’re after.

---

<div class="post-metadata">

**Author:** ![unix](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/unix/32/23661_2.png) [@unix](https://discourse.threejs.org/u/unix)\
**Post date:** [May 24, 2023, 10:38am UTC](https://discourse.threejs.org/t/afterimagepass-on-white-scene-background/51939/3 "2023-05-24T10:38:49Z")

</div>

Oh now I see, I didnt really dug into the shader itself, thank you very much for the clarification, that sums it up.

Best regards!
