#pragma language glsl3
#ifdef VERTEX

uniform mat4 MVP;
uniform mat4 modelMatrix;

out vec3 vpos;

vec4 position(mat4 transform_projection, vec4 vertex_position) {
  vpos = vertex_position.xyz;
  return  MVP*vec4( vertex_position.xyz,1);

}
#endif

#ifdef PIXEL

in vec3 vpos;
uniform float lightRange;
uniform vec3 lightPosition;
vec4 effect(vec4 color, sampler2D texturee, vec2 textureCoords, vec2 screen_coords) {
  vec4 texel = Texel(texturee,textureCoords);

  // if (texel.a==1){
  //  return vec4(1);
  // }else{
  //  discard;
  // }

  gl_FragDepth=(length(vpos - lightPosition))/ lightRange;

  return vec4(vec3(1),1);

}
#endif












