Page 17 of 33

Re: Share a Shader!

Posted: Sun May 05, 2013 5:32 pm
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;
?

Re: Share a Shader!

Posted: Sun May 05, 2013 5:45 pm
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).

Re: Share a Shader!

Posted: Sun May 05, 2013 5:53 pm
by slime
Here's what it looks like for me (0.9.0):
8CNr4Nf.png
8CNr4Nf.png (40.71 KiB) Viewed 487 times

Re: Share a Shader!

Posted: Sun May 05, 2013 5:58 pm
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!

Re: Share a Shader!

Posted: Mon May 06, 2013 6:19 pm
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).

Re: Share a Shader!

Posted: Mon May 06, 2013 6:41 pm
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?

Re: Share a Shader!

Posted: Tue May 07, 2013 12:39 am
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.

Re: Share a Shader!

Posted: Tue May 07, 2013 2:14 am
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

Re: Share a Shader!

Posted: Tue May 07, 2013 12:49 pm
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

Re: Share a Shader!

Posted: Mon May 20, 2013 12:27 pm
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.