This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_vertex.glsl
Antonis Ryakiotakis 090623c6b6 Revert "Add missing trailing '}' in GLSL files"
This reverts commit ebd4a6e0dd.

Trailing '}' is added in C, also we add some extra code as needed.
2015-02-12 19:39:10 +01:00

27 lines
594 B
GLSL

varying vec3 varposition;
varying vec3 varnormal;
#ifdef CLIP_WORKAROUND
varying float gl_ClipDistance[6];
#endif
void main()
{
vec4 co = gl_ModelViewMatrix * gl_Vertex;
varposition = co.xyz;
varnormal = normalize(gl_NormalMatrix * gl_Normal);
gl_Position = gl_ProjectionMatrix * co;
#ifdef CLIP_WORKAROUND
int i;
for(i = 0; i < 6; i++)
gl_ClipDistance[i] = dot(co, gl_ClipPlane[i]);
#elif !defined(GPU_ATI)
// Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
// graphic cards, while on ATI it can cause a software fallback.
gl_ClipVertex = co;
#endif