Coder Social home page Coder Social logo

papa3642240 / cesium-tileseteffect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhangti0708/cesium-tileseteffect

0.0 0.0 0.0 5.18 MB

基于3dtileset的特效,插件支持到cesium1.70 。1.87+官方新增CustomShader接口无需使用插件。

Home Page: http://zhangticcc.gitee.io/cesium-tileseteffect/

HTML 43.39% CSS 3.10% JavaScript 53.51%

cesium-tileseteffect's Introduction

cesium-tilesetEffect

基于3dtileset的特效


基于cesium的3dtilset模型特效

cesium-tilesetEffect

说明

/cesium-tilesetEffect/src/doc

使用

在项目中引入Cesium.js
然后引入 cesium-tilesetEffect.js 即可

 

      // 特效 默认开启
      Cesium.TILE_EFFECT_STATE = true;
 
      // 片元着色器 默认 可以自定义
      Cesium.TILE_FS_BODY = ` float stc_pl = fract(czm_frameNumber / 120.0) * 3.14159265 *         
                 2.0;
                float stc_sd = v_stcVertex.z / 60.0 + sin(stc_pl) * 0.1;
                gl_FragColor *= vec4(stc_sd, stc_sd, stc_sd, 1.0);
                float stc_a13 = fract(czm_frameNumber / 360.0);
                float stc_h = clamp(v_stcVertex.z / 450.0, 0.0, 1.0);
                stc_a13 = abs(stc_a13 - 0.5) * 2.0;
                float stc_diff = step(0.005, abs(stc_h - stc_a13));
                gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - stc_diff);`;
                
      // 加载3dtileset
      let tilesets = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
        url: '/haidian/tileset.json'
      }))

      tilesets.readyPromise.then(function (tileset) {

        tileset.style = new Cesium.Cesium3DTileStyle({
          color: {
            conditions: [
              ["true", "color('cyan')"]
            ]
          }
        });

        viewer.flyTo(tileset)
      })
    }


cesium-tileseteffect's People

Contributors

zhangti0708 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.