|
Revision 6871
(checked in by robert, 2 years ago)
|
Checked in first cut of new SVN for OpenSceneGraph-Data
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
// |
|---|
| 3 |
// marble.vert: Vertex shader for producing a marble effect |
|---|
| 4 |
// |
|---|
| 5 |
// author: Randi Rost |
|---|
| 6 |
// |
|---|
| 7 |
// Copyright (c) 2002: 3Dlabs, Inc. |
|---|
| 8 |
// |
|---|
| 9 |
|
|---|
| 10 |
// Mike Weiblen 2003-09-19 : derived from ogl2demo in the 3Dlabs OpenGL2 SDK, |
|---|
| 11 |
// available from http://www.3dlabs.com/opengl2/ |
|---|
| 12 |
|
|---|
| 13 |
const float Scale = 1.0; |
|---|
| 14 |
const vec3 LightPos = vec3( 0.0, 0.0, 4.0 ); |
|---|
| 15 |
|
|---|
| 16 |
varying float LightIntensity; |
|---|
| 17 |
varying vec3 MCposition; |
|---|
| 18 |
|
|---|
| 19 |
void main(void) |
|---|
| 20 |
{ |
|---|
| 21 |
vec4 ECposition = gl_ModelViewMatrix * gl_Vertex; |
|---|
| 22 |
MCposition = vec3 (gl_Vertex) * Scale; |
|---|
| 23 |
vec3 tnorm = normalize(vec3 (gl_NormalMatrix * gl_Normal)); |
|---|
| 24 |
LightIntensity = dot(normalize(LightPos - vec3 (ECposition)), tnorm) * 1.5; |
|---|
| 25 |
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; |
|---|
| 26 |
} |
|---|