自定义材质颜色优化

This commit is contained in:
zh
2025-08-22 17:44:32 +08:00
parent 1ea59d0f8a
commit 18cec0d742

View File

@ -70,7 +70,7 @@ function StreamWall1() {
fragColor.rgb = color.rgb / 1.0;\n\
fragColor = czm_gammaCorrect(fragColor);\n\
material.alpha = colorImage.a * color.a;\n\
material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\
material.diffuse = color.rgb/20.0;\n\
material.emission = fragColor.rgb;\n\
return material;\n\
}";
@ -208,6 +208,14 @@ function StreamWall2() {
Property.equals(this.repeat, other._repeat) &&
Property.equals(this.repeats, other._repeats)
};
// let code2 = 'material.diffuse = color.rgb*1.0;'
// if (uniforms.is2D) {
// code2 = `
// material.diffuse = color.rgb*0.0;
// material.emission = color.rgb * 1.0;
// `
// }
// console.log(code2, uniforms.is2D)
// 将定义的材质对象添加到cesium的材质队列中
Material._materialCache.addMaterial(MaterialType, {
fabric: {
@ -230,8 +238,8 @@ function StreamWall2() {
else {
material.alpha = 1.0;
}
material.diffuse = colorImage.rgb*color.rgb*0.0;
material.emission = colorImage.rgb*color.rgb * 1.4;
material.diffuse = color.rgb*0.0;
material.emission = color.rgb * 1.0;
return material;
}`,
components: {