Open perminder-17 opened 4 months ago
Tagging WebGL stewards for their inputs, let me know what you think! @aferriss, @davepagurek ,@aceslowman, @ShenpaiSharma, @ChihYungChang, @teragramgius, @JazerUCSB, @richardegil, @itsjoopark, @Gaurav-1306, @jeanetteandrews
Also let me know what are your plans on the implementation part. Thankyou ;)
I think the main technical hurdle here is that we only have access to depth information on framebuffers, so this would involve looking into https://github.com/processing/p5.js/issues/5571 again.
If we have a default framebuffer for the main canvas, we'd need to:
draw
?draw
, e.g. in button click handlers?
Increasing access
The feature request entails an enhancement to the current functionality of the filters() function. It proposes the addition of a third parameter, allowing for depth access when applying filters.
Most appropriate sub-area of p5.js?
Feature request details
This parameter would be utilized in the following format:
filter(BLUR, BLUR-VALUE, DEPTH)
. Previously, our implementation relied onp5.Graphics
, which facilitated filter access through a hidden WEBGL canvas. Now, with the transition toframebuffers
, which serve a similar purpose, we have the opportunity to incorporate depth into filter shaders. Initially, this update will focus on integrating depth into filters applied through framebuffers. Subsequently, we plan to extend this capability to encompass 2D filters as well, ensuring a comprehensive enhancement to our filtering system. Maybe giving depth access to 2D filters can be a follow-up update.Following the implementation of depth buffers for filters, we can expand the range of available filters that utilize depth, such as adding a
Fog
filter. The addition of depth is crucial for the Fog filter, as it enables objects closer to the viewer to be less obscured by fog, while objects farther away appear more obscured.An image I found from photoshop:- Maybe a depth blur filter will look something like-
Maybe a depth fog filter will look something like:-(maybe fog can be a followup update after adding depth access to filters)