adjustcontrast.psh

来自「real-time(实时渲染技术DirectX)Media」· PSH 代码 · 共 34 行

PSH
34
字号
ps.1.4

;Used to rebias the results
def c1, 0.5, 0.5, 0.5, 1.0

;Load the texture
texld r0, t0

;Pull colors back to the center
add_sat r1,  r0_bx2, c0
add_sat r2, -r0_bx2, c0

;choose the correct value based on the side and scale
cnd_d2 r3, r0, r1, -r2

;bias the value back
add    r3, r3, c1

phase

;Handle the case of increasing contrast
;Push values from the center
add r1.rgb, r0, c0
sub r2.rgb, r0, c0

;choose value based on original value
cnd r1.rgb, r0, r1, r2

;Choose new values based on the sign of the 
;input adjustor
cmp r0.rgb, c0, r1, r3
+mov r0.a, c0.a

⌨️ 快捷键说明

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