[Tutorial] A real dynamic light system

Discussion and feedback on Construct 2

Post » Sat Mar 05, 2016 7:43 pm

the problem for me with c2 speaking for lighting system is this. someone starts a topic for lighting system. people try to find the best way to make a lighting system with better results when we add normals of the sprites..

spritelamp, sprite dlight, and spriteilluminator's work is the inspiration and the goal here as i understand from the pictures of the topic starter. So people try to find a solution and give the best solution. @LeuNoeleeste will upload a tutorial (20 pages) to make it easier for us how to use the @Joannesalfa alternative.. so everybody who have the skills offer their time to help the rest of the community and i'm grateful for this.

And then @ashley upload a cool tutorial with different light sources with different colors. that is almost ok cause some artifacts are here and there BUT with parallax enabled the whole thing doesnt work the shadows are running faster than lucky Luke i wrote about this yesterday no answer..so the tutorial is ok for something but not helpful for other situations.

Sometimes when i wrote some problems I've got i think that dev's make me a favor to answer. @ashley you said that you dont see a reason why to upload a half hour video full of effects of a game. the reason is that i want normal maps and a better light system, bloom effects and sprite emitters that works actually everywhere without a problem like IN THIS GAME.if i cant do this with c2 i dont mind at least i know that i cant. if i need to make a metroid style game with parallax effect on and put in a level 10-20 lights (including spotlights, pointlights and a sun light ) i need 10 to 20 layers for this and if i put some normals inside the result will be correct? cause in a static game like this example you upload is working (with no normal maps inside) but with parallax on is chaos.

if again you don't understand its simple what im asking for "is there any way to make it easier user friendly and better way to have a better lighting system with normal maps in c2 or c3? cause i see people try to find a way and help when you dont understand.
B
18
S
3
G
1
Posts: 248
Reputation: 2,348

Post » Sat Mar 05, 2016 8:43 pm

