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

Tile tinting #11

Closed
jleahey opened this issue Dec 22, 2012 · 6 comments
Closed

Tile tinting #11

jleahey opened this issue Dec 22, 2012 · 6 comments
Assignees

Comments

@jleahey
Copy link
Owner

jleahey commented Dec 22, 2012

We need to be able to tint tiles for lighting, but our very simplistic java.awt.image, which is hardware accelerated, has no way to do this natively. We could render out different versions of all oft the images at load time, but there are better ways to do this which might carry over something to an Android implementation.

Current approach: Switch to OpenGL using jogl.
http://jogamp.org/jogl/www/

@ghost ghost assigned jleahey Dec 22, 2012
jleahey added a commit that referenced this issue Dec 23, 2012
@perimosocordiae
Copy link
Collaborator

Most of the lighting seems to work right, but there are weirdnesses for (some) blocks diagonally-adjacent to the sky:
Screen Shot 2012-12-24 at 1 21 10 PM

@jleahey
Copy link
Owner Author

jleahey commented Dec 25, 2012

This is because of the visibility matrix generated by the the world generator. This used to be a feature and it made the ground look nicer, but it's not worth it to have light travel diagonally. Soon visibility needs to be completely removed for lighting, and will require some tweaking.

@perimosocordiae
Copy link
Collaborator

Cool, I'll just leave the lighting to you, then. 😁

@perimosocordiae
Copy link
Collaborator

Recent commits look really good! One last (I hope) small bug:
Screen Shot 2012-12-27 at 8 09 14 PM

It's dark outside (just past midnight) but the non-air tiles are still tinted as in midday. This may be as simple as adding a check to timeOfDay in the code that gets the sun sources, but I'll leave this to you.

@jleahey
Copy link
Owner Author

jleahey commented Dec 28, 2012

Will do! This will be a simple fix. Also changeTile needs to activate lighting changes as well. Sand falling currently does not update lighting.

jleahey added a commit that referenced this issue Dec 29, 2012
If we're ever looking for performance tweaks, this function could be
memoized each tick with new lighting.
jleahey added a commit that referenced this issue Dec 29, 2012
Tile change is used primarily by the chunkUpdate() and if water is
cascading it will cause many lighting updates.
@jleahey
Copy link
Owner Author

jleahey commented Dec 29, 2012

Except that there are no torches, the tile tinting and lighting engine work.

@jleahey jleahey closed this as completed Dec 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants