Reputation: 2301
We have "fragment" shaders in the form of CSS shaders, are these applicable/available to 2d canvas/contexts also?
Upvotes: 0
Views: 161
Reputation:
Only to the canvas element itself, so whatever is drawn to canvas will be affected visually.
You cannot use them to process directly what you draw using the context - context is isolated to only work on the bitmap itself while CSS is limited to work on the element(s) (you could always emulate what they're doing though).
As a sidenote: there is a new filter
property for the context being considered for the standard, which can take CSS filter and apply it to the context. If accepted into the standard it may be possible to use CSS shaders with context directly too - it is currently only supported in Firefox hidden behind flags. If it goes prime-time, only time will show..
Upvotes: 2