OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Implements filters

Open amylizzle opened this issue 3 years ago • 4 comments

Fixes #294 by implementing filter() and supporting cast.

  • [x] Implement /dm_filter type
  • [x] Implement basic shader processing in UpdateAppearance()
  • [x] Get basic debug shader working (greyscale)
  • [x] Finish the DreamFilter set parameter code
  • [x] Make DreamViewOverlay use RenderInRenderTarget
  • [x] Sort out garbage collection for shader instances
  • [x] Implement multiple shader support

Working shaders:

  • [x] outline
  • [x] greyscale (this one isn't actually in DM, it was just a debug thing, but I could see it being used)
  • [x] Gaussian blur

Things this PR does

  • Fairly heavily modifies the current rendering system to a "ping-pong" rendering system, which allows for repeated applications of shaders where needed.
  • Adds the filter() built-in proc, which returns a DreamObject of type /dm_filter
  • Adds handling for the .filters var on atoms, with appropriate appearance update and listifying behaviour (as per BYOND)
  • Adds the DreamFilterMetaObject which adds appropriate appearance update behaviour to /dm_filter objects
  • Adds the DreamFilter type, which is basically just a meta-data object that can be passed over the network in IconAppearance and holds the necessary data to instantiate the requested shader on the client
  • Adds some shader caching & garbage collection behaviour to ClientAppearanceSystem so we can keep a handle on shaders which share parameters, and clean up shader instances which aren't in use anymore.
  • Adds a "Filter Demo" button to the TestGame so you can pick from a list of filters with default settings and see that it works.

##Examples BYOND left, OD right Blur: image

Outline: image

amylizzle avatar Sep 19 '22 16:09 amylizzle

This PR is ridiculous and I am so happy someone else handled this nonsense for us, thanks a bunch

Altoids1 avatar Oct 01 '22 23:10 Altoids1

~~TODO: change this to /dm_filter, the ENTIRELY UNDOCUMENTED type path of filters in DM~~

amylizzle avatar Oct 06 '22 09:10 amylizzle

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 13 '22 01:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 20 '22 04:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 29 '22 00:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 02 '22 01:11 github-actions[bot]