## Shädows (A light engine)

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

### Re: Shädows (A light engine)

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

Error

0:1 S0052: Uniform variable with initializer

Traceback

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)

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)

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)

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)

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

Error

0:1 S0052: Uniform variable with initializer

Traceback

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?

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

### Re: Shädows (A light engine)

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)

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

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

### Re: Shädows (A light engine)

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

(IANAgraphicsprogrammer so with a hint of salt, please )
Me and my stuff True 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)

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)

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 (453.36 KiB) Viewed 3022 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.

### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests