water_vertex.vp

来自「游戏编程精粹6第中关于粒子的实时流体仿真系统,对入门的游戏开发者很有帮助.」· VP 代码 · 共 54 行

VP
54
字号
!!VP2.0
# cgc version 1.3.0001, build date Aug  4 2004 10:01:10
# command line args: -profile vp30
# source file: water_vertex.cg
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp30
#program main
#semantic main.fresnelValues
#semantic main.texMatrix
#semantic main.modelViewProj
#semantic main.modelToWorld
#var float4 position : $vin.ATTR0 : ATTR0 : 0 : 1
#var float3 normal : $vin.ATTR2 : ATTR2 : 1 : 1
#var float4 oPosition : $vout.HPOS : HPOS : 2 : 1
#var float3 incident : $vout.TEX0 : TEX0 : 3 : 1
#var float3 n_out : $vout.TEX1 : TEX1 : 4 : 1
#var float reflectionFactor : $vout.COL0 : COL0 : 5 : 1
#var float3 fresnelValues :  : c[13] : 6 : 1
#var float4x4 texMatrix :  : c[0], 4 : 7 : 1
#var float4x4 modelViewProj :  : c[4], 4 : 8 : 1
#var float4x4 modelToWorld :  : c[8], 4 : 9 : 1
#const c[12] = 1
BB1:
DP4   o[HPOS].w, v[0], c[7];
DP4   o[HPOS].z, v[0], c[6];
DP4   o[HPOS].y, v[0], c[5];
DP4   o[HPOS].x, v[0], c[4];
MOV   R0.w, c[13].x;
DP3   R1.z, v[2], c[10];
DP3   R1.y, v[2], c[9];
DP4   R0.z, v[0], c[10];
DP4   R0.y, v[0], c[9];
DP4   R0.x, v[0], c[8];
DP3   R1.x, v[2], c[8];
DP3   R2.x, R0, R0;
DP3   R1.w, R1, R1;
DP3   o[TEX0].z, R0, c[2];
RSQ   R2.x, R2.x;
DP3   o[TEX0].y, R0, c[1];
RSQ   R1.w, R1.w;
MUL   R2.xyz, R2.x, R0;
MUL   R3.xyz, R1.w, R1;
DP3   R1.w, R2, R3;
DP3   o[TEX0].x, R0, c[0];
ADD   R0.xy, R1.w, c[12].x;
DP3   o[TEX1].z, R1, c[2];
DP3   o[TEX1].y, R1, c[1];
LIT   R0.z, R0;
DP3   o[TEX1].x, R1, c[0];
MAD   o[COL0].x, R0.z, c[13].y, c[13].z;
END
# 27 instructions, 4 R-regs

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?