Coder Social home page Coder Social logo

Comments (3)

gkjohnson avatar gkjohnson commented on June 13, 2024 4

As Mugen mentioned - users can already do this by creating geometry with a color channel which is effectively how InstancedMesh worked. In order to do this in a more memory-efficient way you'd need to pack the per-geometry colors into a texture and sample them in the shader. I've provided a demo of this idea in #27170 (comment).

In short, though, I think this can be closed as a duplicate of #27203 which is really just about being able to have more granular, high performance control over the material of individual geometries.

from three.js.

Mugen87 avatar Mugen87 commented on June 13, 2024 3

Instancing and batching work different meaning you don't have instanced attributes when rendering a batched mesh. Having instanced attributes made it easy to implement instanced colors for InstancedMesh.

It's important to highlight that setColorAt() was added so different colors per instance was possible at all. When using BatchedMesh, you can already have different colored geometries via vertex colors.

Meaning if you use addGeometry() with geometries that hold a color attribute, you can author different colors per geometry by simply altering vertex color values.

from three.js.

mrdoob avatar mrdoob commented on June 13, 2024

@gkjohnson Have your ever needed this?

from three.js.

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.