1
vote
2answers
113 views

Technique for multiple shadow casting lights in 2D

I'm trying to create shadows in a 2D game in such a way that I can have an arbitrary number of lights in a scene, all of which can cast shadows. To do this I think I have to generate a mesh for each ...
2
votes
1answer
124 views

2D lighting causes black rings to appear

A year ago I implemented 2d lighting in XNA using sprites. The sprites I used were created by placing a soft white photoshop brush on a transparant background. The result was this: (lights only) ...
1
vote
1answer
205 views

Lighting Covering Up Sky ( XNA / C# )

I have a 2D tile-based lighting system which is drawn onto a Render Target. I am also drawing a background which involves mountains, sun/moon, and clouds. There is also the unlit game; blocks, ...
4
votes
1answer
813 views

Faking 2d light using shader (Unity, Shaderlab)

Since the concept was difficult to explain in words for someone who's not quite familiar with shader, I described it in pictures. I'm currently using Unity and it seems Shaderlab is the best choice ...
1
vote
1answer
254 views

Grid-Based 2D Lighting Problems

I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least. I need a lighting engine for my ...
6
votes
3answers
2k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
4
votes
1answer
861 views

2D Software Lighting Issues in Java

I'm creating a 2D top-down tiled game in pure Java and by now I'm trying to implement a way to do lighting. First, some details on how I render: there is a screen class which handles all the ...
11
votes
1answer
460 views

How do I create multiple 2D spotlights?

I'm looking to create a 2D "spotlight" effect that allows a spotlight on multiple entities. I.e., as if several sprites were holding torches. For a single entity (one spotlight), I use a technique ...
5
votes
1answer
337 views

Performance of pixel shaders vs. SpriteBatch: XNA

Precondition: I read this question/answer about using shaders, or spritebatch, to render and mark a sprite. I need to do something like that. I also have a 2D lighting PoC which I need to write. The ...
2
votes
2answers
411 views

How to create realistic 2d lighting using colour temperature

I'm looking for a lighting algorithm that produces realistic lights expressed in kelvins, from about 2500k to 6500k. What I'm confused about is how to make the lights properly interact with the colors ...
4
votes
2answers
678 views

2D lighting theory: day-and-night cycle, spot lights at night

I am writing a rogue-like 'zombie' management game. The game map will be similar to Prison Architect. A top-down 50 X 50 grid. I want to implemented a day night cycle and during the night I would ...
4
votes
2answers
1k views

OpenGL Lighting [duplicate]

I have a simple day and night cycle by at day disabling OpenGL lighting and at night enabling openGL Lighting. When I enable everything appears darker. My question is How would I make it that at a ...
0
votes
1answer
191 views

Drawing at negative coordinates in XNA?

I am trying to make a 2D isometric RPG and I kind of hit a wall when it comes to lighting. I was thinking of using shaders, if I manage to understand them.The problem I am anticipating is the presence ...
1
vote
2answers
351 views

Techniques for lighting a texture (no shadows)

I'm trying to learn about dynamic shadows for 2D graphics. While I understand the basic ideas behind determining what areas should be lit and which should be in shadow, I don't know how I would ...
1
vote
0answers
315 views

Dynamic 2D soft shadows with concave polygons?

I've implemented dynamic 2D soft shadows from this article on gamedev.net. It uses an image for the penubmra and is fast, physically accurate and looks good in most situations, so I really like the ...
5
votes
2answers
4k views

Normal Mapping for 3D-Like Lighting in 2D Games

I recently saw this video about a game engine that uses normal mapping to generate lighting and shadows for amazing, 3d-like lighting effects. (Like the three barrels below on the right side, they ...
2
votes
1answer
757 views

Light mask map and camera for static lights in XNA Platformer

Using the example for some basic light maps found here : http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html, I've managed to create a lightmap texture using individual lightmaps and display ...
5
votes
1answer
1k views

Fast pixelshader 2D raytracing

I'd like to do a simple 2D shadow calculation algorithm by rendering my environment into a texture, and then use raytracing to determine what pixels of the texture are not visible to the point light ...
4
votes
2answers
1k views

Grid/cell based light system

I am working on a top-down, 2d cell-based RPG game. I would like to implement a cell based lighting system, something like this and this. I basically have several light sources and light deteriorates ...
10
votes
3answers
3k views

Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?

I am thinking of writing myself a simple 2D game. It will not shine with perfect graphics or gameplay at first, but I'd consider it my first step in PC game development. So, imagine such simple ...
1
vote
1answer
285 views

How do I make light objects in XNA?

Here's my dilemma : I want to have light sources placeable by the player, in terms of lanterns. I know the best way to do this is to use pixel shaders, which I have done a lot of research and use ...
6
votes
2answers
347 views

How do walls affect lighting?

I have been trying to implement a simple form of lighting in my 2D game. In the screenshot, I don't think it looks very good, kind of just plastered over the top of the map. How would the wall effect ...
1
vote
1answer
541 views

How can I implement “cut outs” for lighting in OpenGL?

So, I'm working with OpenGL (I'm not exactly sure of the version), and I want to do an old-style lighting setup by essentially drawing a black rectangle over the screen, and drawing white circles over ...
4
votes
0answers
209 views

2D Lighing in XNA [duplicate]

Possible Duplicate: How is 2D lighting implemented? I'm attempting to create a 2D game in 3/4th perspective (like Pokemon and the older Zelda games). The time has come for an attempt to ...
4
votes
2answers
1k views

Blending 2d images to subtract alpha

I'm looking into doing a 2d lighting system with a result similar to this: http://forums.tigsource.com/index.php?topic=15619.0 This thread I believe disregards color, as well as doesn't really list a ...
2
votes
2answers
2k views

2D Real-Time shadows on level on a level made from a Dynamic Bitmap

The Bitmap has transparency, and only non-transparent pixels are solid and used for hit detection for the physics engine and gameplay. I have seen some versions done with convex hulls, but for ...
45
votes
4answers
18k views

How is 2D lighting implemented?

I am wondering what the best way to approach a "lighting" effect in 2D games is. For instance, if my main character is glowing, what techniques can I use to complete the visual effect of the character ...