Questions tagged [lighting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
23 votes
2 answers
10k views

How is a light probe different than an environmental cube map?

Looking at a light probe texture, it looks like a blurry environment map. What's the difference between the two, how is a light probe made, and what is the benefit of it being blurry?
user avatar
  • 7,351
18 votes
2 answers
15k views

Why are normal maps blue and purple in color?

I am learning about normal mapping. I understood that RGB values are converted into XYZ, but my question is how is it converted and why is the normal map blue and purple in color?
user avatar
17 votes
3 answers
11k views

What are Spherical Harmonics & Light Probes?

What are Spherical Harmonics & Light Probes? How useful are they in computer graphics? What exactly do they do? I've heard the word spherical harmonics & Light Probes everywhere, from siggraph ...
user avatar
  • 2,423
14 votes
2 answers
12k views

How to Calculate Surface Normals for Generated Geometry

I have a class that generates a 3D shape based on inputs from the calling code. The inputs are things like length, depth, arc, etc. My code generates the geometry perfectly, however I am running into ...
user avatar
14 votes
2 answers
2k views

How to build a decent lens/camera objective model for path tracing?

I have written a small path-tracer after learning and experimenting on smallpt. The only thing that I did not write (and understood) myself is how the initial rays are computed and fired from the ...
user avatar
13 votes
4 answers
5k views

For shader math, why should linear RGB keep the gamut of sRGB?

sRGB is often contrasted with "linear RGB." Images are stored on disk and passed to displays in sRGB, which is approximately perceptually uniform in intensity. Shader math is done in linear RGB, ...
user avatar
  • 275
11 votes
2 answers
8k views

What is ambient lighting?

Wikipedia says: An ambient light source represents a fixed-intensity and fixed-color light source that affects all objects in the scene equally. By saying "affects all objects equally" they mean ...
user avatar
  • 587
11 votes
2 answers
2k views

How is screen space ambient occlusion implemented?

I do not understand the explanation from wikipedia. For every pixel on the screen, the pixel shader samples the depth values around the current pixel and tries to compute the amount of occlusion ...
user avatar
  • 587
10 votes
2 answers
3k views

Rendering equation - why unsolvable directly?

Why is the rendering equation, introduced by Kajiya in 1986, not solvable directly/analytically?
user avatar
10 votes
1 answer
2k views

Efficient rendering with many light sources

To render a scene with a single light source using phong shading, one can calculate the final color of each fragment passed into the fragment shader based on the ambient/diffuse/specular components of ...
user avatar
  • 403
9 votes
1 answer
3k views

OpenGL specular shading - Gradient banding issues

I use Phong shading as my lighting model. Nevertheless, the specular shading produces gradients in the light cone: Hopefully you can see the gradient starting from the lower left corner expanding ...
user avatar
  • 591
9 votes
1 answer
687 views

Tweaking a glow shader to make it look better

I have a simple game and and subjects of it are these little lines. It is targeted for iOS and android so it has a HUGE range of processors that it could run on, right now. I am trying to add ...
user avatar
  • 1,365
9 votes
1 answer
2k views

What is "Object Space Lighting"?

Looking at Star Swarm, a demo for the Nitrous engine, I found this little line: "Nitrous uses Object Space Lighting, the same techniques used in film, including real-time film-quality motion blur." I ...
user avatar
9 votes
2 answers
1k views

How is spectral rendering handled?

Is all spectral rendering handled as simulation? Are there technique more tailored to 'consumer' rendering, such as for real-time or even just 'realistic looking without solving full physical ...
user avatar
8 votes
3 answers
651 views

Ambient Lighting

On the Wikipedia page for the Phong model, it says that the ambient term is a constant, and just gets added on to the other terms. But on other pages like LearnOpenGL it says you should take the ...
user avatar
7 votes
2 answers
149 views

How do shaped lights work?

I know how to program directional lights, point lights and spot lights. Sometimes though, people have lights that are shaped - like bars, or even a torus. How does that work from either a ray based ...
user avatar
  • 7,351
7 votes
1 answer
1k views

What is a vertex normal used for?

I'm new to the graphics area, and when it comes to the light part, the concept of vertex normals confuses me a lot. First, I cannot imagine how a vertex could have a normal, and second, when ...
user avatar
7 votes
2 answers
3k views

Physically Based Area Lights

So after reading https://www.guerrilla-games.com/read/killzone-shadow-fall-creating-art-tools-for-a-new-generation (a guerilla games presentation on PBR) I noticed the Area lights as opposed to the ...
user avatar
  • 2,423
7 votes
1 answer
4k views

Does PBR incur a performance penalty by design?

I am wondering if the various PBR models used in modern game engines for real time are heavier in terms of computation, that more classic approaches to rendering. Worded differently, is PBR just a ...
user avatar
7 votes
1 answer
1k views

Confused about prefiltering environment maps (Manson 16)

I'm working my way through this paper about GGX-filtering environment maps: http://www.ppsloan.org/publications/ggx_filtering.pdf I find myself stuck on the basics. In particular, I am confused by ...
user avatar
7 votes
2 answers
3k views

Better Shadow Mapping Techniques

Currently I have basic shadow mapping setup in my engine. I am currently trying to implement something more realistic like PCSS (percentage closer soft shadows), to get a more physically accurate ...
user avatar
  • 2,423
7 votes
1 answer
1k views

Path Tracing With Multiple Lights

I've got my path tracer working great for a single light, but I'm having trouble coming up with a solution for scenes with multiple lights. My first thought was to just send a ray to each light and ...
user avatar
7 votes
1 answer
594 views

Legendre Polynomial equation in Spherical Harmonics

I recently started to read about spherical harmonics. I have a question about this spherical harmonics basis function equation which is mentioned in this StupidSH article: What are those lm() and Re()...
user avatar
7 votes
1 answer
2k views

Constant screen-space-width rim shading

As of lately I've been studying a bit of shaders (in Unity), and am trying to recreate the "light-based inline" that can be observed in the latest Legend of Zelda. But maybe the task is a bit above my ...
user avatar
  • 171
7 votes
1 answer
3k views

What is Radiosity?

After reading a wikipedia article about Global Illumination It mentions a variety of techniques like Ray Tracing, Path Tracing and Ambient Occlusion. One technique it mentions is Radiosity which I don'...
user avatar
  • 2,423
7 votes
2 answers
1k views

Multiple Lights Shading - One Pass vs Multiple Passes

I was looking into ways to implement multiple lights shading and I've noticed Unity uses multiple passes to achieve it. It performs a base pass to apply the brightest directional pixel light + 4 ...
user avatar
  • 1,156
6 votes
2 answers
408 views

PBR missing rim darkening on non metallic rough surfaces

If you have a dielectric (non metallic) sphere with a large roughness value (say, 0.95), and put it in a lighting environment that has a constant onmidirectional lighting value (such as 0.5) Cook-...
user avatar
  • 7,351
6 votes
1 answer
137 views

Amount of light reaching the sensor of pinhole camera model

Consider hypothetical camera with pinhole (in mathematical sense) lens and is sensor, like in below image. Is it the case that the central region of the sensor will receive more light (pixels will be ...
user avatar
  • 203
6 votes
1 answer
603 views

What is the basis of rendering light caustics?

I am not looking for textbooks and related how-tos, though I'm sure they can color the answer. I'd like to understand how we handle the rendering of caustic effects — and particularly time-saving ...
user avatar
6 votes
2 answers
3k views

How to calculate attenuation and radiance in PBR? (point and directional lights)

I would like implement physically based rendering, following this tutorial I was able to find a list of light sources ordered by lumens, but I have no idea how to use it in the calculations. ...
user avatar
  • 248
6 votes
1 answer
588 views

How Sunlight is added in Bidirectional Path tracing?

How is distant directional light source(like sun) added in BDPT? If this is an indoor scene that gets sunlight through windows, how is this handled in BDPT(other than to consider Sun as a big disc far ...
user avatar
  • 698
6 votes
0 answers
136 views

Injecting Virtual point lights into 3D Grid

I am currently trying to implement light propagation volumes in DirectX 11 and I have already done the RSM part which contains position, normal, depth and flux map generation. But for Injecting ...
user avatar
5 votes
3 answers
2k views

Formula for the ambient light intensity of a scene?

I understand that ambient light is light that occurs a result of light from a given source refecting off an infinite number of points in a scene, thereby illuminating all objects in the scene ...
user avatar
5 votes
2 answers
4k views

Refraction in a Ray Tracer: What do with an intersection within the medium?

I am currently following a tutorial at Scratchapixel.com on refraction Here is the refract function: ...
user avatar
  • 2,423
5 votes
1 answer
440 views

Why is spherical harmonics used in low frequency graphics data instead of a spherical Fourier transform?

I'm curious why spherical harmonics are commonly used in real time graphics instead of a spherical Fourier transform. I get that spherical harmonics are in a sort of frequency space (like FT is) so ...
user avatar
  • 7,351
5 votes
1 answer
2k views

Modern way of light sources in OpenGL?

In older versions of OpenGL there were things like: glLight(...) gl_LightSourceParameters The modern way of doing lighting is passing light source parameters manually to the shader in vao-s? Or ...
user avatar
  • 303
5 votes
2 answers
224 views

What is missing in this image that stops it from looking like a photograph?

Look at this image: This is CG, Saya, a project meant to make as real CG as possible to the point of becoming indistinguishable from reality. I would say that it is pretty believable. But, it still ...
user avatar
5 votes
1 answer
2k views

Bloom in DirectX

How can I make an object give the effect that it is giving out light when it isn't? I basically want to make an object glow, for example Neon Lights. Also Area Lights in my engine work properly but to ...
user avatar
  • 2,423
5 votes
1 answer
2k views

Alternatives to Ambient Occlusion

Recently I wanted to improve the lighting in my game engine, naturally I looked towards Ambient Occlusion. I was considering SSAO but are there any better techniques? Maybe some that are Physically ...
user avatar
  • 2,423
5 votes
2 answers
2k views

What is the difference between shading and shadowing?

Shading and shadowing are often mentioned in how to create realistic 3D graphics, but the distinction is not clear. Are both responsible for the generation of shadows, or do they refer to the same ...
user avatar
  • 181
5 votes
1 answer
268 views

Unlit objects in deferred rendering

What is the best way to draw unlit objects with deferred? Like skybox, particles or just glowing objects? I thought about mask in alpha channel, check it in light pass and just set diffuse color but ...
user avatar
  • 556
5 votes
2 answers
266 views

Special directional light type

I am currently trying to implement a specific directional light type. This light type has been used in the game INSIDE and is called orthogonal spotlight (aka local directional light). I assume that ...
user avatar
  • 1,169
5 votes
2 answers
267 views

Radiance at a nearly perpendicular angle is almost infinite?

As far as I understand, radiance is a measure of the "intensity" of light in a direction defined as a differential cone . It's measure is Flux per solid angle per projected area. $L = \frac{d\Phi}{d\...
user avatar
5 votes
1 answer
112 views

Where are the highlight definitions inside of my shader?

I have a pretty good glow shader going now thanks to some tips from people here. However there are a few things that bother me that could maybe be better. #1 Definition of the particles A lot of ...
user avatar
  • 1,365
5 votes
1 answer
961 views

How to compensate low amount of rays reaching the light in a Path Tracer

I am trying to implement for research purposes a path tracer, but so far but results are not so good and I will explain you why. The general idea before getting to the code: I am working on paths ...
user avatar
  • 325
5 votes
1 answer
202 views

Error with tube lighting

I have recently been working on area lights for a small open source game engine called Urho3D but have run into an issues when rendering tube lights where the lights look the same as sphere lights ...
user avatar
5 votes
0 answers
182 views

How to use Photometric Units with Rendering Equation?

So I was just reading up on how to create more Physically Based Lights and wandered into the realm of photometry. I read the paper "Moving FrostBite to PBR" and in it the author claims he decided to ...
user avatar
5 votes
0 answers
248 views

Dual paraboloid shadow texture edge seams

I implemented dual paraboloid shadows for point lights. The goal was to reduce the number of shadow passes. Also the target is GLES3.0 so no layered rendering is available. The shadows work, and ...
user avatar
5 votes
0 answers
1k views

Percentage-closer Soft Shadows implementation

I am trying to implement the Percentage-closer Soft Shadows (PCSS) from NVidia inside Unity but I am facing some issue and I don't know where they come from and then, I do not know how to solve them......
user avatar
  • 1,169
4 votes
2 answers
727 views

Path tracer not rendering shadows

I am trying to implement for research purposes a gradient-domain path tracer. In order to achieve this step I first need a working Path tracer. I have been creating one so far but results are wrong ...
user avatar
  • 325