EG/RenderPipelineFile/effects/simple_texture_test.yaml
2025-12-12 16:16:15 +08:00

32 lines
1.1 KiB
YAML

# 最简单的纹理测试效果
# 直接将纹理显示为颜色,验证纹理是否被正确读取
fragment:
defines: |
#define SIMPLE_TEXTURE_TEST 1
inout: |
uniform sampler2D p3d_Texture3; // 粗糙度纹理槽
material: |
// 最简单的测试:直接显示纹理
#if SIMPLE_TEXTURE_TEST
// 尝试读取纹理
vec4 texture_sample = texture(p3d_Texture3, texcoord);
float texture_value = texture_sample.r; // 读取红色通道
// 直接将纹理值显示为颜色
m.basecolor = vec3(texture_value); // 灰度显示
m.roughness = 0.5; // 固定粗糙度
m.metallic = 0.0; // 非金属
m.specular_ior = 1.5;
m.shading_model_param0 = 0.0;
#else
// 正常材质
m.basecolor = mInput.color;
m.roughness = mInput.roughness;
m.metallic = mInput.metallic;
m.specular_ior = mInput.specular_ior;
m.shading_model_param0 = mInput.arbitrary0;
#endif