# Questions tagged [lighting]

The tag has no usage guidance.

166 questions
Filter by
Sorted by
Tagged with
210 views

### Pseudo rounded cube in OpenGL

If I have a cube in OpenGL, how can I have it appear like rounded? I think it's too complicated to really have the cube rounded so is there any "light trick" to have something like this: The cubes ...
• 269
88 views

I am trying to simulate the actual response of a camera given some object that is reflecting light. I've written a ray tracer, and have a BRDF that I need to use, and I have a camera sensitivity in ...
61 views

### Clarification about Phong lighting model

I've read some tutorials about Phong and Blinn lighting models and tried to implement a rendered myself. To my knowledge, the basic approach consists of the following steps: calculate the vector from ...
1 vote
339 views

### Tone Mapping in a physically based rendering ray tracer

I'm implementing a pbr ray tracer. Let's say that I'm at the end of the process: for each pixel pi, I accumulated the radiance value in vector pi = (radR, radG, radB). At this point, these values are ...
• 113
205 views

### Pre-filtered environment map, deriving the equation

I'm reading through this article, and more specifically I'm trying to derive the equation that would explain the implementation the following shader (still in the same article): ...
• 464
33 views

### gradual transition of light intensity formula

Imagine I have an x value that ranges from 1-100. The light source is pointed at x=50. From points 35 to 65 I want intensity to be 1 At the ends (ie 1 and 100), intensity should be 0 What formula ...
• 101
319 views

### How does Next Event Estimation work with transformed lights?

