Cesium 纹理贴图

根据纹理坐标(2,2)实现2X2的纹理贴图,实现如下效果:

Cesium 纹理贴图_第1张图片

首次测试代码如下:

    const material = Material.fromType(Material.ImageType);
    material.uniforms.image = image;
    material.shaderSource=`
    uniform vec4 color_2;
    uniform vec2 repeat_1;
    uniform sampler2D image_0;
    czm_material czm_getMaterial(czm_materialInput materialInput)
    {
      czm_material material = czm_getDefaultMaterial(materialInput);
      vec2 st=materialInput.st;
      material.diffuse = czm_gammaCorrect(texture2D(image_0, fract(st))).rgb;
      material.alpha =  texture2D(image_0, fract(st)).a;
      return material;
    }
    `
    let positions = new Float64Array([
      0.0, 0.0, 0.0,
      5000.0, 0.0, 0.0,
      5000.0, 5000.0, 0.0,
      0.0, 5000.0, 0.0
    ]);
    /*纹理坐标*/
    let uv=[
      0.0, 0.0,
      2.0,0.0,
      2.0,2.0,
      0.0,2.0,
    ];
    /*发现线*/
    let normal=[
      0.0, 0.0,1.0,
      0.0, 0.0,1.0,
      0.0, 0.0,1.0,
      0.0, 0.0,1.0,
    ];
    let geometry = new Geometry({
      attributes : {
        position : new Geomet

你可能感兴趣的:(Cesium,javascript)