Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous voxel colors #144

Open
piellardj opened this issue Aug 5, 2024 · 0 comments
Open

Continuous voxel colors #144

piellardj opened this issue Aug 5, 2024 · 0 comments
Assignees
Labels
engine Concerns the rendering engine idea / discussion Let's discuss about it world Concerns the procedural world

Comments

@piellardj
Copy link
Member

It would be nice for the voxels to have a bit of nuance in their coloring, instead of hard threshold.

Image
Above, hard threshold: voxels are sand-colored and then suddenly grass-colored

Image
Above, nuancing: voxels go softly from sand to grass

The tricky thing is that the engine must know in advance all the possible voxel materials, so how could we handle all the possible colors ?

Idea:

  • in the world:
    • preallocate a color palette (4096 colors for instance, which will be as many materialId)
    • define key colors: sand is yellow, grass is green, rock is grey etc.
    • when computing a voxel, the world determines all the types it is (example: this voxel is 25% grass, 75% sand). From this, the world computes the exact color the voxel should be, by interpolation
    • find the closest color in the palette
    • set this voxel to the associated materialId

An example is in the test scene of aresrpg-engine

@Sceat Sceat added engine Concerns the rendering engine idea / discussion Let's discuss about it world Concerns the procedural world labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Concerns the rendering engine idea / discussion Let's discuss about it world Concerns the procedural world
Projects
Status: Todo
Development

No branches or pull requests

3 participants