Can't come up with anything here.
Just spinning my wheels.
My 4KB Hypnotic Thing, wanna share yours ?
Re: My 4KB Hypnotic Thing, wanna share yours ?
- Attachments
-
- gears.love
- Just another one of those darn shaders
- (1.42 KiB) Downloaded 208 times
Re: My 4KB Hypnotic Thing, wanna share yours ?
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 :
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
- Attachments
-
- voronoi.love
- (1.3 KiB) Downloaded 176 times
Re: My 4KB Hypnotic Thing, wanna share yours ?
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.Ref wrote:Can't come up with anything here.
Just spinning my wheels.
FTFY.
- Attachments
-
- gears.love
- Example from above working on AMD cards
- (1.45 KiB) Downloaded 160 times
Re: My 4KB Hypnotic Thing, wanna share yours ?
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.
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 ?
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
We need to do an implicit cast
Should be clear now
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
Code: Select all
float result = (float)i/n;
Re: My 4KB Hypnotic Thing, wanna share yours ?
Thanks for the INFO.
In my case, how would I make the shader scaleable?
In love.update I do:
in the shader I have:
and scale the gears using:
How would I avoid casting?
Help appreciated.
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
Code: Select all
extern number S;
Code: Select all
Gear g0 = Gear(vec2(-0.30*S,0.00*S), 16, 0.03*S, 0.10*S, time);
Help appreciated.
Re: My 4KB Hypnotic Thing, wanna share yours ?
Just change 16 to 16.0
Re: My 4KB Hypnotic Thing, wanna share yours ?
Thanks!
Something I would never have caught as my Acer doesn't care.
Something I would never have caught as my Acer doesn't care.
Re: My 4KB Hypnotic Thing, wanna share yours ?
Odd that this thing has yet to show up.
I would describe it as Classic.
I would describe it as Classic.
- Attachments
-
- Vortex.love
- (768 Bytes) Downloaded 163 times
If you can't fix it, Kill it with fire. ( Preferably before it lays eggs. )
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: My 4KB Hypnotic Thing, wanna share yours ?
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.
Mouse position influences colour value, left click increases size, right click decreases size. Any key quits.
- Attachments
-
- dyhypno.love
- (1.8 KiB) Downloaded 196 times
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests