xxxxxxxxxx
41
precision mediump float;
varying vec3 v_bc;
attribute vec3 aPosition;
attribute vec2 aTexCoord;
attribute vec3 aNormal;
uniform mat4 uProjectionMatrix;
uniform mat4 uModelViewMatrix;
uniform float time;
uniform float targetX;
uniform float targetY;
varying vec2 vTexCoord;
varying vec3 vNormal;
// varying float vCull;
void main(){
vec4 positionVec4 = vec4(aPosition, 1.0);
vec3 shiftedPos = vec3(aPosition.x-targetX,
aPosition.y-targetY,
aPosition.z);
// vec3 shiftedPos = vec3(aPosition.xyz);
// vec4 positionVec4 = vec4(aPosition.x-targetX,aPosition.y,aPosition.z-targetY,1.0);
// //use this to throow all the vertices away except the wireframe still goes lol (except im making my own wireframe now bitchasssss)
// vCull = 1.0-step(100.0,abs(aPosition.x-targetX) + abs(aPosition.y-targetY));
vNormal = aNormal;
// // wonk mode
// positionVec4 = vec4(positionVec4.xyz + (shiftedPos * 0.05 * sin(time * shiftedPos * 0.1)), 1.0);
gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;
vTexCoord = aTexCoord;
}