processing / processing/p5.js

Introduce Depth Access for Filters Functionality

Open
#6,818 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:WebGL Feature Request
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

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?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)
Feature request details

This parameter would be utilized in the following format: filter(BLUR, BLUR-VALUE, DEPTH). Previously, our implementation relied on p5.Graphics, which facilitated filter access through a hidden WEBGL canvas. Now, with the transition to framebuffers, 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-

depth blur

Maybe a depth fog filter will look something like:-(maybe fog can be a followup update after adding depth access to filters)

depth fog

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the WebGL filters() function and the framebuffer path mentioned in the request, then inspect how filter(BLUR, BLUR-VALUE) currently handles its inputs. Define the framebuffer depth-access behavior first; the initial work is done when filters applied through framebuffers can use depth, with 2D filter support and depth-based filters treated as follow-ups.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.