[solved] scene lighting

Started by js, Mon 25/07/2022 10:58:18

Previous topic - Next topic

js

Hello,

Disclaimer: my experience with AGS is to have completed the tutorial.

I wonder how to light the scene. That is, how to add light effects, and not a « fixed » light drawn on the background.

Of course, that could be done with pixel shaders, but there are no shaders (saw on discord it was planned for AGS 4).

I've browsed the documentation, and i've seen some things that may be interesting:
- changing the tinting of objects, for locals light effects.
- DynamicSprite: copy part or complete background, and displaying it over the background. Then, applying tint changes (blue/yellow tint for outside night/day cycle, or darken the scene when light bulb is off).

Of course, the sprites have to be tinted too (i think it's possible to tint a sprite, but i didn't find any functions for this in help. Should i use dynamic sprites everywhere ?). For a global light, that's easy, but what about when walking in raylights, for example ? I don't think «partial» lighting is possible.

Are the above some ways to explore ? And of course, i'm glad to read other ideas.

Thank you.

Hobo

#1
I've been using a hand drawn light layer with transparency for some of my games, that I then import as a full screen object.
It can be animated if needed and I can use the z-index to move it behind or on top of objects and characters.

js

Ah nice, and it can even be animated with several layers.

Can you give me the name of your game using this, please ?

Rik_Vargard

#3
If you want the player sprite to have a tint in a particular place in the room (ex. because the lighting of a lamp), you can draw a region (edit Room) and then give it a tint for when the players walks on it .

example : region[1].Tint(245, 161, 237, 50, 100);

OR change the color tint in the properties.

Hobo

Quote from: js on Mon 25/07/2022 12:21:08
Can you give me the name of your game using this, please ?
Of the released games Echo in the Clouds (Demo) is using this method for both the light and environment effects:
https://www.adventuregamestudio.co.uk/site/games/game/2259-echo-in-the-clouds-demo-/

js

Quote from: Hobo on Mon 25/07/2022 13:11:17
Of the released games Echo in the Clouds (Demo) is using this method for both the light and environment effects:
https://www.adventuregamestudio.co.uk/site/games/game/2259-echo-in-the-clouds-demo-/

Very nice effects, indeed ! And nice game btw (i was disappointed when i sat down, « to be reasonnable » and then… the end, already !)

Thank you for the hints. I mark the thread as solved but don't hesitate to write more !

SMF spam blocked by CleanTalk