All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.shaders.Water.vert Maven / Gradle / Ivy

The newest version!
#pragma include includes/StdLib.vert

in vec4 in_position;    //
in vec2 in_texcoord;    //

out vec3 normal, tangent, bitangent;
out vec2 texcoord;
out vec4 stc;

uniform mat4 mat_m, mat_vp;     //
uniform mat4 mat_s;             //
uniform mat3 mat_nv;            //

void main() {
    texcoord = in_texcoord;

    normal = mat_nv * vec3(0.,1.,0.);//TODO mat_nv[1].xyz
    tangent = mat_nv * vec3(1.,0.,0.);
    bitangent = cross(normal, tangent);

    gl_Position = mat_m * in_position;
    stc = mat_s * gl_Position;
    stc.xyz = (stc.xyz / stc.w)*0.5+0.5;
    gl_Position = mat_vp * gl_Position;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy