~ubuntu-branches/ubuntu/utopic/vtk6/utopic

« back to all changes in this revision

Viewing changes to Utilities/MaterialLibrary/Repository/OrangeBook/Ch13/Ch13ParticleVert.glsl

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-01-07 21:26:32 UTC
  • Revision ID: package-import@ubuntu.com-20140107212632-vzwzmu3oyc3obmsg
Tags: upstream-6.0.0
ImportĀ upstreamĀ versionĀ 6.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Vertex shader for rendering a "confetti cannon"
 
3
// via a partcle system
 
4
//
 
5
// Author: Randi Rost
 
6
//
 
7
// Copyright (c) 2003-2004: 3Dlabs, Inc.
 
8
//
 
9
// See 3Dlabs-License.txt for license information
 
10
//
 
11
 
 
12
uniform float Time;            // updated each frame by the application
 
13
uniform vec4  Background;      // constant color equal to background
 
14
 
 
15
attribute vec3  Velocity;      // initial velocity
 
16
attribute float StartTime;     // time at which particle is activated
 
17
 
 
18
varying vec4 Color;
 
19
 
 
20
void main(void)
 
21
{
 
22
    vec4  vert;
 
23
    float t = Time - StartTime;
 
24
 
 
25
    if (t >= 0.0)
 
26
    {
 
27
        vert    = gl_Vertex + vec4 (Velocity * t, 0.0);
 
28
        vert.y -= 4.9 * t * t;
 
29
        Color   = gl_Color;
 
30
    }
 
31
    else
 
32
    {
 
33
        vert  = gl_Vertex;      // Initial position
 
34
        Color = Background;     // "pre-birth" color
 
35
    }
 
36
 
 
37
    gl_Position  = gl_ModelViewProjectionMatrix * vert;
 
38
}
 
 
b'\\ No newline at end of file'