~pvigo/+junk/processing-3.1.2

« back to all changes in this revision

Viewing changes to debian/processing/usr/share/processing-3.1.2/modes/java/examples/Topics/Shaders/GlossyFishEye/data/GlossyVert.glsl

  • Committer: Pablo Vigo
  • Date: 2016-08-16 10:54:55 UTC
  • Revision ID: pvigo@xtec.cat-20160816105455-4y3x00r4w5anrpr4
2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2007 Dave Griffiths
 
2
// Licence: GPLv2 (see COPYING)
 
3
// Fluxus Shader Library
 
4
// ---------------------
 
5
// Glossy Specular Reflection Shader
 
6
// A more controllable version of blinn shading,
 
7
// Useful for ceramic or fluids - from Advanced 
 
8
// Renderman, thanks to Larry Gritz
 
9
 
 
10
#define PROCESSING_LIGHT_SHADER
 
11
 
 
12
uniform mat4 modelview;
 
13
uniform mat4 transform;
 
14
uniform mat3 normalMatrix;
 
15
 
 
16
uniform vec4 lightPosition[8];
 
17
 
 
18
attribute vec4 vertex;
 
19
attribute vec3 normal;
 
20
 
 
21
varying vec3 N;
 
22
varying vec3 P;
 
23
varying vec3 V;
 
24
varying vec3 L;
 
25
 
 
26
void main() {    
 
27
  N = normalize(normalMatrix * normal); 
 
28
  P = vertex.xyz;
 
29
  V = -vec3(modelview * vertex);
 
30
  L = vec3(modelview * (lightPosition[0] - vertex));
 
31
  gl_Position = transform * vertex;
 
32
}
 
33