From d506b3333ecf1d7855cbc8a34b927bf19d9fd4a1 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sun, 4 Apr 2021 21:04:56 +0200 Subject: [PATCH] remove shaders from tools --- src/materials/ShaderMaterial.js | 15 ++++++++++++++- src/tools.js | 14 -------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/materials/ShaderMaterial.js b/src/materials/ShaderMaterial.js index b384282..4aea37b 100644 --- a/src/materials/ShaderMaterial.js +++ b/src/materials/ShaderMaterial.js @@ -1,6 +1,19 @@ import { defineComponent, watch } from 'vue'; import { ShaderMaterial } from 'three'; -import { propsValues, defaultFragmentShader, defaultVertexShader } from '../tools'; +import { propsValues } from '../tools'; + +const defaultVertexShader = ` +varying vec2 vUv; +void main(){ + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0); +}`; + +const defaultFragmentShader = ` +varying vec2 vUv; +void main() { + gl_FragColor = vec4(vUv.x, vUv.y, 0., 1.0); +}`; export default defineComponent({ inject: ['three', 'mesh'], diff --git a/src/tools.js b/src/tools.js index 09aa896..28ad0f7 100644 --- a/src/tools.js +++ b/src/tools.js @@ -79,17 +79,3 @@ function getMatcapFormatString(format) { return ''; } } - -// shader defaults -export const defaultVertexShader = ` -varying vec2 vUv; -void main(){ - vUv = uv; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0); -}`; - -export const defaultFragmentShader = ` -varying vec2 vUv; -void main() { - gl_FragColor = vec4(vUv.x, vUv.y, 0., 1.0); -}`;