Git Product home page Git Product logo

Comments (4)

gkjohnson avatar gkjohnson commented on September 26, 2024

Notes

  • nullFeatureId represents a null / non existant value

Feature by Texture

  • "index" refers to the index of the texture in the "textures" list
  • "texCoord" refers to the texture coordinate attribute to use to sample the textures. Internally to the gltf this is stored as TEXCOORD_# but three converts this to uv#.
  • "channels" refers to which channels data should be returned from
  • Textures are always unsigned 8 bit
  • Note - dedicated feature textures will not be automatically disposed. We'll need to track them separately and dispose as needed.

Feature by Attribute

  • attributes will always be scalar and non normalized
  • "featureCount" is the number of unique features used
  • "attribute" refers to the geometry attribute used for the id
  • three.js makes all attributes lowercase, it seems

Feature by Index

  • If attribute and texture are non existent ids are assigned per vertex
  • QUESTION: Why not per triangle? This means that id values will be interpolated across the face of the triangle?

from 3dtilesrendererjs.

gkjohnson avatar gkjohnson commented on September 26, 2024

Reading data from a canvas takes around 1-2ms to read but we don't have to deal with disposing texture data from the canvas and it's sync. WebGL texture read would probably also be similarly slow unless async reads are used.

https://jsfiddle.net/ycn46tfq/2/

Multiple textures can be sampled at once by writing them next to each other to cut down on read time

from 3dtilesrendererjs.

gkjohnson avatar gkjohnson commented on September 26, 2024

We can't use canvas readback due to the inability to disable alpha multiplication (link) which results in losing all data on read. A better solution may be to render and readback from a local webgl instance and immediately discard the texture. Then all image bitmaps can be disposed on tiles renderer disposal.

See gltf variants approach for a similar type of case.

Depending on potential performace impliciations it would be possible to just upload the single pixel that needs to be written. See latest WebGL2 update from here.

from 3dtilesrendererjs.

gkjohnson avatar gkjohnson commented on September 26, 2024

Updating the WebGLRenderer.copyTextureToTexture to behave more similarly to the copyTextureToTexture3D function such that it takes a bounding box to copy in. Must perform benchmarks to demonstrate performance improvements.

from 3dtilesrendererjs.

Related Issues (20)

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.