Skip to content

add fog #5878

Closed
Closed
add fog#5878
@titoasty

Description

@titoasty

Increasing Access

Unsure

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
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

Feature request details

Hi,

Would it be possible to add fog for WebGL rendering?

I tried adding it by hijacking some methods, here's how I did it:
https://github.com/titoasty/p5.js-boost/blob/main/fog.js
(it adds the function fog(r, g, b, start, end))

And the shader, based of phong.frag:
https://github.com/titoasty/p5.js-boost/blob/main/assets/shaders/phongFog.frag

The shader code comes from here: https://github.com/hughsk/glsl-fog

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions