91 |
# Texture unit 2 is blurred |
# Texture unit 2 is blurred |
92 |
TEX H2, f[TEX1], TEX2, 2D; |
TEX H2, f[TEX1], TEX2, 2D; |
93 |
|
|
94 |
|
# Get the sharp value of the text texture |
95 |
|
TEX H3, f[TEX1], TEX1, 2D; |
96 |
|
|
97 |
# Map blurred 'text' texture intensity to background blur |
# Map blurred 'text' texture intensity to background blur |
98 |
# as follows: |
# as follows: |
99 |
# 1 -> no bias |
# 1 -> no bias |
101 |
DP4H H2, {-10,-10,-10,31}, H2; |
DP4H H2, {-10,-10,-10,31}, H2; |
102 |
|
|
103 |
# The derivatives of the paper texture |
# The derivatives of the paper texture |
104 |
DDXH H0, f[TEX0]; |
DDXH H0.xy, f[TEX0].xyxy; |
105 |
DDYH H1, f[TEX0]; |
DDYH H0.zw, f[TEX0].xyxy; |
106 |
|
|
107 |
# Scale with the DP |
# Scale with the DP |
108 |
MULH H0, H2, H0; |
MULH H0, H2, H0; |
|
MULH H1, H2, H1; |
|
109 |
|
|
110 |
# Get the blurred value of the background texture |
# Get the blurred value of the background texture |
111 |
TXD H0, f[TEX0], H0, H1, TEX0, 2D; |
TXD H0, f[TEX0], H0.xyxy, H0.zwzw, TEX0, 2D; |
112 |
|
|
|
# Get the sharp value of the text texture |
|
|
TEX H1, f[TEX1], TEX1, 2D; |
|
113 |
|
|
114 |
# Compute the final color |
# Compute the final color |
115 |
|
|
116 |
MULX o[COLR], H0, H1; |
MULX o[COLR], H0, H3; |
117 |
END |
END |
118 |
""") |
""") |
119 |
|
|