Translucency, better usage of VAOs, Sync objects instead of glFinish(), Rudimentary frustum culling#29
Translucency, better usage of VAOs, Sync objects instead of glFinish(), Rudimentary frustum culling#29obiwac merged 10 commits intoobiwac:masterfrom Jukitsu:master
Conversation
|
Cool! I won't merge this here as this repo is intended to be sync'd with the tutorial series, but it would be nice to have some place to contribute to a "current" version of this project where stuff I may not even cover at all in the tutorial series can be added. Two possibilities for this:
Personally leaning towards the later option. What do you think? (Also some of your changes have made me realize in hindsight that there are perhaps more pythonic ways of doing certain things, I should probably spend the time going through the code on this repo cleaning stuff up a bit 😉 ) |
|
Yeah I agree with the latter option :). It'd be interesting if everyone would be able to contribute to the "current" version too. |
episode-11/main.py
Outdated
| gl.glFinish() | ||
| self.world.draw() | ||
|
|
||
| gl.glClientWaitSync(self.fence, gl.GL_SYNC_FLUSH_COMMANDS_BIT, 16666667) |
There was a problem hiding this comment.
Were you ever able to reproduce #10 and is there a chance that this fixes it? Not in a position to try this out myself...
There was a problem hiding this comment.
I dont really have #10 and this is just an attempt to use sync objects, rn I just pass an arbitrary value, it should behave similar to glFinish()
episode-11/chunk.py
Outdated
|
|
||
| self.vao = gl.GLuint(0) | ||
| gl.glGenVertexArrays(1, self.vao) | ||
| gl.glGenVertexArrays(1, ctypes.byref(self.vao)) |
There was a problem hiding this comment.
Any specific reason for this as opposed to just passing self.vao?
There was a problem hiding this comment.
I feel safer with pointer 🧌
episode-11/chunk.py
Outdated
|
|
||
| self.ibo = gl.GLuint(0) | ||
| gl.glGenBuffers(1, self.ibo) | ||
| def __del__(self): |
There was a problem hiding this comment.
I should probably retroactively add this to all episodes for correctness. I didn't bother during the tutorials because it's not technically necessary in this case and it's perhaps slightly confusing to newcomers.
episode-11/chunk.py
Outdated
| sx = math.floor(clx / subchunk.SUBCHUNK_WIDTH) | ||
| sy = math.floor(cly / subchunk.SUBCHUNK_HEIGHT) | ||
| sz = math.floor(clz / subchunk.SUBCHUNK_LENGTH) | ||
| sx = clx // subchunk.SUBCHUNK_WIDTH |
episode-11/main.py
Outdated
| # pyglet stuff | ||
|
|
||
| pyglet.clock.schedule_interval(self.update, 1.0 / 10000) | ||
| pyglet.clock.schedule(self.update) |
There was a problem hiding this comment.
Not really, its someone who suggested this as a fix for the flickering, so I added this
There was a problem hiding this comment.
Okay, I'll check it has the desired effect.
Alright, it's decided then. I'll add that tomorrow around lunch. |
|
See commit 2872f8c. |
|
Hmm that's curious, dunno why there's a merge conflict. |


Uh oh!
There was an error while loading. Please reload this page.