//
// Copyright (C) 2011 ANSYS, Inc. and its subsidiaries.  All Rights Reserved.
//
// Contains various utility functions that are there to help with the general
// code boiler plate.
//
// Author: vpatel
//


#if defined( GLSL_SHADERSTAGE_VERTEX )

vec4 fVertexPosition()
{
    return gl_ModelViewProjectionMatrix * ATTR_POSITION;
}

vec3 fEyeCoordinates()
{
    vec4 ecPosition = gl_ModelViewMatrix * ATTR_POSITION;
    return ecPosition.xyz / ecPosition.w;
}

vec3 fNormal()
{
    vec3 normal = gl_NormalMatrix * ATTR_NORMAL;
    if (_agl.normalized)
        normal = normalize(normal);
    return normal;
}

#endif
