I’m trying to create a very easy plasma effect in a pre-defined viewport, in the middle of my screen. I first thought I create square with a texture on and let that texture move a bit but I was not able to do it.
I also searched here to find some examples but I just don’t get it.
That’s why I posted it here in the beginners section.
Is there anybody who could give me a hand creating an easy looking sinus/cosinus plasma effect which I could put behind some other objects ?
hey dextro, many dynamic texture systems involve some sort of feedback filtering mechanism. like, you feed the texture “seeds”, then let the filtering mechanism make them grow.
for example, imagine placing a single white dot in the middle of a texture A. now, avererage this texture into another texture B. then take B and average it back into A. repeat this “ping pong” averaging constantly over time. the shape and size of the filter kernel you choose is very important here – it can control the direction of growth (make ripples grow outward, make fire rise, etc).
anyways, with this, all you need to do if figure out cool ways of feeding the buffer with seeds. the unreal engine made excellent use of this technique. they created water, fire, plasma … all sorts of cool effects.
for opengl, render-to-texture (RTT) or glCopyTexSubImage should come in handy
hey dextro, another way to achieve some cool effects is to animate perlin noise. create 2 slices of 2D noise, then interpolate between them over time. all kinds of turbulent, noisy effects can be made this way. anyway, it’s a must have in any graphics programmer’s magic bag
you can grab the extension headers here too (glext.h and wglext.h). anyways, what you’re looking for is WGL_ARB_pbuffer and WGL_ARB_render_texture. all this might be considered advanced, but only because it’s such a mess. hopefully all this will change soon. in the mean time, you can render to the frame buffer normally and grab your texture with glCopyTexSubImage2D. while it’s generally not as fast as RTT, it’s a heck of a lot easier to use