From a58decb97126c6fdcd2b5895cd29f143e8b9381f Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 19 Jan 2023 21:21:17 -0500 Subject: obj fix proj --- public/gl/shader/SimpleShader.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'public/gl/shader') diff --git a/public/gl/shader/SimpleShader.js b/public/gl/shader/SimpleShader.js index 715aa60..3bca731 100644 --- a/public/gl/shader/SimpleShader.js +++ b/public/gl/shader/SimpleShader.js @@ -6,16 +6,17 @@ export const SimpleShader = () => { precision mediump float; attribute vec3 position; - attribute vec3 color; - + attribute vec3 normal; + attribute vec3 uv; + uniform mat4 proj; uniform mat4 view; uniform mat4 tran; - - varying vec3 color_pass; + + varying vec3 color; void main() { - color_pass = color; + color.xyz = (position.xyz + 1.0) / 2.0; gl_Position = proj * view * tran * vec4(position, 1.0); } ` @@ -23,10 +24,10 @@ export const SimpleShader = () => { const FragmentCode = ` precision mediump float; - varying vec3 color_pass; + varying vec3 color; void main() { - gl_FragColor = vec4(color_pass, 1.0); + gl_FragColor = vec4(color, 1.0); } ` return new Shader(VertexCode, FragmentCode) -- cgit v1.2.3-freya