It may not look like it

But this took all week, and it looks very good in-program.  There's no time for a game.  All I've got is water simulation.

If anyone ever actually reads this, I developed some really useful re-usable code.

A back-buffer abstraction you can activate using
with backbuffer:
And a GLSL shader uniform parameter provider you can activate using
with UniformProvider(shader_obj, param=value,param2=value2, sampler=pygletTexture):

I made useful and cool things but no game :(  Maybe inspiration will hit me sometime about how to make water pressure into a game, but I've been so focused on making it work, I haven't even begun to think of game ideas.

Beautiful flowing water

(log in to comment)

Comments

I have to say it is really awesome, 666 :) So you just write the GLUtil module to show such effect, well, does ratcave module deal with the GLSL? I am a little confused about the relationship between pyglet and ratcave :)
Thanks for the kind words.

Ratcave is a layer on top of pyglet, one that abstracts shaders and meshes a bit.   I literally only use the shader loader, and I think if I ever publish these two things, I'd like to pull out the guts of the shader tech and replace it with my own, so it's more modular(and so coders can get away with one fewer with statements).
Unfortunately I can't get it to run using the Intel drivers on Linux, because they don't support GLSL 1.40 using the compatibility profile of OpenGL.

If I change it to request a core context:
config=pyglet.gl.Config(double_buffer=True, major_version=3, minor_version=2)
…then the shaders load but I get GL_INVALID_OPERATION errors, presumably because you are using deprecated OpenGL functions.  I'll see if I can manage to get the shaders to work with GLSL 1.30, or maybe I'll try to get access to a different computer.

Also, it would be great if in the future you could put your files in a subdirectory inside the archive, rather than in the root of the archive, so that the files don't sprawl over people's downloads directory when extracted.
Hi, does anyone happen to know how to install pyglet for Python 3 in Ubuntu? Here's the error message I'm getting:

christopher@earthbound:~/Downloads/wavestopper$ sudo -H pip3 install requirements.txt 
Collecting requirements.txt
  Could not find a version that satisfies the requirement requirements.txt (from versions: )
No matching distribution found for requirements.txt

If you can't help me that's totally fine. I might just mark DNW but I hope you don't take it as criticism. I know it's not your fault that they make it so hard.

@Cosmologicon, it looks like you forgot the -r switch.  It should be "pip3 install -r requirements.txt", to read the packages from the file, or directly "pip3 install pyglet numpy ratcave".  Otherwise it thinks you are trying to install a package called "requirements.txt".
Oh yeah, oops. I was copying from the readme file, but I should have realized that. Thanks!
Oh yeah, sorry.  That's my bad.  It's been so long since I've installed from requirements.txt properly.
I'm getting one of those invalid operation errors mentioned elsewhere in this thread.

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    main(*sys.argv[1:])
  File "main.py", line 5, in main
    game=GameWindow(1280, 960, image_file)
  File "/tmpfs/ws/gameplay/Windows.py", line 17, in __init__
    self.activeScreen=WaveStopperGame(starting_image, self.window)
  File "/tmpfs/ws/gameplay/Game.py", line 66, in __init__
    self.setup_initial_frame()
  File "/tmpfs/ws/gameplay/Game.py", line 78, in setup_initial_frame
    with UniformProvider(fire_and_forget, intexture=self.start_texture, targetColor=material.color,colorTolerance=0.1, initialStatusColors=material.initialState):
  File "/tmpfs/ws/GLUtil/UniformProvider.py", line 93, in __enter__
    self.SupplyValues()
  File "/tmpfs/ws/GLUtil/UniformProvider.py", line 30, in SupplyValues
    self.invokeSetter(location,value)
  File "/tmpfs/ws/GLUtil/UniformProvider.py", line 45, in invokeSetter
    gl.glUniform1i(location,self._currentTextureLocation)
  File "/tmpfs/venv3.6/lib/python3.6/site-packages/pyglet/gl/lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid operation'

Yeah, unfortunately, debugging "GLException" is hard, and the stack trace says almost nothing.

I can see it's the first time that my code tries to talk to opengl through pyglet.  My best guess without having your system to poke around in is that the shader model  of 4.0 isn't supported on of your GPU/driver.