~ubuntu-branches/ubuntu/raring/glmark2/raring

« back to all changes in this revision

Viewing changes to data/shaders/bump-height.vert

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo
  • Date: 2012-08-21 15:38:09 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120821153809-bwux72bat8qp2n5v
Tags: 2012.08-0ubuntu1
* New upstream release 2012.08 (LP: #1039736)
  - Avoid crashing if gl used is not >= 2.0 (LP: #842279)
* Bumping dh compatibility level to v9
* debian/control:
  - Update Standards-Version to 3.9.3.
  - Add libjpeg-dev build dependency.
  - Use libegl1-x11-dev as an build-dep alternative instead of libegl1-dev.
  - Update description of glmark2-data binary package.
* debian/copyright:
  - Refresh copyright based on the current upstrem version
* debian/rules:
  - Clean compiled python code from unpacked waflib/ directory, as
    described in http://wiki.debian.org/UnpackWaf

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
attribute vec3 position;
 
2
attribute vec2 texcoord;
 
3
attribute vec3 normal;
 
4
attribute vec3 tangent;
 
5
 
 
6
uniform mat4 ModelViewProjectionMatrix;
 
7
uniform mat4 NormalMatrix;
 
8
 
 
9
varying vec2 TextureCoord;
 
10
varying vec3 NormalEye;
 
11
varying vec3 TangentEye;
 
12
varying vec3 BitangentEye;
 
13
 
 
14
void main(void)
 
15
{
 
16
    TextureCoord = texcoord;
 
17
 
 
18
    // Transform normal, tangent and bitangent to eye space, keeping
 
19
    // all of them perpendicular to the Normal. That is why we use
 
20
    // NormalMatrix, instead of ModelView, to transform the tangent and
 
21
    // bitangent.
 
22
    NormalEye = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));
 
23
    TangentEye = normalize(vec3(NormalMatrix * vec4(tangent, 1.0)));
 
24
    BitangentEye = normalize(vec3(NormalMatrix * vec4(cross(normal, tangent), 1.0)));
 
25
 
 
26
    // Transform the position to clip coordinates
 
27
    gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);
 
28
}