Lighting

Open-source port of PoP that runs natively on Windows, Linux, etc.

Moderator: English Moderator Team

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3021
Joined: April 9th, 2009, 10:58 pm
Contact:

Lighting

Postby Norbert » April 9th, 2017, 4:31 am

I was thinking it would be cool if lighting would be more modern (example; mirror). I very briefly looked into it for SDL, but it's too complicated. If I'm not mistaken, it would require rendering the entire scene to a texture (*), then pixel manipulation (*,*) to add a black layer of 50% opacity, excluding 200px circles around flames. If each scene only had 1 flame, I could've probably pulled it off by using a large, partially transparent, image. Of course, the 'real' way to do it would be a 2.5D side-scrolling remake in a modern game engine. Then adding the light sources would be relatively easy. Actually, that would be Prince of Persia Classic then, I guess.

David
The Prince of Persia
The Prince of Persia
Posts: 1401
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Various

Postby David » April 9th, 2017, 5:27 pm

Norbert wrote:I was thinking it would be cool if lighting would be more modern (example; mirror).

Here is my attempt on a separate branch: https://github.com/NagyD/SDLPoP/commit/ ... 2e72e9cfd8
I did not use per-pixel manipulation, only an image of a circle, and clever use of blend modes.

BTW, the Genesis version has something similar, but it's only a background: https://www.popot.org/level_editors/ima ... p-0.7b.png

Also, I have seen a few 2D games that do lighting, like SuperTux, or ZZT in dark rooms.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3021
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: Various

Postby Norbert » April 9th, 2017, 5:31 pm

David wrote:
Norbert wrote:I was thinking it would be cool if lighting would be more modern (example; mirror).

Here is my attempt [...]


Very cool! :D

[Edit: Suggestion, maybe if a room has no torches at all, make everything even darker. Or maybe the number of torches could determine how dark the room is? Either way, I really like this. This should totally make it into the main branch (as an option)...]

David
The Prince of Persia
The Prince of Persia
Posts: 1401
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Lighting

Postby David » April 15th, 2017, 9:28 am

Moved posts to a new topic.

David
The Prince of Persia
The Prince of Persia
Posts: 1401
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Lighting

Postby David » April 30th, 2017, 9:26 am


David
The Prince of Persia
The Prince of Persia
Posts: 1401
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Various

Postby David » May 7th, 2017, 9:59 am

Norbert wrote:This should totally make it into the main branch (as an option)...

I merged this into the master branch: https://github.com/NagyD/SDLPoP/commit/562af1f012092969715445d849afc876356aa79c


Return to “SDLPoP”

Who is online

Users browsing this forum: No registered users and 1 guest