save code
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 24 KiB |
@@ -25,13 +25,13 @@ void main()
|
||||
// 重新映射ndot值,让中间2/3部分进行融合
|
||||
// 当ndot在[0.166, 0.833]范围内时进行混合,两端保持不变
|
||||
float blendFactor;
|
||||
if (ndot < 0.266) {
|
||||
blendFactor = 0.0; // 完全使用color_ex
|
||||
} else if (ndot > 0.733) {
|
||||
blendFactor = 1.0; // 完全使用color
|
||||
if (ndot < 0.0) {
|
||||
blendFactor = 0.0; // 完全使用color_ex
|
||||
} else if (ndot > 0.1) {
|
||||
blendFactor = 1.0; // 完全使用color
|
||||
} else {
|
||||
// 在中间2/3部分进行平滑过渡
|
||||
blendFactor = (ndot - 0.166) / (0.833 - 0.166);
|
||||
// 在中间2/3部分进行平滑过渡
|
||||
blendFactor = (ndot - 0.0) / (1 - 0);
|
||||
}
|
||||
|
||||
// 使用smoothstep创建中间2/3的融合区域
|
||||
@@ -40,9 +40,17 @@ void main()
|
||||
//float blendFactor = smoothstep(0.166, 0.833, ndot);
|
||||
|
||||
|
||||
vec4 blendedColor = mix(color_ex, color, blendFactor);
|
||||
// vec4 blendedColor = mix(color_ex, color, ndot);
|
||||
|
||||
outFragColor = blendedColor;
|
||||
// outFragColor = blendedColor;
|
||||
|
||||
if (ndot < 0.3){
|
||||
outFragColor = color_ex;
|
||||
}
|
||||
else
|
||||
{
|
||||
outFragColor = color;
|
||||
}
|
||||
|
||||
// outFragColor = vec4(1, 0, 0, 1);
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user