Chao Chen | 9eada4b | 2018-09-19 11:39:56 -0700 | [diff] [blame] | 1 | #version 450 |
2 | #extension GL_NV_fragment_shader_barycentric : require | ||||
3 | |||||
4 | layout(location = 0) pervertexNV in vertices { | ||||
5 | float attrib; | ||||
6 | } v[]; | ||||
7 | |||||
8 | layout(location = 1) out float value; | ||||
9 | |||||
10 | void main () { | ||||
11 | value = (gl_BaryCoordNV.x * v[0].attrib + | ||||
12 | gl_BaryCoordNV.y * v[1].attrib + | ||||
13 | gl_BaryCoordNV.z * v[2].attrib); | ||||
14 | |||||
15 | } |