Shädows (A light engine)

Showcase your libraries, tools and other projects that help your fellow love users.
Skeletonxf
Citizen
Posts: 87
Joined: Tue Dec 30, 2014 6:07 pm

Re: Shädows (A light engine)

Post by Skeletonxf » Thu Aug 25, 2016 4:39 pm

When trying to run the demo on my phone I get the following error

Error

Cannot compile pixel shader code:
0:1 S0052: Uniform variable with initializer

Traceback

[C]: in function 'newShader'
shadows/Shaders.lua:41 in main chunk
shadows/init.lua:9 in main chunk
etcetera

Any ideas on fixing it?

Long overdue edit: These sorts of errors are caused by trying to run OpenGL code not written to also run fine in GLES that the mobile love versions use.

Sungray
Prole
Posts: 7
Joined: Sun Apr 09, 2017 8:02 pm

Re: Shädows (A light engine)

Post by Sungray » Mon May 29, 2017 11:32 am

Hi guys,

Is there a way to create a shadow shape which mimics the shape of a sprite, excluding the alpha ? I'm thinking about creating a polygonshape by pointing the outline of my sprite, but it seems complicated.

To be clear, I want the shadow of my character to look like my character.

Skeletonxf
Citizen
Posts: 87
Joined: Tue Dec 30, 2014 6:07 pm

Re: Shädows (A light engine)

Post by Skeletonxf » Wed May 31, 2017 2:16 pm

I think you would have to create a shape https://github.com/matiasah/shadows/wiki/Shape out of verticies that outline your spite. So you'd first have to find a way to convert your spite into verticies.

If you only need one or two sprites you could probably do it manually but if you're going to have a lot you'd probably need some fancy algorithm to take the image data and output the vertices.

Sungray
Prole
Posts: 7
Joined: Sun Apr 09, 2017 8:02 pm

Re: Shädows (A light engine)

Post by Sungray » Wed May 31, 2017 2:47 pm

Yep thats what I expected :) thanks. I'll work on that.

KyleFlores1014
Citizen
Posts: 72
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 » Thu Jan 04, 2018 12:25 pm

Skeletonxf wrote:
Thu Aug 25, 2016 4:39 pm
When trying to run the demo on my phone I get the following error

Error

Cannot compile pixel shader code:
0:1 S0052: Uniform variable with initializer

Traceback

[C]: in function 'newShader'
shadows/Shaders.lua:41 in main chunk
shadows/init.lua:9 in main chunk
etcetera

Any ideas on fixing it?

Long overdue edit: These sorts of errors are caused by trying to run OpenGL code not written to also run fine in GLES that the mobile love versions use.
Sorry Im new, How did you fix this?

User avatar
Tricky
Citizen
Posts: 71
Joined: Thu Dec 18, 2014 4:07 pm
Location: Breda, the Netherlands
Contact:

Re: Shädows (A light engine)

Post by Tricky » Thu Jan 04, 2018 7:27 pm

Wow.... that is a nice effect you created there....
I am officially surprised as I never imagined with a scripted based programming tool you could do that ;)

KyleFlores1014
Citizen
Posts: 72
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 » Fri Jan 05, 2018 8:45 am

error.png
error.png (145.33 KiB) Viewed 946 times
this is the error Im getting. Nevermind my other reply.

User avatar
zorg
Party member
Posts: 2325
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Shädows (A light engine)

Post by zorg » Fri Jan 05, 2018 11:26 am

I believe that's this line:

Code: Select all

vec2 SizeFactor = vec2(Quality / Size);
where Quality is defined to be 1.0, and Size is an extern vec2.

As was said elsewhere, and maybe here as well, Handheld GL ES is stricter than Desktop GL, so things that get accepted on desktops bc of leniency might error on handhelds.

That said, the 1.0 should have been a float, not an int, maybe do

Code: Select all

const float Quality = 1.0
instead of #defining it.

(IANAgraphicsprogrammer so with a hint of salt, please :3)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Starkkz
Prole
Posts: 18
Joined: Thu Jul 16, 2015 7:24 pm

Re: Shädows (A light engine)

Post by Starkkz » Sun Jan 07, 2018 12:12 pm

I updated the shaders on the repository, could you try them and tell me if they work for you?

KyleFlores1014
Citizen
Posts: 72
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 » Wed Jan 10, 2018 12:51 pm

Starkkz wrote:
Sun Jan 07, 2018 12:12 pm
I updated the shaders on the repository, could you try them and tell me if they work for you?
It now works; But I have a slight problem
Screenshot_20180109-195808.png
Screenshot_20180109-195808.png (453.36 KiB) Viewed 837 times
theres that flat color which isnt on pc. Ive tried using open GLES in pc, it doesnt do it on pc. Only on my phone.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests