Skip to content

Add p5.strands bloom filter example to filter() reference #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

LalitNarayanYadav
Copy link

Added Example: Bloom Effect on a Rotating 3D Cube using p5.strands

Description

This PR adds a new code example under the filter() reference that demonstrates how to apply a bloom (glow) effect using the p5.strands library. The example showcases a rotating 3D cube rendered in WEBGL mode with a subtle post-processing effect.

Code Summary

let strands;

function setup() {
  createCanvas(400, 400, WEBGL);
  strands = new Strands();
  strands.filter(bloom);
}

function draw() {
  strands.draw(() => {
    rotateY(millis() / 1000);
    normalMaterial();
    box(150);
  });
}

function bloom(input) {
  return input.blur(8).brighten(1.5).blend(input, ADD);
}

describe('A rotating 3D cube with a glow (bloom) effect using p5.strands.');

@LalitNarayanYadav
Copy link
Author

fixes #7898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant