Share a Shader!

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Share a Shader!

Post by slime »

And the exact same code (with the relevant name changes) works exactly as expected in 0.8.0? Does print(gradient:getWarnings()) output anything? Does it work if you separate the width and height variable declarations, like:

Code: Select all

extern float width;
extern float height;
?
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

gradient:getWarnings()) returns 'no errors' and separating width & height in the shader had no effect.
In version 0.9 do you get yellow triangles or shaded triangle (concerned that something is off on my computer).
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Share a Shader!

Post by slime »

Here's what it looks like for me (0.9.0):
8CNr4Nf.png
8CNr4Nf.png (40.71 KiB) Viewed 483 times
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

Darn!
Looks like I'm going to be aced out of version 0.9.0
Everything OK on 0.8
Don't know where to go from here.
Edit: If I replace the width & height in the shader with 512, then I get the shaded triangles that Slime sees and I get with version 0.8.
Sooo!, the problem I'm having is definitely with shader:send & extern float width, height in version 0.9!
Attachments
screenshot.png
screenshot.png (5.57 KiB) Viewed 2577 times
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

With reference to Love2d Version 0.9:
BUGFIXES
"Fixed Shader:send with Images and Canvases failing sometimes."
Might have to revisit this topic again!
I have a similiar problem with morphing.
'Shader:send' just doesn't work for me on 0.9 (but does on 0.8).
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Share a Shader!

Post by slime »

What video card do you have? Are your drivers up to date? What OS? Does shader:sendFloat("width", 512) work? Does shader:send silently fail for all types of variables (images, numbers, vectors, etc) or just numbers?
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

slime wrote:What video card do you have? Are your drivers up to date? What OS? Does shader:sendFloat("width", 512) work? Does shader:send silently fail for all types of variables (images, numbers, vectors, etc) or just numbers?
I have an Aspire 4730z laptop with the Mobile Intel(R) series 4 Express chip set (if that helps).
Drivers last updated January.
All pixelEffects work fine on version 8.0 of Love.
shader:send and shader:sendFloat both fail silently with both numbers& images in version 0.9 of Love but work fine if manually entered into the shader.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Share a Shader!

Post by slime »

How old is the version of 0.9.0 you have? Does this one have the same behaviour? https://bitbucket.org/Boolsheet/love_wi ... ev-x86.zip
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

slime wrote:How old is the version of 0.9.0 you have? Does this one have the same behaviour? https://bitbucket.org/Boolsheet/love_wi ... ev-x86.zip
Jumped the gun!
Was running Love 0.9 build 130403.
Boolsheet's build doesn't have the problem - so, all's well.
Thanks Slime for your help.
Should learn to wait for the formal release but was eager to see what 0.9 had to offer and what needed to be changed from 0.8.
Best
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Share a Shader!

Post by Ref »

Still playing with GLSL shaders.
Try to figure out how they work (slow learner).
One of the big problems for me is the non-‘kikito’ coding style.
Most troubling for me:
FORMAT: no use of ‘sp’ or ‘tab’ – even though permissible
VARIABLE NAMES: short, barely descriptive names (often single character)
MAGIC NUMBERS: 5.0929581 = 5 but 2.0 ~= 2.01
TIME: externally supplied time variable continually increases but shader stays inbounds
RETURN: nameless vec4 returned
SUBSCRIPTING: resolution.x = resolution[0] even though externally supplied vec2 = {400,400}
COMMENTS: rarely used
Y AXES: Love use of inverted y axes
ARRAYS: start at zero

Question: Does the number of characters in a shader effect execution speed or memory use?

Demos below are Love conversions of shaders found on the web (e.g. GSGL sandbox) – nothing new, just conversions with minor experimental changes.
Lots of luck at figuring out what’s in the shader.
Attachments
heart.love
How do they do it?
(1.06 KiB) Downloaded 271 times
checkered_sphere.love
Mouse controls lighting
(1.35 KiB) Downloaded 258 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 4 guests