/*********************************************************************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; }