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 simple lighting (sun), and point light sources (torches, etc.) #42

Open
benmoran56 opened this issue Jul 17, 2018 · 3 comments
Open

Comments

@benmoran56
Copy link
Collaborator

This will require writing some simple LightSource classes. OpenGL has a few different types of lights with logs of parameters. It will require a little bit of OpenGL knowledge to write these classes but, once written, will be easy to use to add lights emitting to different things.

@XenonLab-Studio
Copy link
Owner

Yes, actually a dynamic lighting system would be interesting. I have resumed my work for textures and all the graphics, and with the addition of a lighting system everything will look more beautiful. Thank you for your cooperation.

@benmoran56
Copy link
Collaborator Author

Speaking of textures, I have already created a branch with separate textures. You can see them here: https://github.com/benmoran56/TerraCraft/tree/independent_images/assets/textures
It allows you to create one image per block. To load them we use the pyglet.resource module, so that internally they are put into an TextureBin (sprite sheet) for performance.

There is one problem, which is why I have not merged the changes. Some of the textures look blurry. Currently, we are setting the texture scaling to "nearest" to have a pixelated appearance. However, when using the pyglet text module, the texture scaling gets reset. This can make the block textures blurry. The next pyglet release has a new option to change the default texture scaling for all textures, so maybe we can wait for that version.

@XenonLab-Studio
Copy link
Owner

Interesting then pixel perfection and smooth (active / deactivated) will be in the new features of the next release? thanks for the news. Surely it is something very useful. Thank you.

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

No branches or pull requests

2 participants