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.
Shädows (A light engine)
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.
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.
-
- 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.
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.
Re: Shädows (A light engine)
Yep thats what I expected thanks. I'll work on that.
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Re: Shädows (A light engine)
Sorry Im new, How did you fix this?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.
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
I am officially surprised as I never imagined with a scripted based programming tool you could do that
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Re: Shädows (A light engine)
this is the error Im getting. Nevermind my other reply.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Shädows (A light engine)
I believe that's this line:
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 instead of #defining it.
(IANAgraphicsprogrammer so with a hint of salt, please )
Code: Select all
vec2 SizeFactor = vec2(Quality / Size);
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.
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?
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Who is online
Users browsing this forum: No registered users and 2 guests