diff options
author | Kenneth Russel <[email protected]> | 2009-06-15 23:12:27 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2009-06-15 23:12:27 +0000 |
commit | 41cd6c47b23975098cd155517790e018670785e7 (patch) | |
tree | 247333528ad674d427ba96b1e05810f7961d609e /src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg | |
parent | 935d2596c13371bb745d921dbcb9f05b0c11a010 (diff) |
Copied JOGL_2_SANDBOX r350 on to trunk; JOGL_2_SANDBOX branch is now closed
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@352 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg')
-rw-r--r-- | src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg b/src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg new file mode 100644 index 0000000..e767ad3 --- /dev/null +++ b/src/demos/cg/runtime_ogl_vertex_fragment/demo_vert.cg @@ -0,0 +1,46 @@ +/*********************************************************************NVMH3**** + +Copyright NVIDIA Corporation 2002 +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED +*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS +BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES +WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, +BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) +ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +Comments: + +******************************************************************************/ + +void main(float4 Pobject : POSITION, + float3 Nobject : NORMAL, + float2 TexUV : TEXCOORD0, + float3 diffuse : TEXCOORD1, + float3 specular : TEXCOORD2, + uniform float4x4 ModelViewProj, + uniform float4x4 ModelView, + uniform float4x4 ModelViewIT, + + out float4 HPosition : POSITION, + out float3 Peye : TEXCOORD0, + out float3 Neye : TEXCOORD1, + out float2 uv : TEXCOORD2, + out float3 Kd : COLOR0, + out float3 Ks : COLOR1) +{ + // compute homogeneous position of vertex for rasterizer + HPosition = mul(ModelViewProj, Pobject); + // transform position and normal from model-space to view-space + Peye = mul(ModelView, Pobject).xyz; + Neye = mul(ModelViewIT, float4(Nobject, 0)).xyz; + // pass uv, Kd, and Ks through unchanged; if they are varying + // per-vertex, however, they'll be interpolated before being + // passed to the fragment program. + uv = TexUV; + Kd = diffuse; + Ks = specular; +} |