filterblit.nvv

来自「游戏编程精华02-含有几十个游戏编程例子」· NVV 代码 · 共 32 行

NVV
32
字号
/************************************************************************
FilterBlit.nvv

This vertex shader transforms a vertex to clip-space and copies 
uv-coordinates stored in v1 to all four texture stages.  The 
uv-coordinates may be offset with values from constant memory.
A0 is loaded with a value from constant memory that selectes which set 
of offset to use.

Copyright (C) 1999, 2000 NVIDIA Corporation
*************************************************************************/

#include "Constants.h"

vs.1.1

; Transform vertex-position to clip-space
dp4 oPos.x, v0, c[CV_WORLDVIEWPROJ_0]
dp4 oPos.y, v0, c[CV_WORLDVIEWPROJ_1]
dp4 oPos.z, v0, c[CV_WORLDVIEWPROJ_2]
dp4 oPos.w, v0, c[CV_WORLDVIEWPROJ_3]

; Read which set of offsets to use
mov a0.x, c[CV_UV_OFFSET_TO_USE]

; copy uv-coordinates to all four texture stages
; and offset them according to a0
add oT0, v1, c[a0.x + CV_T0_BASE]
add oT1, v1, c[a0.x + CV_T1_BASE]
add oT2, v1, c[a0.x + CV_T2_BASE]
add oT3, v1, c[a0.x + CV_T3_BASE]

⌨️ 快捷键说明

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