Questions tagged [lighting]

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.

Questions with this tag deal with the positioning and utility of light sources, the different methods of providing light into a scene, and special effects that can be done such as coloration and glow. While much more prominent of an issue in 3D games, there is equal potential for creativity in the realm of 2D games.

721 questions
42
votes
1 answer

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 more realistic feel. Is the purpose of baking…
Kim Jong Woo
  • 671
  • 3
  • 7
  • 11
18
votes
9 answers

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 and c, k and s are constants. I understand the sd^2 component which models the well known…
Ken
  • 6,116
  • 3
  • 35
  • 51
16
votes
3 answers

What is the utility of squared radius and inverse squared radius for lighting computations?

On one of the slides from "DirectX 11 Rendering in Battlefield 3" PowerPoint I noticed the folowing code: struct Light { float3 pos; float sqrRadius; float3 color; float invSqrRadius; } I don't understand why would they store the squared…
cubrman
  • 1,551
  • 1
  • 18
  • 31
6
votes
3 answers

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 which it is - makes the experience on a high end PC a…
Chris S
  • 295
  • 2
  • 8
4
votes
2 answers

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.
Daniel Szalay
  • 265
  • 4
  • 11
1
vote
1 answer

Spot lights - making narrow/broad spot lights give more/less intense light

When I use "normal" spot lights as presented in tutorials such as this (with the exception that I use inverse square fall-off and then gamma correction), the spot light doesn't behave like a real spot light would, because in real life I would…
TravisG
  • 4,402
  • 4
  • 36
  • 59
1
vote
1 answer

Shouldn't fragment lighting have the same effect as vertex lighting with only ambient and diffuse lights?

With infinite light source and only ambient and diffuse lights — no specular light, it seems the rendering results of vertex lighting and fragment lighting should be the same, because all the lighting calculations are linear and it means…
an0
  • 115
  • 6
1
vote
1 answer

Do any games support different lighting effects according to whether a surface is wet or dry?

I've noticed that when driving at night, when the road surface is dry, my headlights appear to illuminate much further than when the road surface is wet. I presume that this is due to the differences in how my headlights is being reflected under wet…
Mark Booth
  • 111
  • 3
1
vote
1 answer

Phong lighting model - R vector

In Phong lighting model a vector R is used to calculate the spectral component of light. The equation used to obtain it is R = 2(N•L)N - L I can't understand why we use this equation. Could someone give me a demonstration of how we obtain this…
Fabrizio Duroni
  • 277
  • 2
  • 14
0
votes
0 answers

Problem with pointlight used as "cubic" light

I'm now applying my recent work to some "real" game level and find an issue with the lighting. In this level I'm using a light source which should be like a "cube" (see picture). I'm currently using a point light for this (left image) centered on…
philB
  • 129
  • 8
0
votes
0 answers

What are good ways to model environment radiance (not irradiance)?

I'm trying to compile a list with relevant techniques in game development to model scene radiance. The (probably obvious) candidates I have so far is: Discreet light source objects in the scene (point ligts, directional lights, area lights…
0
votes
1 answer

Multiple directional lights use cases?

I have been building and designing a hobby-tier game engine and I am currently working on supporting any amount of lights of any type. I checked out Unity and it supports multiple directional lights, what would that be useful for? Doesn't one…
0
votes
2 answers

Inverting the Z coordinate of the light vector

I noticed that in some vertex shaders they invert the Z coordinate of the light vector, i.e. // Compute denormalized light vector in world space float3 vLightWS = g_LightPosition.xyz - vPositionWS.xyz; // Need to invert Z for correct…
Pekov
  • 157
  • 6