Skip to content

Commit

Permalink
feat: add fxaa effect
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Apr 2, 2024
1 parent 098fe1f commit 8951bb3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/core/effects/FXAA.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { BlendFunction, FXAAEffect } from 'postprocessing'
import { useEffect } from '../composables/effect'
// import { makePropWatchers } from '../../util/prop'
export interface FXAAProps {
/**
* The blend function of this effect. This prop is not reactive.
* @default BlendFunction.SCREEN
* @type {BlendFunction}
* @memberof FXAAProps
*/
blendFunction?: BlendFunction
}
const props = withDefaults(defineProps<FXAAProps>(), {})
const { pass, effect } = useEffect(() => new FXAAEffect(props))
defineExpose({ pass, effect }) // to allow users to modify pass and effect via template ref
// makePropWatchers([], effect, () => new FXAAEffect())
</script>

<template></template>
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Bloom from './core/effects/Bloom.vue'
import DepthOfField from './core/effects/DepthOfField.vue'
import EffectComposer from './core/EffectComposer.vue'
import FXAA from './core/effects/FXAA.vue'
import Glitch from './core/effects/Glitch.vue'
import Outline from './core/effects/Outline.vue'
import Pixelation from './core/effects/Pixelation.vue'
Expand All @@ -11,6 +12,7 @@ export {
Bloom,
DepthOfField,
EffectComposer,
FXAA,
Glitch,
Noise,
Outline,
Expand Down

0 comments on commit 8951bb3

Please sign in to comment.