The simulation of light and illumination in games, including its interaction with the environment. A core element of games that can bring out vivacity into otherwise static worlds.
41
votes
4answers
14k 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 ...
16
votes
1answer
758 views
What is the math behind the light effect in krakatoa?
I'd like to know the math behind the light effect in krakatoa (click here for an example).
Light source is traveling with particles, but how is shading done? Is it something simple, like Phong ...
15
votes
3answers
2k views
How can I create a lighting effect like this?
This is the most beautiful 2d lighting I have ever seen, and I'd like to perform lighting like this too. How do I do it?
I don't care about the physics or how the particles are simulated - I only ...
13
votes
1answer
2k views
What does it mean to “bake lights”?
What does it mean to bake lightmap ? I heard this in Unity3d, and again found this LightUp plugin for sketchup that bakes lightmap.
From what I observe, the lightmap baked gives the 3d object a much ...
12
votes
4answers
2k views
How can I implement voxel-based lighting with occlusion in a Minecraft-style game?
I am using C# and XNA. My current algorithm for lighting is a recursive method. However, it is expensive, to the point where one 8x128x8 chunk calculated every 5 seconds.
Are there other lighting ...
11
votes
2answers
3k views
How can I implement lighting in a voxel engine?
I am creating the MC like terrain engine, and I have thought that lighting would make it look a whole lot nicer.The problem is that the blocks are not being lit properly when a block which emits light ...
10
votes
1answer
830 views
How does Trine's lighting look so spectacular?
Is there some kind of "special" lighting in this scene? I notice that the sun seems to "pop".
10
votes
3answers
1k 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 ...
10
votes
3answers
5k views
Trying to understand light on Opengl, how to simulate a realistic sun light?
I don't know if I'm doing something wrong or missing anything but I want to simulate sun light, like in a sunny day.
When the object is facing the directional light, it's well lit and there's no ...
10
votes
1answer
291 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 ...
9
votes
7answers
836 views
Does the linear attenuation component in lighting models have a physical counterpart?
In OpenGL (and other systems) the distance attenuation factor for point lights is something like 1/(c+kd+sd^2), where d is the distance from the light abd c, k and s are constants.
I understand the ...
9
votes
1answer
281 views
How to achieve light that changes color mid-way?
I thought of creating light sources, and some colored windows. Now, the windows are semi-transparent. How could I make it so that when the light (say, pure white) hits the glass and continues through ...
9
votes
3answers
2k views
Lighting in a Minecraftian World
Minecraft is a game that is largely based on a heightmap and uses that heigtmap information to flood the world with light. From my understanding the highest point in the heightmap is the end of the ...
8
votes
4answers
579 views
I need help with 3d shading/lighting
How do you guys handle shading in a 3d game? I have a directional light source that shades one side of a tree made of cubes. The remaining 3 sides all get ambient shading only. So the 3d effect is ...
8
votes
3answers
2k views
Is there a way to use an arbitrary number of lights in a fragment shader?
Is there a way to pass an arbitrary number of light locations (and colors) for the fragment shader, and loop over them in the shader?
If not, then how are multiple lights supposed to be simulated? ...
8
votes
2answers
551 views
Can someone explain radiosity lighting to me?
I already have the basics of ambient occlusion down. I have a raycaster and am capable of shooting rays about a hemisphere uniformly. It seems like those are the basics of what are needed for ...
8
votes
1answer
268 views
What is Ramp Shading or Lighting?
What is ramp shading or lighting and how does it work? Is it different than toon shading or is it the same concept? How is specularity calculated differently for ramp shading versus blinn-phong or ...
8
votes
2answers
511 views
Handle many lights in a scene (with shaders)
I'm curious about how to handle many lights in a scene. Given a very big map in a role playing game, with dungeons (with lights in there) etc. I know about deferred lighting, but that only answers how ...
8
votes
2answers
583 views
Creating smooth lighting transitions using tiles in HTML5/JavaScript game
I am trying to implement a lighting effect in an HTML5/JavaScript game using tile replacement. What I have now is kind of working, but the transitions do not look smooth/natural enough as the light ...
8
votes
1answer
262 views
OpenGL: Light at end of tunnel effect
Anyone knows any implementation of the "light at the end of tunnel" effect? where the outside is entirely bright and gradually becomes more visible?
The reverse could also be true, where the inside ...
8
votes
4answers
1k views
Any good book on lighting in video games?
Lighting plays a fundamental role into videogames. A videogame without a good ilumination is flat and without life. I'm looking for a book that explains how must be iluminated a scene and what factors ...
8
votes
1answer
318 views
Drawing “Stenciled” Sprites and making them glow
Currently, in my game - I'm not using XNA's SpriteBatch to render anything(I am using Farseer Physic's Debug View), and I was wondering how I would render something like this:
only using XNA. My ...
7
votes
1answer
137 views
Shadowmap granularity
I thought that we could re-use the same shadowmap for every light. But I've seen an industry article suggesting that you can't re-use shadowmaps between lights, and have to use separate surfaces.
Do ...
6
votes
2answers
608 views
Rendering collections of light sources
I have a small test environment where small point lights are scattered. Players should able to collect them.
The collectible lights are rendered using a simple billboard technique where two triangles ...
6
votes
3answers
319 views
Why doesn't light continuous on my model?
I created a basic textured cube model with Blender to practice modeling, and then I imported it into Unity. After I put up some lighting it looks pretty ugly. The light is not continuous on a row of ...
6
votes
3answers
514 views
What has changed in the lighting systems of Rage, Battlefield 3 to make them so realistic?
I've played and completed Rage and currently Battlefield 3 (which looks a lot better with less hype). One thing that is immediately apparent is the lighting, or the bump maps - I can't figure out ...
6
votes
1answer
230 views
Is there any difference between storing textures and baked lighting for environment meshes?
I assume that when texturing environments, one or several textures will be used, and the UVs of the environment geometry will likely overlap on these textures, so that e.g. a tiling brick texture can ...
6
votes
2answers
301 views
A big light with shadows
To have better texture2D quality in my 2D game, I had to recreate every textures with 300% of their original size.
But the lights have to bright 3 times more.
For lights, I'm using this : Catalin's ...
6
votes
2answers
584 views
How are dynamic blending shadows like this created?
I would like to know, how dynamic shadows, that 'blend' onto other objects, are created.
6
votes
1answer
424 views
Fast and simple attenuation from a flaming torch
I have a single point light-source which is a flaming torch. I compute the distance from the light accurately.
I am not trying to have a particularly realistic torch effect, but I will be moving the ...
6
votes
1answer
637 views
How many shadow casting lights are in modern games?
I'd like to know how many shadow casting lights are supported in modern games, such as Uncharted 2, Crysis 2, Modern Warfare 2, Halo: Reach, etc. Do they all limit themselves to just a couple of ...
6
votes
3answers
959 views
Common light map practices
My scene consists of individual meshes. At the moment each mesh has its associated light map texture, I was able to implement the light mapping using these many small textures.
1) Of course, I want ...
5
votes
3answers
525 views
For normal mapping, why can we not simply add the tangent normal to the surface normal?
I am looking at implementing bump mapping (which in all implementations I have seen is really normal mapping), and so far all I have read says that to do this, we create a matrix to convert from ...
5
votes
1answer
950 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 ...
5
votes
2answers
628 views
How can I acheive a smooth 2D lighting effect?
I'm making a tile based game in XNA.
So currently my lightning looks like this:
How can I get it to look like this?
Instead of each block having its own tint, it has a smooth overlay.
I'm assuming ...
5
votes
2answers
304 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 ...
5
votes
3answers
2k views
How do I fix this weird lighting problem?
I'm making a small game in Unity, and some models are displaying very ugly shading. The shading usually looks funky along the edges between triangles. I'm pretty new to working in 3D; I bet this is ...
5
votes
1answer
224 views
Detecting Light Intensity Around Characters
Later Edit
Since there seemed to be a bit of confusion: I am asking this for purely didactic reasons, I'm not searching for the most efficient solution. Reformulated question: I'm working under ...
5
votes
1answer
269 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 ...
4
votes
1answer
787 views
How does Minecraft render its sunset and sky?
In Minecraft, the sunset looks really beautiful and I've always wanted to know how they do it.
Do they use several skyboxes rendered over eachother? That is, one for the sky (which can turn dark and ...
4
votes
1answer
102 views
Gamma-Correct rendering without floating-point rendertargets
When using a gamma-correct pipeline, you have to work with floating-point rendertargets. Otherwise, you will get severe banding due to the insufficient precision of the usual 8-bit-per-channel integer ...
4
votes
2answers
2k views
2D XNA Tile Based Lighting. Ideas and Methods
I am currently working on developing a 2D tile based game, similar to the game 'Terraria'. We have the base tile and chunk engine working and are now looking to implement lighting. Instead of the tile ...
4
votes
2answers
307 views
Lights shining through walls
I'm currently having a problem with lights in Unity. They shine through walls for some reason.
Point, directional, etc. If a light is next to a wall on one side, you can see it on the floor on the ...
4
votes
1answer
910 views
opengl lighting with textures
I'm using OpenTK and working in C#, if that matters. I'm trying to get lighting effects on a textured object. I'm using obj and mtl files to define them. No matter what I try my object is either ...
4
votes
1answer
232 views
How do I autogenerate gradient lighting?
I am trying to think of a way to generate a gradient like this picture:
Something like this GetGradientTexture(360f,100(width),100(height)), or if i want a directional light (like a flashlight) ...
4
votes
2answers
638 views
XNA 4.0 - Normal mapping shader - strange texture artifacts
I recently started using custom shader. Shader can do diffuse and specular lighting and normal mapping. But normal mapping is causing really ugly artifacts (some sort of pixeling noise) for textures ...
4
votes
2answers
2k 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 ...
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 ...
4
votes
2answers
648 views
How can I implement shader lookups for my material system?
I have been working on a material system and for the most part everything works just fine, however, I hard code the shader that will be used. Obviously this causes a problem when I want to have the ...
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 ...


