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_3D_vert.glsl
Clément Foucault b4a01e7f4f OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.

OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
2017-02-11 00:39:09 +01:00

28 lines
442 B
GLSL

uniform mat4 ModelViewProjectionMatrix;
#ifdef USE_NORMALS
uniform mat3 NormalMatrix;
#endif
#if __VERSION__ == 120
attribute vec3 pos;
#ifdef USE_NORMALS
attribute vec3 nor;
varying vec3 normal;
#endif
#else
in vec3 pos;
#ifdef USE_NORMALS
in vec3 nor;
out vec3 normal;
#endif
#endif
void main()
{
#ifdef USE_NORMALS
normal = normalize(NormalMatrix * nor);
#endif
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
}