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 »

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 »

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 »

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 »

Yep thats what I expected :) thanks. I'll work on that.
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 »

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: 75
Joined: Thu Dec 18, 2014 4:07 pm
Location: Breda, the Netherlands
Contact:

Re: Shädows (A light engine)

Post by Tricky »

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: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 »

error.png
error.png (145.33 KiB) Viewed 8254 times
this is the error Im getting. Nevermind my other reply.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Shädows (A light engine)

Post by zorg »

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: 24
Joined: Thu Jul 16, 2015 7:24 pm

Re: Shädows (A light engine)

Post by Starkkz »

I updated the shaders on the repository, could you try them and tell me if they work for you?
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Shädows (A light engine)

Post by KyleFlores1014 »

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 8145 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: Ahrefs [Bot], targetcreature and 55 guests