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

Add support for per-side voxel texturing #1

Merged
merged 4 commits into from
Apr 5, 2014

Conversation

deathcap
Copy link
Contributor

@deathcap deathcap commented Apr 5, 2014

Currently, the texture index is extracted directly from the voxel ID (voxel&0xff), so all faces have the same texture. This PR adds an optional voxelSideTextureIDs 2d ndarray argument to computeMesh(), which can be used to assign different textures to each of the sides.

Using this in voxel/voxel-stitch@c05021b

@deathcap
Copy link
Contributor Author

deathcap commented Apr 5, 2014

Hm, I'm not sure if the side calculation is correct, it seems side passed to voxelTexture is always either 0 or 3 (if flipped). Testing texturing each of the six faces differently, but only the right-facing face (side 3) has a different texture, all others use the side 0 index:

screen shot 2014-04-05 at 2 05 31 pm

@deathcap
Copy link
Contributor Author

deathcap commented Apr 5, 2014

Fixed =) d+(flip?3:0)

screen shot 2014-04-05 at 2 23 48 pm

mikolalysenko added a commit that referenced this pull request Apr 5, 2014
Add support for per-side voxel texturing
@mikolalysenko mikolalysenko merged commit c16f69a into mikolalysenko:master Apr 5, 2014
@mikolalysenko
Copy link
Owner

Thanks! Merged

@deathcap deathcap deleted the sides branch April 5, 2014 23:14
@deathcap deathcap mentioned this pull request Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants