Coder Social home page Coder Social logo

Comments (3)

kpreid avatar kpreid commented on June 9, 2024

Preferably without allocating twice the texture space, but that would require being able to split meshes by material (which would be useful, but hairy).

From discussion with Ralith on the Rust GameDev Discord server: Note that we don't have to entirely split meshes and use separate draw calls. We can just have multiple bound textures, and store in the vertices an index of which texture set, if any, to use, like so:

  • 0 = use vertex color
  • 1 = use (reflectance atlas 0, constant emission zero)
  • 2 = use (reflectance atlas 1, emission atlas 1)

My other idea prior to this was to indirect through a table of texture coordinate offsets, so that the emissive data could be written to the same texture in a different location; that would have the advantage of fewer textures and supporting things like defragmenting the texture atlas, but is likely to cost more.

from all-is-cubes.

kpreid avatar kpreid commented on June 9, 2024

As of commit 2e9f6c6 we have a plan for how to allocate textures as above, by having the mesher tell the allocator what Channels are needed.

Next steps:

  • Have the allocators actually allocate separate textures (and designate them in the vertex coordinates)
  • Implement emission in the shaders
  • Have the mesh generation switch to textures even for simple blocks if there is an emission value (this way, we don't need two vertex colors).

from all-is-cubes.

kpreid avatar kpreid commented on June 9, 2024

As of commit a2fd653, emission rendering is active. It is not yet implemented in the glTF export, but since texturing is still generally a work in progress there, I'm going to call this done.

from all-is-cubes.

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.