You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`draw()` uses the same p5 context as the rest of your sketch! Make sure to wrap your callback code in a `push()` and `pop()` to ensure your settings don't leak out into your non-Framebuffer code.
66
78
- When you `resizeCanvas`, the Framebuffer will automatically resize accordingly. You probably will want to clear it and redraw to it if you had a texture cached.
67
79
80
+
A live example: https://davepagurek.github.io/p5.Framebuffer/examples/simple
81
+
68
82
### Depth of field blur
69
83
70
84
The library provides a helper that bundles a Framebuffer with a shader that applies focal blur, leaving objects at a provided distance in focus and blurring things more the farther away from that point they are.
71
85
72
86
Create a blur renderer and draw inside its `draw` callback. When you tell it to `focusHere()`, anything drawn at that transformed position will be in focus. You can use standard p5 `translate` calls to position the focal point.
- Draw the scene defined in the callback with blur
@@ -116,14 +141,18 @@ Methods on `BlurRenderer`:
116
141
- Control how many random samples to use in the blur shader. More samples will look smoother but is more computationally intensive.
117
142
- Defaults to 15
118
143
119
-
A live example: https://davepagurek.github.io/p5.Framebuffer/examples/shadows
144
+
A live example: https://davepagurek.github.io/p5.Framebuffer/examples/blur
120
145
121
146
### Contact Shadows
122
147
123
148
The library provides a helper that bundles a Framebuffer with a shader that applies Ambient Occlusion shadows. This approximates the shadows one would see if there was uniform light hitting an object from all sides. In practice, it adds shadows in areas where objects get close to each other.
124
149
125
150
Create a shadow renderer and draw inside its `draw` callback. The renderer will add shadows to the result.
0 commit comments