File: mesh.vert

package info (click to toggle)
solvespace 3.1%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,996 kB
  • sloc: cpp: 122,491; ansic: 11,375; javascript: 1,919; sh: 89; xml: 44; makefile: 25
file content (21 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//-----------------------------------------------------------------------------
// Mesh rendering shader
//
// Copyright 2016 Aleksey Egorov
//-----------------------------------------------------------------------------
attribute vec3 pos;
attribute vec3 nor;
attribute vec4 col;

uniform mat4 modelview;
uniform mat4 projection;

varying vec3 fragNormal;
varying vec4 fragColor;

void main() {
    fragNormal = vec3(modelview * vec4(nor, 0.0));
    fragColor = col;

    gl_Position =  projection * modelview * vec4(pos, 1.0);
}