I would like to create a blur or trail effect where on my object and was trying to find a way to do this. I thought this may be possible using the Window.record method, but didn't see how I would achieve this. Does anyone have a real basic example of how this could be achieved, or is this not possible?
If you want objects to leave a trail, you can just remember the last (up to) 10 positions and draw the object at that place, but with a colour that has an ever-decreasing alpha channel. You can also try increasing or decreasing the size of images as they fade out, using the
scale_y parameters. (No code, sorry...)
For a true blur effect, you would probably have to look into GLSL shaders based on Spooner's Ashton library. I've never tried this myself, though.
Window#record does not help here, it mostly exists to speed up batch rendering of thousands of images, typically map tiles.
I'm trying to create a permanent blur/trail. Storing in something like an array in my case would result in too many draw calls over time. In other frameworks I have seen a feature where you can draw to an in memory image and then blit that to a window surface.
If you just want a fixed, permanent trail sticking out in one direction from an image, you're probably better-off pre-rendering it in a paint program and saving it as a PNG. Sounds kinda boring to me, though...
That's not what I'm doing. I'm doing organic life growth type of simulations. So the trails continue to build up over time showing the patterns. It's actually pretty cool.
Oh, permanent :)
In that case
is indeed relevant. But it does not render to a texture, it only groups a lot of
calls into a vertex array, so it is not unlimited. And you cannot add to an existing, recorded macro.
Ashton has render-to-texture functionality, but I don't know how well it works: https://github.com/Spooner/ashton
Only that would allow your simulation to go on forever.
Thank you. It looks like the Ashton::Texture is what I'm looking for. I'm running into an issue that appears to be a bug with Ashton; I'll see if I can figure that out.
Currently rendering to texture is broken with fullscreen.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill