Giter VIP home page Giter VIP logo

voxel-texture's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voxel-texture's Issues

Animated Textures

eg: texture.animate(['water1', 'water2', 'water3']) use canvas or something like this example.

Paint BG of atlas black.

Only transparent behind textures that are transparent. Read which textures are transparent from the atlas manifest (which will be populated when meshing and determined (again) with https://github.com/hughsk/opaque).

This will fix the transparency oddness with mipmaps in the distance.

Add Sprite Map support

To load a single texture packed with smaller textures. Crop them up and load them into the materialIndex with canvas.

example using MeshBasicMaterial

heya, i'd like to use something like this for wireframed flat color voxels (should render super fast):

  var material = [
    new CubeMaterial( { vertexColors: THREE.VertexColors, opacity: 0.5 } ),
    new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true } )
  ]
  THREE.SceneUtils.createMultiMaterialObject( cube, material )

wont work with large numbers of voxels

I should add this to the voxel-engine readme but using CubeGeometry won't work with more than a couple hundred voxels because each CubeGeometry is a separate mesh that has to get sent to the GPU. In voxel-engine we create composite meshes so there are about 32,000 voxels per chunk (each chunk is a mesh) and we then make 16 chunks in most of the demos so it is only 16 objects that have to get sent to the GPU.

however this module is still awesome for certain use cases

Rollup can not build script, due to disallowed `delete` for strict mode.

Strict mode doesn't allow deleting local variables, but this library does it anyway here:

https://github.com/shama/voxel-texture/blob/master/index.js#L309

Results in an error when trying to use the module in a build:

node_modules/voxel-texture/index.js (284:6)
282:     }, function() {
283:       self._afterLoading();
284:       delete canvases;
           ^
285:       self.materials = self.materials.concat(textures);
286:       cb(textures);
SyntaxError: Deleting local variable in strict mode (284:6) in /Users/bailey_stoner/.local/share/go/src/git.sr.ht/~monokrome/blek/node_modules/voxel-texture/index.js

[perf improvement suggestion] dedupe materials

heya,

so it turns out that textures are by far the biggest issue in voxel.js performance. I believe that voxel-texture isn't smart about not duplicating textures if the textures are the exact same url, so if you say textures.load('grass') it will make ['grass', 'grass', 'grass', 'grass', 'grass', 'grass'] and duplicate it 6 times

do you have any other ideas for perf improvements beyond this?

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.