Last change
on this file since 2852 was
2852,
checked in by ldelgass, 12 years ago
|
Fix up line endings and formatting in shader code, also add emacs magic line
to get C++ mode highlighting
|
File size:
1.0 KB
|
Rev | Line | |
---|
[2852] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
| 2 | /* |
---|
| 3 | * ====================================================================== |
---|
| 4 | * AUTHOR: Wei Qiao <qiaow@purdue.edu> |
---|
| 5 | * Purdue Rendering and Perceptualization Lab (PURPL) |
---|
| 6 | * |
---|
| 7 | * Copyright (c) 2004-2006 Purdue Research Foundation |
---|
| 8 | * |
---|
| 9 | * See the file "license.terms" for information on usage and |
---|
| 10 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
| 11 | * ====================================================================== |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #include "common.cg" |
---|
| 15 | |
---|
| 16 | v2f main(a2v IN, |
---|
| 17 | uniform float4x4 modelViewProjMatrix, |
---|
| 18 | uniform float4x4 modelViewInv) |
---|
| 19 | { |
---|
| 20 | v2f OUT; |
---|
| 21 | |
---|
| 22 | //clip space vertex position |
---|
| 23 | OUT.HPosition = mul(modelViewProjMatrix, mul(modelViewInv, IN.Position)); |
---|
| 24 | |
---|
| 25 | //eye space texture coordinates |
---|
| 26 | OUT.TexCoord = IN.TexCoord; |
---|
| 27 | |
---|
| 28 | //world space eye position |
---|
| 29 | OUT.EyeVector = normalize(-IN.Position.xyz); |
---|
| 30 | |
---|
| 31 | //world space light postion |
---|
| 32 | OUT.Light = normalize(float3(1,1,1)-IN.Position.xyz); |
---|
| 33 | |
---|
| 34 | return OUT; |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.