blinn_reflect.nvp

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

NVP
35
字号
; Pixel shader - Bumped surface reflections.
; Transforms the bumpmap into the local coordinate system
; by the basis vectors supplied from the vertex shader.
; Then uses the normal and eye vector to generate a 
; reflection vector which looks into a cubemap.

#include "PixelConstants.h"


 
// Declare pixel shader version 1.0
ps.1.0

// Define t0 as a standard 3-vector from bumpmap
tex t0

// Perform matrix multiply to get a local normal bump.  Then
// reflect the eye vector through the normal and sample from 
// a cubic environment map.
// Must use _bx2 to convert unsigned texture normal map values
//  to the full [-1,1] signed range

texm3x3pad t1,    t0_bx2
texm3x3pad t2,    t0_bx2		
texm3x3vspec t3,  t0_bx2

// result goes in output color
mov r0, t3				






⌨️ 快捷键说明

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