diff --git a/src/components/demos/Demo3.vue b/src/components/demos/Demo3.vue
index 3a3094d..14f4661 100644
--- a/src/components/demos/Demo3.vue
+++ b/src/components/demos/Demo3.vue
@@ -5,6 +5,8 @@
+
+
diff --git a/src/components/demos/Demo4.vue b/src/components/demos/Demo4.vue
index 73416d1..03a3eea 100644
--- a/src/components/demos/Demo4.vue
+++ b/src/components/demos/Demo4.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/components/examples/Matcap.vue b/src/components/examples/Matcap.vue
new file mode 100644
index 0000000..75a16a9
--- /dev/null
+++ b/src/components/examples/Matcap.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/sliders/Slider1.vue b/src/components/sliders/Slider1.vue
index f72bf70..a60ea78 100644
--- a/src/components/sliders/Slider1.vue
+++ b/src/components/sliders/Slider1.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/core/Renderer.js b/src/core/Renderer.js
index 1583753..eb4d301 100644
--- a/src/core/Renderer.js
+++ b/src/core/Renderer.js
@@ -3,38 +3,14 @@ import useThree from './useThree';
export default {
props: {
- antialias: {
- type: Boolean,
- default: true,
- },
- alpha: {
- type: Boolean,
- default: false,
- },
- autoClear: {
- type: Boolean,
- default: true,
- },
- shadow: {
- type: Boolean,
- default: false,
- },
- orbitCtrl: {
- type: [Boolean, Object],
- default: false,
- },
- mouseMove: {
- type: [Boolean, String],
- default: false,
- },
- mouseRaycast: {
- type: Boolean,
- default: false,
- },
- resize: {
- type: [Boolean, String, Element],
- default: 'window',
- },
+ antialias: Boolean,
+ alpha: Boolean,
+ autoClear: { type: Boolean, default: true },
+ mouseMove: { type: [Boolean, String], default: false },
+ mouseRaycast: { type: Boolean, default: false },
+ orbitCtrl: { type: [Boolean, Object], default: false },
+ resize: { type: [Boolean, String, Element], default: 'window' },
+ shadow: Boolean,
width: String,
height: String,
},
diff --git a/src/effects/FXAAPass.js b/src/effects/FXAAPass.js
new file mode 100644
index 0000000..00ebb80
--- /dev/null
+++ b/src/effects/FXAAPass.js
@@ -0,0 +1,26 @@
+import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
+import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader.js';
+import EffectPass from './EffectPass.js';
+
+export default {
+ extends: EffectPass,
+ mounted() {
+ const pass = new ShaderPass(FXAAShader);
+ this.passes.push(pass);
+ this.pass = pass;
+
+ this.resize();
+ this.three.onAfterResize(this.resize);
+ },
+ unmounted() {
+ this.three.offAfterResize(this.resize);
+ },
+ methods: {
+ resize() {
+ const { resolution } = this.pass.material.uniforms;
+ resolution.value.x = 1 / this.three.size.width;
+ resolution.value.y = 1 / this.three.size.height;
+ },
+ },
+ __hmrId: 'FXAAPass',
+};
diff --git a/src/effects/index.js b/src/effects/index.js
index 3d7cc8f..69348a7 100644
--- a/src/effects/index.js
+++ b/src/effects/index.js
@@ -1,7 +1,9 @@
export { default as EffectComposer } from './EffectComposer.js';
export { default as RenderPass } from './RenderPass.js';
+
export { default as BokehPass } from './BokehPass.js';
export { default as FilmPass } from './FilmPass.js';
+export { default as FXAAPass } from './FXAAPass.js';
export { default as HalftonePass } from './HalftonePass.js';
export { default as SAOPass } from './SAOPass.js';
export { default as UnrealBloomPass } from './UnrealBloomPass.js';
diff --git a/src/materials/CubeTexture.js b/src/materials/CubeTexture.js
index 352396f..e1ba9bb 100644
--- a/src/materials/CubeTexture.js
+++ b/src/materials/CubeTexture.js
@@ -23,6 +23,7 @@ export default {
watch(() => this.urls, this.refreshTexture);
},
unmounted() {
+ this.material.setTexture(null, this.id);
this.texture.dispose();
},
methods: {
diff --git a/src/materials/Texture.js b/src/materials/Texture.js
index 62359ff..7c77070 100644
--- a/src/materials/Texture.js
+++ b/src/materials/Texture.js
@@ -16,6 +16,7 @@ export default {
watch(() => this.src, this.refreshTexture);
},
unmounted() {
+ this.material.setTexture(null, this.id);
this.texture.dispose();
},
methods: {