Ashleys example and tutorial are nice but "problem" is still here and will remain here because current editor was never build to handle that kind of things.
Besides that it's not a solution to have more than 1 light in the layout but it's more like a someone said earlier a hack to make it work just to prove it can be done.
1 light per 1 layer is idiotic and even more limiting. Forget about bigger layouts with dozens of lights or even having dozens of levels with more than 3 lights on each (well, unless you want to spend half of your life setting and managing it up,..), forget about spawning random objects that emit lights (can't create layers at runtime)...
And there's still a Normal map textures issue - one of the main things in that post - which obviously don't work with more than 1 light source after all this years...
so yeah. C5 maybe.
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Sat Mar 05, 2016 11:29 pm

AnD4D wrote:Anything that'll allow me too use multiple light sources and many shadows without WebGL is all I need.

I don't think that you'll get that without WebGL. Ashley said that in the future, when 98% of devices will run WebGL they plan to drop the Canvas2D renderer because it's holding them back from implementing more advanced rendering features.
B
125
S
33
G
17
Posts: 1,517
Reputation: 20,331

Post » Sat Mar 05, 2016 11:30 pm

Yeah, Ashley's example is too "opinionated" solution, even it fixes issues for someone, not sure it would be another for possibilities.
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Mon Mar 07, 2016 11:48 am

I'm not arguing that my solution was perfect, I just think it shows that you can get quite far already with creative use of the available effects. I know there need to be new features to make this easier, but you are asking for some pretty sophisticated, almost 3D-engine grade lighting effects. Obviously it is great if we can support this but it is a great deal of work, and given our focus is on C3 right now we just can't spend a few months going back to C2 to work out how this kind of stuff can be done. We also have to balance this with the great many other feature requests we get in completely different areas, with people who also think their ideas are totally obvious must-haves, but we obviously can't do them all at once.

PieceMaker wrote:would it not be the best solution if the Shadow Light object produced an opaque layer with the falloff gradient already in place inside the object?

I don't like this kind of solution since it assumes everyone wants that. The current system is more flexible: you can avoid using a sprite and have infinite-range lights, you can use a custom sprite with a stepped/pixellated fade-out for different styles, etc...

AnD4D wrote:Anything that'll allow me too use multiple light sources and many shadows without WebGL is all I need.

This is basically impossible. WebGL is a requirement for advanced rendering effects. canvas2d is very primitive in comparison and already effects like the penumbras with a shadow radius are only supported in WebGL mode. Why is canvas2d support so important to you still? As mentioned, we are likely to drop canvas2d support entirely at some point in the future, particularly because pretty much everything that people asked for in this thread is basically impossible to do in canvas2d, so only supporting WebGL opens the door to more advanced rendering features.
Scirra Founder
B
383
S
224
G
86
Posts: 24,118
Reputation: 190,444

Post » Mon Mar 07, 2016 3:32 pm

@Ashley Can you not add those extra features as only webgl features?
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
78
S
21
G
19
Posts: 1,932
Reputation: 17,316

Post » Mon Mar 07, 2016 5:00 pm

@megatronx - yes, we already have WebGL specific features, but in this case it doesn't make it any quicker to develop and there are still ~10% of users who fall back to canvas2d, so we want to hold off on those features until it's more like 2% on canvas2d.
Scirra Founder
B
383
S
224
G
86
Posts: 24,118
Reputation: 190,444

Post » Mon Mar 07, 2016 5:59 pm

Ashley wrote:
AnD4D wrote:Anything that'll allow me too use multiple light sources and many shadows without WebGL is all I need.

This is basically impossible. WebGL is a requirement for advanced rendering effects. canvas2d is very primitive in comparison and already effects like the penumbras with a shadow radius are only supported in WebGL mode. Why is canvas2d support so important to you still? As mentioned, we are likely to drop canvas2d support entirely at some point in the future, particularly because pretty much everything that people asked for in this thread is basically impossible to do in canvas2d, so only supporting WebGL opens the door to more advanced rendering features.


@Ashley I only consider it important because I work on NWF. Therefore, I am restricted only to canvas2d. For some reason, they can't be bothered to support WebGL, so I'm tethered to using less developed effects. I don't personally care about penumbras too much.

I know in the end it boils down to it being their fault and not yours... but I swear I've seen decent shadows on canvas 2d with multiple light sources before.

I know I've posted this before, but have no idea if it's HTML5 or Javascript.

http://ncase.me/sight-and-light/
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Mon Mar 07, 2016 6:40 pm

AnD4D wrote:I know I've posted this before, but have no idea if it's HTML5 or Javascript.

http://ncase.me/sight-and-light/

That particular solution effectively brute-forces penumbras by having 11 separate lights! That's going to be quite a hammer on performance. The WebGL solution looks better with only a single light.

I know the NWF is an exception, but I'd rather focus on the majority of platforms rather than just the one, even if it's Nintendo...
Scirra Founder
B
383
S
224
G
86
Posts: 24,118
Reputation: 190,444

Post » Mon Mar 07, 2016 7:20 pm

Ashley wrote:
PieceMaker wrote:would it not be the best solution if the Shadow Light object produced an opaque layer with the falloff gradient already in place inside the object?

I don't like this kind of solution since it assumes everyone wants that. The current system is more flexible: you can avoid using a sprite and have infinite-range lights, you can use a custom sprite with a stepped/pixellated fade-out for different styles, etc...


That's why I asked if others find it useful. I don't assume everyone finds it useful, but I know I would benefit greatly from having a falloff with just one object.
But why not make such feature togglable then, if possible? Then everyone can have it their own preferred way. Infinite range, or limited. It's the user's choice.

It isn't creating the falloff that is the problem here, it's the limitations involved when doing the falloff manually.

Doing it the manual way requires one layer per light. And like you explained in your tutorial, each layer requires significant extra computation. It would require to dynamically show and hide layers on demand, as opposed to just creating and destroying Shadow Light objects. And since layers can't be created or destroyed on run time, so I'm stuck with a limited amount of possible amount of light sources.

So my point is more that my suggestion would allow an
• Virtually unlimited amounts of lights on just one single layer.
• You wouldn't need to have the background on top of the shading layer.
• And no need for nested layers, which I assume would take more time and effort to add to Construct 2 than just adding a falloff to the Shadow Light object.

But the reason why having it opaque is helpful is that the Shadow Light objects can then easily be blended (screened/dodged) without the need for limiting and complicated workarounds.
B
3
Posts: 5
Reputation: 185

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests