View Full Version : Translating ps 1.1 to NV tex shaders+reg comb

04-07-2006, 02:50 PM
Im trying to create a cell shader that use per pixel math when fetching the shading-texture ...i found a good one, but is in ps 1.1...can anybody help me to translate it?
Please, can anybody help me to translate this DX PS1.1 to NV tex shader + reg combiner code?

ps.1.1 ; painter pixel shader

def c0, 0.0f, 0.0f, 0.0f, 0.75f ; light scale
def c1, 0.0f, 0.0f, 0.0f, 1.0f ; black

tex t0 ; grab the normalized normal
; normalizing cube map is in t0
texm3x2pad t1, t0_bx2 ; dot with light a for u value
texm3x2tex t2, t0_bx2 ; dot with light b for v value
; 2d shade texture is in stage t2
tex t3 ; regular texture data

mov r0, C_MATERIAL_DIFFUSE ; load constant color in
cnd r0, r0.a, r0, t3 ; if alpha, use color
; else, use texture
mul r1.rgb, r0, t2 ; modulate with shading

mul r0.rgb, C_LIGHT_COLOR, c0.a ; scale down light value
mul_x2 r0.rgb, r0, r1 ; modulate x2 with light colorThis code was taken from here (http://www.gamedev.net/reference/programming/features/cartoon/page2.asp)

04-07-2006, 04:04 PM
nvidia had a tool that can do this

04-07-2006, 04:39 PM
Thanks !

04-10-2006, 12:24 PM
I couldnt link the library to my project...it gaves me a lot f linker errors...does anybody has a DLL version for C++? I know there is one for delphi...