@react-three/postprocessing 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +81 -81
- package/dist/index.d.ts +1 -0
- package/dist/index.js +555 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -68
- package/src/EffectComposer.test.tsx +126 -126
- package/src/EffectComposer.tsx +200 -200
- package/src/Selection.tsx +46 -46
- package/src/effects/ASCII.tsx +135 -135
- package/src/effects/Autofocus.tsx +153 -153
- package/src/effects/Bloom.tsx +6 -6
- package/src/effects/BrightnessContrast.tsx +4 -4
- package/src/effects/ChromaticAberration.tsx +5 -5
- package/src/effects/ColorAverage.tsx +15 -15
- package/src/effects/ColorDepth.tsx +4 -4
- package/src/effects/Depth.tsx +4 -4
- package/src/effects/DepthOfField.tsx +89 -89
- package/src/effects/DotScreen.tsx +4 -4
- package/src/effects/FXAA.tsx +4 -4
- package/src/effects/Glitch.tsx +40 -40
- package/src/effects/GodRays.tsx +16 -16
- package/src/effects/Grid.tsx +21 -21
- package/src/effects/HueSaturation.tsx +4 -4
- package/src/effects/LUT.tsx +26 -26
- package/src/effects/LensFlare.tsx +611 -611
- package/src/effects/N8AO.tsx +81 -81
- package/src/effects/Noise.tsx +4 -4
- package/src/effects/Outline.tsx +117 -117
- package/src/effects/Pixelation.tsx +15 -15
- package/src/effects/Ramp.tsx +150 -150
- package/src/effects/SMAA.tsx +4 -4
- package/src/effects/SSAO.tsx +41 -41
- package/src/effects/ScanlineEffect.tsx +7 -7
- package/src/effects/SelectiveBloom.tsx +126 -126
- package/src/effects/Sepia.tsx +4 -4
- package/src/effects/ShockWave.tsx +4 -4
- package/src/effects/Texture.tsx +23 -23
- package/src/effects/TiltShift.tsx +4 -4
- package/src/effects/TiltShift2.tsx +90 -90
- package/src/effects/ToneMapping.tsx +6 -6
- package/src/effects/Vignette.tsx +4 -4
- package/src/effects/Water.tsx +35 -35
- package/src/index.ts +40 -40
- package/src/util.tsx +55 -55
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 react-spring
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 react-spring
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
# react-postprocessing
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
4
|
-
[](https://pmndrs.github.io/react-postprocessing)
|
|
5
|
-
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
6
|
-
[](https://discord.gg/ZZjjNvJ)
|
|
7
|
-
[](https://github.com/codespaces/new?template_repository=pmndrs%2Freact-postprocessing)
|
|
8
|
-
|
|
9
|
-
`react-postprocessing` is a
|
|
10
|
-
[postprocessing](https://github.com/pmndrs/postprocessing) wrapper for
|
|
11
|
-
[@react-three/fiber](https://github.com/pmndrs/react-three-fiber). This is not
|
|
12
|
-
(yet) meant for complex orchestration of effects, but can save you
|
|
13
|
-
[hundreds of LOC](https://twitter.com/0xca0a/status/1289501594698960897) for a
|
|
14
|
-
straight forward effects-chain.
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install @react-three/postprocessing
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
<p align="center">
|
|
21
|
-
<a href="https://pqrpl.csb.app" target="_blank"><img width="274" src="bubbles.jpg" alt="Bubbles" /></a>
|
|
22
|
-
<a href="https://5jgjz.csb.app" target="_blank"><img width="274" src="control.jpg" alt="Take Control" /></a>
|
|
23
|
-
</p>
|
|
24
|
-
<p align="middle">
|
|
25
|
-
<i>These demos are real, you can click them! They contain the full code, too. 📦</i>
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
|
-
#### Why postprocessing and not three/examples/jsm/postprocessing?
|
|
29
|
-
|
|
30
|
-
From
|
|
31
|
-
[https://github.com/pmndrs/postprocessing](https://github.com/pmndrs/postprocessing#performance)
|
|
32
|
-
|
|
33
|
-
> This library provides an EffectPass which automatically organizes and merges
|
|
34
|
-
> any given combination of effects. This minimizes the amount of render
|
|
35
|
-
> operations and makes it possible to combine many effects without the
|
|
36
|
-
> performance penalties of traditional pass chaining. Additionally, every effect
|
|
37
|
-
> can choose its own blend function.
|
|
38
|
-
>
|
|
39
|
-
> All fullscreen render operations also use a single triangle that fills the
|
|
40
|
-
> screen. Compared to using a quad, this approach harmonizes with modern GPU
|
|
41
|
-
> rasterization patterns and eliminates unnecessary fragment calculations along
|
|
42
|
-
> the screen diagonal. This is especially beneficial for GPGPU passes and
|
|
43
|
-
> effects that use complex fragment shaders.
|
|
44
|
-
|
|
45
|
-
Postprocessing also supports gamma correction out of the box, as well as WebGL2
|
|
46
|
-
MSAA (multi sample anti aliasing), which is react-postprocessing's default, you
|
|
47
|
-
get high performance crisp results w/o jagged edges.
|
|
48
|
-
|
|
49
|
-
#### What does it look like?
|
|
50
|
-
|
|
51
|
-
Here's an example combining a couple of effects
|
|
52
|
-
([live demo](https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?)).
|
|
53
|
-
|
|
54
|
-
<a href="https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?" target="_blank" rel="noopener">
|
|
55
|
-
<img src="bubbles.jpg" alt="Bubbles Demo" />
|
|
56
|
-
</a>
|
|
57
|
-
|
|
58
|
-
```jsx
|
|
59
|
-
import React from 'react'
|
|
60
|
-
import { Bloom, DepthOfField, EffectComposer, Noise, Vignette } from '@react-three/postprocessing'
|
|
61
|
-
import { Canvas } from '@react-three/fiber'
|
|
62
|
-
|
|
63
|
-
function App() {
|
|
64
|
-
return (
|
|
65
|
-
<Canvas>
|
|
66
|
-
{/* Your regular scene contents go here, like always ... */}
|
|
67
|
-
<EffectComposer>
|
|
68
|
-
<DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
|
|
69
|
-
<Bloom luminanceThreshold={0} luminanceSmoothing={0.9} height={300} />
|
|
70
|
-
<Noise opacity={0.02} />
|
|
71
|
-
<Vignette eskil={false} offset={0.1} darkness={1.1} />
|
|
72
|
-
</EffectComposer>
|
|
73
|
-
</Canvas>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Documentation
|
|
79
|
-
|
|
80
|
-
- [react-postprocessing docs](https://docs.pmnd.rs/react-postprocessing)
|
|
81
|
-
- [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/)
|
|
1
|
+
# react-postprocessing
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
4
|
+
[](https://pmndrs.github.io/react-postprocessing)
|
|
5
|
+
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
6
|
+
[](https://discord.gg/ZZjjNvJ)
|
|
7
|
+
[](https://github.com/codespaces/new?template_repository=pmndrs%2Freact-postprocessing)
|
|
8
|
+
|
|
9
|
+
`react-postprocessing` is a
|
|
10
|
+
[postprocessing](https://github.com/pmndrs/postprocessing) wrapper for
|
|
11
|
+
[@react-three/fiber](https://github.com/pmndrs/react-three-fiber). This is not
|
|
12
|
+
(yet) meant for complex orchestration of effects, but can save you
|
|
13
|
+
[hundreds of LOC](https://twitter.com/0xca0a/status/1289501594698960897) for a
|
|
14
|
+
straight forward effects-chain.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @react-three/postprocessing
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://pqrpl.csb.app" target="_blank"><img width="274" src="bubbles.jpg" alt="Bubbles" /></a>
|
|
22
|
+
<a href="https://5jgjz.csb.app" target="_blank"><img width="274" src="control.jpg" alt="Take Control" /></a>
|
|
23
|
+
</p>
|
|
24
|
+
<p align="middle">
|
|
25
|
+
<i>These demos are real, you can click them! They contain the full code, too. 📦</i>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
#### Why postprocessing and not three/examples/jsm/postprocessing?
|
|
29
|
+
|
|
30
|
+
From
|
|
31
|
+
[https://github.com/pmndrs/postprocessing](https://github.com/pmndrs/postprocessing#performance)
|
|
32
|
+
|
|
33
|
+
> This library provides an EffectPass which automatically organizes and merges
|
|
34
|
+
> any given combination of effects. This minimizes the amount of render
|
|
35
|
+
> operations and makes it possible to combine many effects without the
|
|
36
|
+
> performance penalties of traditional pass chaining. Additionally, every effect
|
|
37
|
+
> can choose its own blend function.
|
|
38
|
+
>
|
|
39
|
+
> All fullscreen render operations also use a single triangle that fills the
|
|
40
|
+
> screen. Compared to using a quad, this approach harmonizes with modern GPU
|
|
41
|
+
> rasterization patterns and eliminates unnecessary fragment calculations along
|
|
42
|
+
> the screen diagonal. This is especially beneficial for GPGPU passes and
|
|
43
|
+
> effects that use complex fragment shaders.
|
|
44
|
+
|
|
45
|
+
Postprocessing also supports gamma correction out of the box, as well as WebGL2
|
|
46
|
+
MSAA (multi sample anti aliasing), which is react-postprocessing's default, you
|
|
47
|
+
get high performance crisp results w/o jagged edges.
|
|
48
|
+
|
|
49
|
+
#### What does it look like?
|
|
50
|
+
|
|
51
|
+
Here's an example combining a couple of effects
|
|
52
|
+
([live demo](https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?)).
|
|
53
|
+
|
|
54
|
+
<a href="https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?" target="_blank" rel="noopener">
|
|
55
|
+
<img src="bubbles.jpg" alt="Bubbles Demo" />
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
import React from 'react'
|
|
60
|
+
import { Bloom, DepthOfField, EffectComposer, Noise, Vignette } from '@react-three/postprocessing'
|
|
61
|
+
import { Canvas } from '@react-three/fiber'
|
|
62
|
+
|
|
63
|
+
function App() {
|
|
64
|
+
return (
|
|
65
|
+
<Canvas>
|
|
66
|
+
{/* Your regular scene contents go here, like always ... */}
|
|
67
|
+
<EffectComposer>
|
|
68
|
+
<DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
|
|
69
|
+
<Bloom luminanceThreshold={0} luminanceSmoothing={0.9} height={300} />
|
|
70
|
+
<Noise opacity={0.02} />
|
|
71
|
+
<Vignette eskil={false} offset={0.1} darkness={1.1} />
|
|
72
|
+
</EffectComposer>
|
|
73
|
+
</Canvas>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Documentation
|
|
79
|
+
|
|
80
|
+
- [react-postprocessing docs](https://docs.pmnd.rs/react-postprocessing)
|
|
81
|
+
- [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/index.ts'
|