ZGameEditor forum Forum Index ZGameEditor forum
The tool for creating 64kb games. ZGE Wiki homepage.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Psycho effect

 
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> Tips'n'Tricks
View previous topic :: View next topic  
Author Message
Rado1



Joined: 05 May 2010
Posts: 20

PostPosted: Thu Jul 15, 2010 5:56 pm    Post subject: Psycho effect Reply with quote

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...



psycho.zip
 Description:

Download
 Filename:  psycho.zip
 Filesize:  50.45 KB
 Downloaded:  18 Time(s)

Back to top
View user's profile Send private message
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Thu Jul 15, 2010 6:47 pm    Post subject: Reply with quote

Exclamation

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



Plasma.zgeproj
 Description:

Download
 Filename:  Plasma.zgeproj
 Filesize:  1.22 KB
 Downloaded:  14 Time(s)

Back to top
View user's profile Send private message
VilleK
Site Admin


Joined: 15 Jan 2007
Posts: 962
Location: Stockholm, Sweden

PostPosted: Thu Jul 15, 2010 7:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Thu Jul 15, 2010 7:06 pm    Post subject: Reply with quote

d'oh,

Thanks Ville ~ Stupid forgiving NVIDIA drivers Rolling Eyes

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

K
Back to top
View user's profile Send private message
Rado1



Joined: 05 May 2010
Posts: 20

PostPosted: Sat Jul 17, 2010 1:50 pm    Post subject: Reply with quote

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.



psycho_simple.zgeproj
 Description:

Download
 Filename:  psycho_simple.zgeproj
 Filesize:  1.56 KB
 Downloaded:  12 Time(s)

Back to top
View user's profile Send private message
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Sat Jul 17, 2010 2:29 pm    Post subject: Reply with quote

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 Cool Expensive effects such as ambient occlusion generally use a noise texture to sample from as well.

K
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> Tips'n'Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group