Last change
on this file since 65 was
65,
checked in by Maciej Komosinski, 13 years ago
|
added sources of the 3D client for the Framsticks server
|
File size:
455 bytes
|
Line | |
---|
1 | //name stone |
---|
2 | //vert |
---|
3 | |
---|
4 | varying vec2 texCoord; |
---|
5 | varying vec3 normalVec; |
---|
6 | |
---|
7 | void main(void) |
---|
8 | { |
---|
9 | gl_Position = ftransform(); |
---|
10 | texCoord = gl_MultiTexCoord0.xy * 0.4; |
---|
11 | normalVec = normalize(gl_NormalMatrix * gl_Normal); |
---|
12 | } |
---|
13 | |
---|
14 | //frag |
---|
15 | |
---|
16 | varying vec2 texCoord; |
---|
17 | uniform sampler2D diffuseMap; |
---|
18 | varying vec3 normalVec; |
---|
19 | |
---|
20 | void main (void) |
---|
21 | { |
---|
22 | vec4 base = texture2D(diffuseMap, texCoord); |
---|
23 | |
---|
24 | float c = dot(normalVec, vec3(0,0,-1)); |
---|
25 | c = abs(c); |
---|
26 | gl_FragColor = base * (1.0-c); |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.