Psycho effect

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Psycho effect

Post by Rado1 »

A simple "psychedelic" lava/plasma-like effect. Can also be used as a screensaver.

P.S. I tried to find the simplest way how to achieve the desired effect without time-consuming recalculation of a large bitmap; I think usage of constant-size RenderNet is not a bad idea...
Attachments
psycho.zip
(50.45 KiB) Downloaded 1013 times
User avatar
Kjell
Posts: 1910
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:!:

You might want to look into shaders for these kind of things .. updating 80.000 triangles every frame is not all that cheap. Attached is a example ( not the exact same effect, but the same idea ).

K
Attachments
Plasma.zgeproj
(1.22 KiB) Downloaded 1131 times
User avatar
VilleK
Site Admin
Posts: 2316
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Kjell, I had to add ".x" in the line below for the fragment shader:

float z = texture2D(tex1, gl_TexCoord[0].xy).x;

Both examples look good, the one by Rado1 takes up a lot of cpu. Kjells example is cpu friendly but then you have to deal with GPU-incompatibilities instead.
User avatar
Kjell
Posts: 1910
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

d'oh,

Thanks Ville ~ Stupid forgiving NVIDIA drivers :roll:

*Updated Plasma.zgeproj in my previous post with the fix.

K
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Yes you are right, updating 80.000 triangles every frame is not very cheap of course. I stupidly used it just for zooming the picture out, just to make the effect more "attractive". The lava effect by itself has almost no CPU footprint; see the attached version.

Is there any way how to achieve zooming out effect with shaders without too large texture bitmap (e.g., it is fully computed by shader)? I heard that computation of Perlin noise is very expensive also in GLSL.
Attachments
psycho_simple.zgeproj
(1.56 KiB) Downloaded 1109 times
User avatar
Kjell
Posts: 1910
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Rado1,

Hmm .. psycho_simple.zgeproj still uses 80K polygons?

Anyway, doing ( perlin ) noise in GLSL isn't all that bad .. but if you can fake it, fake it 8) Expensive effects such as ambient occlusion generally use a noise texture to sample from as well.

K
Post Reply