~ubuntu-branches/ubuntu/raring/openwalnut/raring

« back to all changes in this revision

Viewing changes to src/modules/teemGlyphs/shaders/WMTeemGlyphs-vertex.glsl

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2012-12-12 11:26:32 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20121212112632-xhiuwkxuz5h0idkh
Tags: 1.3.1+hg5849-1
* Minor changes compared to 1.3.0 but included several bug fixes.
* See http://www.openwalnut.org/versions/4

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
//
23
23
//---------------------------------------------------------------------------
24
24
 
25
 
#include "WGELighting-vertex.glsl"
26
 
 
27
 
#include "WGETransformationTools.glsl"
28
 
// The ray's starting point in texture space
29
 
varying vec3 v_rayStart;
30
 
 
31
 
// The ray direction in texture space
32
 
varying vec3 v_ray;
 
25
#version 120
33
26
 
34
27
// the Surface normal at this point
35
28
varying vec3 v_normal;
36
29
 
37
 
// The light source in local coordinates
38
 
varying vec3 v_lightSource;
39
 
 
40
30
void main()
41
31
{
42
 
    prepareLight();
43
 
    v_normal = gl_Normal;
44
 
 
45
 
    // transform the ray direction to texture space, which equals object space
46
 
    // Therefore use two points, as we transform a vector
47
 
    vec4 camLookAt = vec4( 0.0, 0.0, -1.0, 1.0 );
48
 
    vec4 camPos    = vec4( 0.0, 0.0, 0.0, 1.0 );
49
 
    v_ray = worldToLocal( camLookAt, camPos ).xyz;
50
 
 
51
 
    // also get the coordinates of the light
52
 
    vec4 lpos = gl_LightSource[0].position;
53
 
    lpos = vec4( 0.0, 0.0, 1000.0, 1.0 );
54
 
    v_lightSource = worldToLocal( lpos ).xyz;
 
32
    v_normal = gl_NormalMatrix * gl_Normal;
 
33
 
55
34
    gl_FrontColor = gl_Color;
56
 
 
57
35
    gl_Position = ftransform();
58
36
}