Skip to content

Commit

Permalink
smol migration notice
Browse files Browse the repository at this point in the history
  • Loading branch information
N8 committed Nov 20, 2023
1 parent 6edd660 commit ae0bbe1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Scene w/ AO applied:

[![screenshot](example/tutorial/contrast.jpeg)](https://n8python.github.io/n8ao/example/)


# Installation

From npm: `npm install n8ao` -> `import {N8AOPass} from "n8ao"`
Expand Down Expand Up @@ -68,7 +67,7 @@ import { EffectComposer, RenderPass } from "postprocessing";
// ...

const composer = new EffectComposer(renderer);
/* Only difference is that N8AOPostPass requires a RenderPass before it, whereas N8AOPass replaces the render pass. Everything else is identical. */
/* The only difference is that N8AOPostPass requires a RenderPass before it, whereas N8AOPass replaces the render pass. Everything else is identical. */
composer.addPass(new RenderPass(scene, camera));
const n8aopass = new N8AOPostPass(
scene,
Expand Down Expand Up @@ -99,7 +98,6 @@ n8aopass.configuration.aoRadius = 5.0;
n8aopass.configuration.distanceFalloff = 1.0;
n8aopass.configuration.intensity = 5.0;
n8aopass.configuration.color = new THREE.Color(0, 0, 0);

```

They are covered below:
Expand All @@ -117,6 +115,9 @@ They are covered below:
|:---:|:---:|:---:|
| Distance Falloff 0.1 | Distance Falloff 1 | Distance Falloff 5 |

### Migration Notice
The API changed slightly with N8AO 1.7 - the only change you should have to make is adjusting your `distanceFalloff` parameter - choosing 1.0 is a safe value. For the exact same results you had before, you can do `distanceFalloff = 5.0 * oldDistanceFalloff / radius`.

`intensity: number` - A purely artistic control for the intensity of the AO - runs the ao through the function `pow(ao, intensity)`, which has the effect of darkening areas with more ambient occlusion. Useful to make the effect more pronounced. An intensity of 2 generally produces soft ambient occlusion that isn't too noticeable, whereas one of 5 produces heavily prominent ambient occlusion.

`color: THREE.Color` - The color of the ambient occlusion. By default, it is black, but it can be changed to any color to offer a crude approximation of global illumination. Recommended in scenes where bounced light has a uniform "color", for instance a scene that is predominantly lit by a blue sky. The color is expected to be in the sRGB color space, and is automatically converted to linear space for you. Keep the color pretty dark for sensible results.
Expand Down Expand Up @@ -251,7 +252,7 @@ N8AOPass supports stencil buffers, but you must enable them via `configuration.s
n8aopass.configuration.stencil = true;
```

N8AOPostPass does not have such on option, as `pmndrs/postprocessing` has its own API for stencil buffers, which is shown below:
N8AOPostPass does not have such an option, as `pmndrs/postprocessing` has its own API for stencil buffers, which is shown below:

```js
const composer = new EffectComposer(renderer, {
Expand Down

0 comments on commit ae0bbe1

Please sign in to comment.