How should I go about a lighting system?

Luyren

  • *
  • Posts: 1586
The PNG is the resource pack. Import that by going to File > Import Resource.
The light sources as they are right now just clear parts of the tint effect on the screen, they don't add anything. The second image on my post is a way to replace the "clear" with drawing the light source on top of the tint effect, in case you want to try that.
Working.

Fayabella

  • Posts: 92
Alright! I got your behaviours to work (haven't tried the day/night cycle one yet).

Just a question with the tints.
I want black where there isn't lights, and yellowish where there is.

How would this work with your setup?

Also, what was the change you suggested supposed to do? I put it on 'screen' and it just got rid of the lights.

Luyren

  • *
  • Posts: 1586
Alright! I got your behaviours to work (haven't tried the day/night cycle one yet).
Just a question with the tints.
I want black where there isn't lights, and yellowish where there is.
How would this work with your setup?

Also, what was the change you suggested supposed to do? I put it on 'screen' and it just got rid of the lights.
First question:
You can have one tint black at 50 opacity for example and another on yellow at lower opacity (they can be on the same layer, but on different tint indexes), and use a light source that clears the tint index of the black tint.

As for the suggested change: before using this resource pack, you were drawing an image (light source) on top of the darkness layer, right? Since I use clear instead, I provided an example of drawing the mask image on top of the darkness layer, instead of clearing it. It could work for having spotlights of different colors, if the light source image is yellow or red, for example, but I didn't test further than that. This change may also present problems when two ligth sources overlap.
Working.

Fayabella

  • Posts: 92
Oh, cool. The first method makes the darkness slightly yellowish tint, while using Screen with a yellow mask leaves my original darkness colour alone. Thanks!

Now, I can't seem to get the day/night cycle to work. Could you perhaps give me a rundown on how to use it? I have multiple stages of day but none seem to change the tint.

Luyren

  • *
  • Posts: 1586
Attached a working configuration.

So you replaced the clear with the draw as suggested, and got it working? If that's the case, I'll add that option to the resource pack. Thanks for that!
Working.

Fayabella

  • Posts: 92
Glad I could help with the blend mode thing. And thank you for all of your amazing help!

I'm not at my computer right now, so I haven't tried that configuration yet, but I have one last question before I try it:

Should the 'tint screen' behavior have nothing in its list if I want the day cycle to work? Or does the day cycle work based off of existing tints in the list?

Luyren

  • *
  • Posts: 1586
Glad I could help with the blend mode thing. And thank you for all of your amazing help!

I'm not at my computer right now, so I haven't tried that configuration yet, but I have one last question before I try it:

Should the 'tint screen' behavior have nothing in its list if I want the day cycle to work? Or does the day cycle work based off of existing tints in the list?

That's a good question. Originally I only had one tint effect active , so the Day and Night Cycle would overwrite the tint, but now they can work independently. I'll just organize my explanation in order here:
1) No, the day cycle doesn't work based off of the existing configurations in the list.
2) Tint screen and day and night cycle can work independently from each other. If you don't have plans to tint the screen outside of the day and night cycle, all that matters is to leave the attribute Activate unchecked (false) in the Tint Screen page. Then day cycle will handle everything.
3) But suppose you want a scene with an ominous red tint on top of the day cycle tint. That's what the Tint Index thing does. You can configure day cycle to tint on Tint Index 0, and then configure the Tint Screen behavior to tint the screen red at Tint Index 1.
Working.

Fayabella

  • Posts: 92
I tried the day cycle, and it works well! Thank you.

One odd thing I noticed:

Evening,19|Tint Screen,0,0,50,50,Multiply,3,0,1
This doesn't have a 1 second fade time like the others, yet the last number is 1. Might be a bug with your behaviour, might be something wrong on my end.

Either way, you've been a tremendous help. Thank you!

And thanks to the others who helped!

Luyren

  • *
  • Posts: 1586
Evening,19|Tint Screen,0,0,50,50,Multiply,3,0,1
This doesn't have a 1 second fade time like the others, yet the last number is 1. Might be a bug with your behaviour, might be something wrong on my end.
I couldn't find a way to fade in/out a color within the same tint index. You can fade it in and out when its empty. With that said, you could do the following:
1) The first tint screen starts at tint index 0.
2) When transitioning, remove index 0 over 1 second, then tint index 1 with your new color
3) For the next one, do the opposite: remove index 1, tint index 0.

I think this way you can have a smooth transition between each stage.
Working.

Fayabella

  • Posts: 92
Code: [Select]
Dawn,5|Remove Tint,1,2/Tint Screen,30,30,50,60,Multiply,3,0,2
Morning,7|Remove Tint,0,2/Tint Screen,30,30,50,30,Multiply,3,1,2
Daytime,9|Remove Tint,1,2
Dusk,17|Tint Screen,255,90,40,50,Multiply,3,1,2
Evening,19|Remove Tint,1,2/Tint Screen,50,50,100,50,Multiply,3,0,2
Night,20|Remove Tint,0,2/Tint Screen,0,0,0,75,Multiply,3,1,2

This still does the same thing. Am I using the wrong format?

Luyren

  • *
  • Posts: 1586
Attached how to fix this issue, that one is my bad.
Working.

Fayabella

  • Posts: 92
Still seems to do the same thing, even after I fixed that. :/

Luyren

  • *
  • Posts: 1586
Attached a second fix, now tested with your same configuration. This should do it, and thanks for using my code, that helped find these issues way earlier than if I were to do it alone.
Working.

Fayabella

  • Posts: 92
Yep, that did the trick!  Thanks!

Fayabella

  • Posts: 92
And if I wanted to make a light follow the player... is that possible with your light source behaviour?