I am relatively new to path tracing, and I am trying to implement next event estimation. I am following the Monte Carlo integral used to compute the direct illumination from an area light: \frac{1}{...
113 views

### how many watts are in the SPD of the color white?

Please help. I'm trying to implement a ray tracer, going by the PBRT book and got stuck on an issue that I fail to find the answer to. My scenes are made from objects and light sources. From that, I ...
• 23
261 views

### Why is cos(𝜃) in the denominator in the reflectance equation and in the numerator in the shading equation?

Background: I'm reading https://learnopengl.com/PBR to learn about PBR. In the theory slide (https://learnopengl.com/PBR/Theory), the author has the reflectant equation as The theta (the angle ...
134 views

### How to simulate a line laser diode?

I'm interested in simulating the way a laser line deforms when it strikes an object and runs along the surface of it. Which concepts would be involved? Is there any 3D modeling software out there that ...
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 ...
• 2,195
1 vote
121 views

### Specular/Diffuse light on an icosahedron opengl

I'm having a problem with my model here. I draw an icosahedron using GLUT, and the radius is set to 0.8. The info of the coordinates are listed below: (X and Z are calculated since our radius is 0.8) ...
635 views

### Iridescence/Thin-film interference integration as a layer

I'm trying to integrate the thin-film interference effect described in the paper "Belcour, L., & Barla, P. (2017). A practical extension to microfacet theory for the modeling of varying ...
• 33
254 views

### Physically Based Shading for Diffuse surfaces

So I am currently in the process of implementing Physically based Shading in my pathtracer using microfacet models and I'm quite stuck at comprehending light interaction with diffuse surfaces. First ...
• 2,195
2k views

### How is lighting done in Rasterization based pipeline?

So I wanted to know how do Game Engines like Unity3D and Unreal do lighting. I'm familiar with Ray-tracing, pathtracing based renderers etc. But not much with rasterization based engines. I do know a ...
• 2,195
918 views

### Why Diffuse Light use max(N · H, 0) instead of just letting it be negative?

In Cg tuts, Diffuse Section Surfaces that face away from the light will produce negative dot-product values, so the max(N · L, 0) in the equation ensures that these surfaces show no diffuse ...
• 227
1 vote
272 views

### Ghosting in volumetric lighting

Does anyone know any method to remove ghosting in volumetric lighting? When light move it leaves trail behind, i would like to remove it. Volumetrics are Bart Wronski style (in frustum) with ...
• 556
329 views

### How does the Modified Phong Lighting Model from the Phong Lighting Model?

How does the Modified Phong lighting model also known as the Blinn-Phong differ from the Phong Lighting Model? How can I distinguish the two?
• 171
872 views

### What are the 3 types of light reflection from surfaces in the Phong Lighting Model?

Can someone please explain what are the 3 types of light reflection from surfaces in the Phong Lighting Model? Maybe possibly using a diagram to help me understand it better?
• 171
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, ...
• 275
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?
407 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-...
• 7,351
471 views

### How to deal with light leaks?

I'm struggling with light leaking through meshes (especially thin ones) due to interpolation between probes located on the opposite sides of those. First approach I took was mapping all static ...
394 views

### How to access several textures from huge amount of textures in a shader?

I'm developing a light probe based GI solution and currently dealing with light leaks due to interpolation between probes located on opposite sides of the walls. I want to tackle the problem by ...
1 vote
85 views

### Non-point lights

Is there a technique for implementing non-point lights (i.e. light that has actual physical dimensions)? I can't think of anything except than making a light source out of multiple point lights, but ...
• 113
1 vote
271 views

### Not understanding the lighting equation for volumetric cloud rendering

I've been looking The Real-time Volumetric Cloudscapes of Horizon-Zero Dawn, but I'm very confused by a few terms. The presentation mentions "The Henyey-Greenstein phase function" on page 54, ...
• 280
1 vote
575 views

### Radiosity normal map light baking

I'm trying to implement radiosity normal maps from the old Valve paper: Half-Life® 2 / Valve Source™ Shading.pdf | valvesoftware.com I've tried generating the light maps using Vray and 3dStudio max, ...
186 views

### Light Falloff through a grid

I'm playing with a grid-based lighting system, where light is transported and accumulated through a grid. I initially tried attenuation based on ...
• 21
703 views

### How to interpolate vertex normals for Phong lighting when barycentric coordinates are negative?

I'm interpolating normals for Phong lighting models. Since I am calculating in the light of each pixel, I'm doing the interpolating after the viewport transform has been applied. So I save a version ...
491 views

• 1,449
441 views

### How does opengl fixed function pipeline determine specular lighting with an orthographic projection

I have a scene set up with an orthographic projection with the near / far set from -5000 to 5000. The model view is centered at 0 in the z-axis. I am rendering a sphere centered at z=0 with lighting,...
• 333
117 views

### Ringlike artifacts produced by rays bouncing off a light source

I recently set up a (very basic) ray-marched path-tracer, and I'm getting strange surface patterns on my area light [link]. I'm using known-valid analytical normals for the light's surface, and the ...
• 427
2k views

### Directional Light ViewSpace Calculation

I am a bit confused in terms of directional light calculation in OpenGL. Generally we care about the direction of the directional light and we use it with the normal and view (toCamera) vector to ...
• 143
52 views

### What program can bake transparent light maps?

So I have this racing game I'm trying to modify that uses lightmaps that fade to transparency for light sources. An example from the game: I've been trying to produce a similar effect but with no ...
446 views

### Roughness Remapping

I have been recently exploring physically-based rendering (PBR), but there is one part that still confuses me. I don't quite get roughness remapping, as described in the PBR section on Learn OpenGL. ...
• 577
2k views

### Path tracing with Next event estimation and area lights auto occlusion

I am working my way through my first path tracer and I am currently designing how to deal with area lights. I have two questions: Each object in my scene can have a Light attached to it, this is how ...
• 35
1 vote
456 views

### How do you implement perspective correct Gouraud shading across a triangle?

What's the algorithm for doing so? I have flat shading working and I have perspective correct texture mapping working. Is the way your raster Gouraud shading much different from the perspective ...
1 vote
62 views

### Lighting ramps compressed to zonal harmonics

Let's say I have a lighting lobe represented as a ndotl ramp texture, how do I compress it into a zonal harmonic?
1k views

### How does UnrealEngine handle depth?

Today I found something really interesting (I've never seen something like that). While debugging the buffers used in lightning, I see that the depth information is stored in what looks like cascades ...
• 110
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. ...
• 248
1 vote
52 views

### Emission maps that interact with a bump map

I am trying to create an effect where a bumpy billboarded texture is illuminated by a emission map that is also billboarded but is logically closer to the camera in 3D space. In this way a blue ...
• 143
2k views

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 ...
• 171
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 ...
• 577
264 views

### Exact Formula for Diffuse Hemisphere Lighting

The OpenGL Programming Guide states the formula for diffuse hemisphere lighting on a surface with normal vector $\vec{n}$ as \$L_o(\vec{n}) = L_i(\uparrow) (1-\frac{1}{2}\sin(\theta)) + L_i(\downarrow)...
• 121
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 ...
• 51
960 views

### How to find Light Direction from a Point on a surface to an Area Light

How can I a find the Light Direction/Ray from a Point on a surface to an Area Light? Is there a universal technique to do this for all types of lights (circle, rectangle, sphere & tube)? Although ...
• 2,413
406 views

### Does smooth lighting work with Gouraud shading on single triangles?

I'm currently working on a project where a 3D model gets computed through an isosurface algorithm. This algorithm outputs single triangles with vertices and normals, but without indices. So therefore ...
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 ...
• 239
1 vote