File: normal.fs

package info (click to toggle)
wings3d 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,404 kB
  • sloc: erlang: 132,169; ansic: 3,779; lisp: 1,434; sh: 805; makefile: 794; cpp: 244; xml: 50
file content (21 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
//  normal.fs --
//
//     Simple object normal shader
//
//  Copyright (c) 2009 Dan Gudmundsson
//
//  See the file "license.terms" for information on usage and redistribution
//  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
//

varying vec3 w3d_normal;

void main(void)
{
   vec3 color; 
   // Scale normals range from: -1,1 to 0,1
   color = (normalize(w3d_normal)+1.0)*0.5;
   gl_FragColor = vec4(color, 1.0);
}