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

XScreensaver #1

Open
snshn opened this issue Jul 30, 2016 · 2 comments
Open

XScreensaver #1

snshn opened this issue Jul 30, 2016 · 2 comments

Comments

@snshn
Copy link

snshn commented Jul 30, 2016

Beautiful.

How much work would it be to make a screensaver fox X11 out of this, you think?

@Erkaman
Copy link
Owner

Erkaman commented Jul 30, 2016

I am not familiar with XScreensaver, so I can't say anything about that part.

However, concerning the graphics part, the demo doesn't really use any advanced WebGL features at all, so porting it to C/C++ OpenGL should not be very hard at all.

But you would have to fix a small bug before you can use it as a screensaver: if the demo goes on for too long, then there will be missing triangles and stuff in some places. This is because the camera keeps moving forward in the demo, and so the chunks will, after a while, be drawn at positions with VERY high z-coordinate values(because the camera is moving in the z-direction). If the demo goes on for too long, then regular 32-bit floating values(that is, GL_FLOAT) are simply not enough to store those high z-coordinates values, so it starts visually bugging out a bit. but it doesn't crash or anything, it just looks a bit bad.

The solution to the above is that you, instead of moving the camera, keeps moving the chunks towards the camera. And the camera is kept entirely immobile. But since the chunks move to the camera, you get the illusion that the camera is moving. So this looks identical to the current demo, but you will not need any high z-coordinates values in this case, so the visual bugs disappears.

Anyways, I currently don't have time to write a screensaver. Maybe I will have time the next weekend, possibly. But if you feel like it, you can do it yourself. The code is well-commented, so porting should not be hard, I hope. But if anything in the code is unclear, please ask and I will clarify.

@snshn
Copy link
Author

snshn commented Jul 31, 2016

Thank you for a quick and very elaborate response. I hope me or somebody else will port it to work as a screensaver on GNU/Linux and such once there's enough free time.

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