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.

learn more… | top users | synonyms

5
votes
2answers
548 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
2answers
835 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 ...
5
votes
2answers
472 views

Changing Ogre3D terrain lighting in real time

I'm looking at the Ogre 3D library and I'm browsing through some examples / tutorials. My question is about terrain. There are a few examples showing how great the terrain system is, but I think that ...
5
votes
2answers
5k 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 ...
5
votes
1answer
722 views

Lightmapped prefabs for procedural content

I'm doing a game with procedural content from handmade prefabs, but I ran into a problem as Unity bakes the scene instead of objects when lightmapping with Beast. So when the prefabs are instanced ...
5
votes
1answer
401 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
3answers
1k views

How can I change this isometric engine to make it so that you could distinguish between blocks that are on different planes?

I have been working on an isometric minecraft-esque game engine for a strategy game I plan on making. As you can see, it really needs some sort of shading. It is difficult to distinguish between ...
4
votes
1answer
1k 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
2answers
1k views

What is the difference between ambient lighting and skylight?

What is the difference between ambient and skylight lighting? Please give me a detailed description of the differences.
4
votes
1answer
287 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
1answer
1k views

OpenGL lighting with dynamic geometry

I'm currently thinking hard about how to implement lighting in my game. The geometry is quite dynamic (fixed 3D grid with custom geometry in each cell) and needs some light to get more depth and in ...
4
votes
2answers
1k views

Lighting Objects with Textures - OpenGL

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 invisible, unlit (plain texture), or completely white. ...
4
votes
1answer
78 views

Lighting computation viewing direction

This is something that's really cooking my noodle. When I'm computing the light response for a material in my fragment shader, I'm using the standard 3 normalized vectors, in eye space: fragment ...
4
votes
2answers
1k 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
3answers
3k views

2D XNA Tile Based Lighting. Ideas and Methods [closed]

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
1answer
121 views

Using sky for indirect lighting - should I remove the sun?

I'm attempting to achieve slightly more realistic ambient lighting in outdoor scenes using the sky cubemap. When rendering an object, I first calculate the direct lighting contribution using ...
4
votes
1answer
261 views

How can I handle the combination of multiple shader effects?

To be able to work efficiently with effects, is there a good way to combine multiple reusable "base" effects to achieve a more complex final result? For example, say I have an effect that handles ...
4
votes
2answers
1k 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
1answer
1k 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 ...
4
votes
1answer
1k 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 ...
4
votes
1answer
181 views

How does pixel shading work for ambient occlusion volumes?

I'm trying to understand the ambient occlusion technique described here, but I've trouble comprehending what exactly is the pixel shader doing. Is the pixel shader invoked on points that belong to ...
4
votes
1answer
294 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
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 ...
4
votes
2answers
776 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 ...
4
votes
1answer
163 views

How to calculate directional light frustum from camera frustum

I'm playing around with OpenGL for a few weeks now. For the following screenshot I picked the glm::ortho values for my lightsource by trial and error. There are two directional light sources with ...
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 ...
3
votes
1answer
379 views

What is deferred lighting?

There is plenty of information on what deferred rendering is but there is a lack when it comes to deferred lighting and the information that there is there is not clear. My question is simple, what ...
3
votes
1answer
840 views

Converting time of day into a smooth day/night variable?

I'm trying to make a smooth day/night cycle for a game project that I've been working on. I've already set up a clock that adds deltaTime to seconds, wraps seconds to gameMinutes, etc. The issue that ...
3
votes
3answers
717 views

Time of Day Lighting / Day Cycle

I'm trying to implement a simple "lighting" system that alters a value of light between 0.0-1.0, 1.0 is midday 0.0 is total blackness. Are there any "good" information regarding this particular ...
3
votes
2answers
3k views

My Ambient lighting is not working correctly

I'm having a problem when using ambient lights in my opengl game. When I first started with my program, i had a positioned light, and the code was this: GLfloat AmbientColor[] = ...
3
votes
5answers
3k views

Why do my point lights disappear when another nearby light is above 1.85 range?

I'm making a game with a dungeon setting in Unity 3D. Many torches line the walls. I'm using a point light over each torch to simulate the flame. However, when two torches are across from each other, ...
3
votes
1answer
669 views

Blender Object Appearing Gray when all Lights are Off

