4 ms·
>So I figured out that I needed to compute the line integral from the eye to every point on the screen. I learned some calculus in college, so I said to myself
by kevindqc 9y ago
>So I figured out that I needed to compute the line integral from the eye to every point on the screen. I learned some calculus in college, so I said to myself "I should be able to do this." So I figured out the formula for it with some crazy complicated trigonometry. I implemented it, but it was 100 times too slow. Then I realized, "Oh wait, I can do this in the lightmap space”, because the lightmap is a discretization of geometry into bite-sized chunks. I did that with lightmaps, so it was real-time.
What is lightmap space?
- naikrovek 9y agoA layer above the actual geometry of the level. It was too slow to calculate lighting in real-time, so a process executed at design-time in Unreal (at build-time in iD engines) that calculated how lights lit the level geometry and then baked those changes on to the textures that were applied to the geometry. It's like painting the glow of a torch on to the wall once before playtime rather than actually doing it every frame. Lighting doesn't typically change every frame, so it works.
- kevindqc 9y agoOh so he just means using lightmaps. Gotcha
- royjacobs 9y agoNo, I think he means that he was calculating the contribution of the volumetric light per lightmap texel, instead of per screenspace pixel. If he would have "painted it on the lightmap" then the effect would not have changed based on your viewpoint, since it's just baked into the lightmap.