Page 2 of 5

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sun Jul 07, 2013 7:43 pm
by Ref
Can't come up with anything here.
Just spinning my wheels.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Fri Jul 12, 2013 9:18 pm
by chezrom
I love your drawings !

Here's the mine, using pixel effect and derived from the "metaball" demo but with voronoi diagram, a thing that always amaze me.

Keys :
  • a point follow the mouse
  • Mouse Left to change colors
  • Mouse right to change movement of other points
  • ESC to quit
  • any other key to toggle on/off the drawing of the point

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Fri Jul 12, 2013 10:49 pm
by RedHot
Ref wrote:Can't come up with anything here.
Just spinning my wheels.
Your example won't work on AMD cards as AMD drivers are extremly picky when it comes to casting from int to float. I assume you are using an nvidia card and haven't experienced the problem.

FTFY.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sat Jul 13, 2013 2:45 am
by Ref
Thanks for pointing that out - I think.
Babe in the woods here.
Would really appreciate any additional explanation as to what 'casting from int to float' really means.
It appears that you just removed the extern S (scaling factor) which is a float which I used to augment other float numbers (such as 0.03).
Just don't know what 'casting' is - my bad.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sat Jul 13, 2013 7:16 pm
by RedHot
I must have omitted the "extern S", my bad.


When you are doing arythemtic operations in C or C++ if you'd divide int by a float (f.i) 4/2,5 , the int gets promoted by default to a float, so you'd get 4,0/2,5 .

Same goes for shaders using Nvidia drivers. AMD is different. The shader won't compile if you'd wish to mix ints with floats. You have to change the type of variable implicitly (that's what we call casting). You can't use 4/2,5 it's gotta be 4,0/2,5

So if'd have

Code: Select all

int i = 4;
float n = 2.5
We need to do an implicit cast

Code: Select all

float result = (float)i/n;
Should be clear now

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sun Jul 14, 2013 2:43 am
by Ref
Thanks for the INFO.
In my case, how would I make the shader scaleable?
In love.update I do:

Code: Select all

if love.keyboard.isDown( 'up' ) then S=S+dt s.effect:send('S',S) end
if love.keyboard.isDown( 'down' ) then S=S-dt s.effect:send('S',S) end
in the shader I have:

Code: Select all

extern number S;
and scale the gears using:

Code: Select all

Gear g0 = Gear(vec2(-0.30*S,0.00*S),	16,	0.03*S,	0.10*S,	time);
How would I avoid casting?
Help appreciated.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sun Jul 14, 2013 1:11 pm
by RedHot
Just change 16 to 16.0

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Sun Jul 14, 2013 7:14 pm
by Ref
Thanks!
Something I would never have caught as my Acer doesn't care.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Wed Jul 24, 2013 5:16 pm
by Zer0
Odd that this thing has yet to show up.

I would describe it as Classic.

Re: My 4KB Hypnotic Thing, wanna share yours ?

Posted: Fri Jul 26, 2013 11:17 pm
by DaedalusYoung
I had nothing better to do, so here's mine. Not exactly what I had in mind when I started, but it still turned out pretty good.

Mouse position influences colour value, left click increases size, right click decreases size. Any key quits.