#ifdef VERTEX

out vec2 texcoord;
out vec4 glcolor;

attribute vec3 mc_Entity;

out float is_water;
out vec3 worldPos;

uniform mat4 gbufferModelViewInverse;

uniform vec3 cameraPosition;
#include "/lib/shadows/distort.glsl"

void main()
{
    gl_Position = ftransform();
    gl_Position.xy = DistortPosition(gl_Position.xy);

    texcoord = gl_MultiTexCoord0.st;
    glcolor = gl_Color;

    // Posición en mundo
   worldPos = gl_Vertex.xyz + cameraPosition;

    is_water = (mc_Entity.x == 1.0) ? 1.0 : 0.0;
}

#endif

#ifdef FRAGMENT

uniform sampler2D gcolor;

in vec2 texcoord;
in vec4 glcolor;

in float is_water;
in vec3 worldPos;


void main() {
    vec4 Albedo = texture(gcolor, texcoord) * glcolor;


    
    gl_FragData[0] =Albedo;
}
#endif