I have an issue with Blender where, when I turn my only light off (a sun lamp) and render the image my object appears gray rather than black (and thus, not appear to the camera). I can't figure out ...
3
votes
1answer
2k views

Can't get LWJGL lighting to work

I'm trying to enable lighting in lwjgl according to the method described by NeHe and this post. However, no matter what I try, all faces of my shapes always receive the same amount of light, or, in ...
3
votes
1answer
109 views

Handling multiple lights of different types in GLSL

I want to be able to support multiple lights of different types (point, spot & directional). Note that I also want to be able to render transparent/translucent objects, which rules out deferred ...
3
votes
1answer
147 views

Understanding and editing HDR light environments in Photoshop

I'm working with an in-development system that uses .hdr environments (equirectangular projection) to provide image-based lighting (IBL) to a 3D rendering. I'm trying to understand what range of ...
3
votes
1answer
230 views

Can't get normals to work correctly with lighting in OpenGL [closed]

I'm trying to light up a simple 2d triangle with my cursor as a diffuse light source but can't seem to set the normal correctly for the lighting to look right. The function that calculates the normal ...
3
votes
1answer
373 views

forward rendering and multiple shadow maps

I have two light sources on my scene. I created two fbo's which store depth textures for these lights. A render loop looks like this: bind fbo1 save depth values for first light unbind fbo1 bind ...
3
votes
1answer
438 views

How to calculate FOV with four-walled tiles?

I'm working on a 2D tile-based game. I'm trying to calculate FOV and I've implemented walls so they don't take up an entire tile. Instead, they just take up a side of each tile. Similar to: class ...
3
votes
1answer
2k views

Loading textures in OpenGL makes everything look darker

I don't know what I'm doing wrong but I'm having a big a problem with GL_TEXTURE_MIN_FILTER when loading textures for my scene. I'm doing a skybox, but that's irrelevant because the problem exists ...
3
votes
2answers
144 views

Render with multiple lights (one pass per light)

I have already a system that at the moment handle multiple lights just passing an array of light struct and loop through it. I had been told to switch to a multipass rendering approach. How should I ...
3
votes
1answer
144 views

Creating a black light (ultraviolet) shader?

I am interested in the algorithm for color picking that would ideally allow to choose what color range will be highlighted and what color range will be faded. I can sort-of understand how to make it ...
3
votes
1answer
424 views

Adding lighting pygame

I have created a day and nigh cycle in a game of mine by drawing a rectangle over the screen and having it's alpha change constantly. However, I obviously want to add some lighting to the game. Is ...
3
votes
1answer
307 views

Dynamic “Light Level” System based on alpha levels

My team and I have been working on a game in Java using the Slick2D engine and there are a few things I have questions on. As of right now, the code that I've written basically takes a cosine function ...
3
votes
1answer
1k views

Cook Torrance model implementation : black specular light

I am trying to implement the Cook-Torrance model, and this is how I calculate the parameter Rs: float Rs(float m,float F,vec3 N, vec3 L,vec3 V, vec3 H) { float result; float NdotV= ...
3
votes
1answer
624 views

GLSL per pixel lighting with custom light type

Ok, I am having a big problem here. I just got into GLSL yesterday, so the code will be terrible, I'm sure. Basically, I am attempting to make a light that can be passed into the fragment shader (for ...
3
votes
1answer
211 views

Best way to blend colors in tile lighting? (XNA)

I have made a color, decent, recursive, fast tile lighting system in my game. It does everything I need except one thing: different colors are not blended at all: Here is my color blend code: ...
3
votes
1answer
96 views

independent lighting per mesh in blender

In Blender, is it possible to assign lighting objects/effects exclusively to a single mesh? For instance, if I place two meshes next to each other, and two lights (one shining on each mesh), I would ...
3
votes
1answer
531 views

Multiple volumetric lights

I recently read this GPU GEMS 3 article Volumetric Light Scattering as a Post-Process. I like the idea to add volumetric light property to realtime render i'm working on. Question is will it work for ...
3
votes
1answer
595 views

How to create a simple “spot light” effect with Sdl or Sdl.Net?

i'm wondering: how to create a simple "car headlight" (for i.e) or a torch spotlight in Sdl or Sdl.NET ? Does anyone know how ? Thanks