Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_basic_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 351da073dc3962ebaa8e4824d6ee1f8fb3b8dbcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* Options:

   USE_LIGHTING
   USE_FAST_LIGHTING
   USE_TWO_SIDE
   USE_SPECULAR
   USE_LOCAL_VIEWER
   USE_TEXTURE_2D

*/



#ifdef USE_LIGHTING

varying vec3 varying_normal;

#ifndef USE_FAST_LIGHTING
varying vec3 varying_position;
#endif

#endif



varying vec4 varying_color;



#ifdef USE_TEXTURE_2D
varying vec2 varying_texcoord;
#endif



void main()
{
	vec4 co = b_ModelViewMatrix * b_Vertex;

#ifdef USE_LIGHTING
	varying_normal = normalize(b_NormalMatrix * b_Normal);

#ifndef USE_FAST_LIGHTING
	varying_position = co.xyz;
#endif

#endif

	gl_Position = b_ProjectionMatrix * co;

#if defined(GPU_PROFILE_COMPAT) && defined(GPU_NVIDIA)
	// 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

	varying_color = b_Color;

#ifdef USE_TEXTURE_2D
	varying_texcoord = (b_TextureMatrix[0] * b_MultiTexCoord0).st;
#endif
}