Thankfully, a couple of months ago, a friend let me know that you can inject time using ATL, which was updated at the screen's framerate. That got me motivated enough to get this working in a shader! This project includes options to customize each wave to your own parameters and can add melt, doubling and dampening effects as well. The demo project even features a simulator where you can adjust these parameters interactively and see the results.
I haven't grandfathered in all effects featured in that project. Namely the rotating wave and palette cycling I have decided to leave behind. Though those were pretty niche to begin with.
All that said, here are the links to where you can find it: And now for the juicy screenshots:
Installation Instructions:
As usual for my projects, you simply need to take the wave_shader.rpy and put it in the game folder (or subfolder of it) of your project to have the code needed to run it. I've also included a wavey_tag.rpy as well if you would want to apply it as a text tag. Examples for how to use it can be found in the demo project's script.Note: You will need kinetic_text_tags.rpy in order for wavey_tag.rpy to work.
How it Works:
The main way I have it setup to make it easy to add the shader is by using the function statement in ATL to have a function that sets up the transform and applies all the parameters for you. This is done by using my WaveShader class, which has a __call__ function, so that when ATL tries to use it as a function, it can handle the transform. That said, the shader can be applied by yourself manually, but you'll have to instantiate the uniform parameters for the shader yourself. From there, it updates u_shader_time itself using the animation_time parameter that ATL provides to the function, which allows it up update smoothly. The advance_time function is something I plan on using if I develop further shaders so that all of them can piggyback off of it and all use it for their time updates. Important Notes:
Because this function has to keep updating the shader time, it will never pass control onto ATL code below it. So if you want to apply the WaveShader and do some other ATL, I recommend you split it up into parallel blocks. Such as:
Code: Select all
show my_image:
parallel:
# Your ATL
parallel:
function WaveShader()
Credits
- Thanks to Minoh Workshop for being cool with me using their (again) sprite for demo purposes. Check out their VN at https://minoh.itch.io/minotaur-hotel
- Deep-fold for his pixel art space background generator.
- Earthbound backgrounds copyrighted to Nintendo. Please don't sue.
Conclusion
That's all I have for this project. If you missed the links: here they are again.
I'm really glad to be able to finally amend the wave rendering stuff I put out last year. I hope this proves more useful to more projects with it's improvements to speed and versatility. And I'm really happy that I have finally been able to make a renpy shader I'm happy with and hope I can make some more in the future. Maybe even a big pack of 'em for people to play with. Would be a lot of fun. Also should say I'll be putting out an update to Kinetic Text Tags soon as I made a couple tweaks to ATL and the DispTextStyle stuff while working on this project. So maybe keep an eye out for those.Furthermore, if you'd like to learn more about shaders beyond Ren'py's documentation, I highly recommend checking out The Book of Shaders and Shadertoy to start learning the craft. They are invaluable tools and helped a lot in the development of this project.