Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [request] 2D dynamic or fake lights and shadows.

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 2nd May 2019 21:58 Edited at: 2nd May 2019 22:01
This is one of the features I miss from AppGameKit for a very long time. Community shared solutions are not well optimised especially on mobile or they are very limited or don't even work (?)
Would be nice to have some 2D light objects in Studio that we can add to the game especially with the new scene editor.
For example, we could have a property for sprite objects if they are obstacles for light or not and if they cast shadow or not.
Then we could drag and drop light objects in to the scene, set usual properties like color, radius, strength and they could automatically have an effect on the entire screen and sprites selected to be obstacles and cast shadow that we could see immediately in the scene or at least in preview and change with code properties in real-time so no guessing would be required. We could see immediately how our scene looks like with lights.

I don't know shader code and to be honest I am simply not interested in writing shaders. So would be nice if finally Studio could provide some 2D lights out of the box for us either dynamic or fake by blending sprites and layers..etc that is being maintained for desktop and mobile platforms.

Thanks.
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 3rd May 2019 02:18
+1 For implementing this. It would be a cool addition.
Win 10 Pro - AMD RYZEN 7 Octacore 3.8ghz - 32GB DDR4 - RTX 2070 8GB
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd May 2019 02:25
My understanding it has to be done with a shader and there have been shaders shared that already achieve this

If your planning on releasing for mobile tho its not really practical


fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 3rd May 2019 07:14 Edited at: 3rd May 2019 08:20
@fubarpk Yes there are shaders have been shared by the community on the forum but they don't perform well some of them hit the performance significantly even on my desktop and some don't even compile due to an error in the actual shader code.
Having real-time dynamic lights and shadows indeed not practical in case we want to target low powered devices, this is why would be nice to also have some light weight static/fake solution.

With the new renderer we might also need new shaders that I'm sure the community going to provide but since TGC rewrite the renderer from scratch I think it would be the best time to look in to this and do something about it since most competitors out there do offer some sort of solution for 2D lights out of the box either dynamic or fake or both.
Engines that I know to offer some sort of solution out of the box if not a light object but at least the means to create a fake one through blending sprites and layers (some also offer community made plugins but I don't count that in this list):

Unity
Godot
Construct
001
Fusion 2.5 (Windows only)
GameMaker Studio (require heavy coding in GML but no shader required)
Duality
Monkey2

Some of these even support normal maps out of the box. Sometime it is very unfortunate AppGameKit doesn't offer any solution one that also work on mobile. As you can see, there are plenty engines out there that do offer something out of the box so I think it would be extremely important for Studio to do as well. If not light but at least some way to blend sprites and by that I don't mean setting transparency. In an other topic someone asked similar and people was suggesting to change transparency, that is not blending. Blending means we can subtract part of a sprite from a part of another and also able to set strength of subtraction so portion of sprites can be transparent instead of make it completely invisible. With this we could play around and create lights of our own but currently when you change transparency it is effect the whole sprite. Just a quick note before someone mention changing transparency as a solution.

I would be really happy with something 001 has to offer. A shadow layer effect the entire screen and some light objects that being subtracted from the shadow layer in the given shape, strength and color. We can also change the color and strength of the shadow. It is not that heavy on resources and can provide some nice results. If you need anything better than that yeah must use shaders but not every one can and interested in coding shaders. I can deal with gameplay but no shader unfortunately and would be nice to have something out of the box even that much 001 has to offer would be great.

Thanks.

Login to post a reply

Server time is: 2024-04-19 01:43:17
Your offset time is: 2024-04-19 01:43:17