Skip to content

Commit

Permalink
Merge pull request #23 from lightning-js/feature/custom-shaders
Browse files Browse the repository at this point in the history
Feature/custom shaders
  • Loading branch information
michielvandergeest authored Dec 11, 2023
2 parents ece9674 + 050595c commit e013abc
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/lib/setup/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,8 @@ import symbols from '../symbols.js'

import { trigger } from '../reactivity/effect.js'

const shaders = {
radius: 'radius',
const shaderAlias = {
rounded: 'radius',
border: 'border',
borderTop: 'borderTop',
borderBottom: 'borderBottom',
borderLeft: 'borderLeft',
borderRight: 'borderRight',
grayScale: 'grayscale',
glitch: 'glitch',
}

export default (component) => {
Expand Down Expand Up @@ -101,9 +93,12 @@ export default (component) => {
},
shader: {
value: function (type, args) {
if (type in shaders) {
const target = shaderAlias[type] || type
const shaders = renderer.driver.stage.shManager.getRegisteredEffects()

if (target in shaders) {
return {
type: shaders[type],
type: target,
props: args,
}
} else {
Expand Down

0 comments on commit e013abc

Please sign in to comment.