Anixias
Member
Hi all, I am developing an open-world 2D platformer right now. I'm about to finish getting all of my basic world stuff (solar system simulation to accurately display the sun and moon, moon phases, eclipses, etc.) and am getting into the lighting aspect now.
My dilemma is simple: I want the lighting to not affect the parallax backgrounds or foregrounds, only stuff in the plane the game takes place in. Think of Terraria but instead of block lighting, I'm using surfaces and images of lights.
What is a good way to create a mask of everything the lighting should affect? I thought of redrawing every object with a shader that colors them solid white onto a surface, then multiply the lighting onto that but I am also using tiles in the room editor, which need to be affected by lighting. As far as I'm aware, I can't render the room tiles in code onto a surface without using matrix functions to offset the tilemap to the view coordinates. Does anyone know of a better method?
Thanks, Anixias.
My dilemma is simple: I want the lighting to not affect the parallax backgrounds or foregrounds, only stuff in the plane the game takes place in. Think of Terraria but instead of block lighting, I'm using surfaces and images of lights.
What is a good way to create a mask of everything the lighting should affect? I thought of redrawing every object with a shader that colors them solid white onto a surface, then multiply the lighting onto that but I am also using tiles in the room editor, which need to be affected by lighting. As far as I'm aware, I can't render the room tiles in code onto a surface without using matrix functions to offset the tilemap to the view coordinates. Does anyone know of a better method?
Thanks, Anixias.