Jump to content

  • Log In with Google      Sign In   
  • Create Account

Krzysztof Narkowicz

Member Since 13 Aug 2010
Online Last Active Today, 02:35 AM

Posts I've Made

In Topic: Questions on Baked GI Spherical Harmonics

Yesterday, 01:43 PM

There are two usual solutions for leaking. First one is to disable occluded probes at runtime, which may be a bit costly when using 3D textures. Second one is to replace occluded probes with correct ones by blending their unoccluded neighbors during an offline step.

In Topic: Lightmap theory and rendering

29 January 2016 - 02:45 PM

Shameles plug: a few years ago I wrote an article about lightmapping pipeline for a mobile game. It covers computing lighting on GPU, light probes, dynamic shadows, calculating UV charts for lightmapping and packing those UV charts into a single atlas. It's also full of references, so maybe you will something of interest.

In Topic: Calculate HDR exposure from luminance Histogram

16 July 2015 - 07:56 AM

This seems quite interesting, do you know the advantages of this method over a simple 1x1 downsample luminance average?


With a simple average a few very bright HDR pixels (sun, fire or weapon muzzle flash) can change average luminance and over darken the entire image, so it's a good idea to skip a few % of brightest pixels. Similarly if you don't ignore most dark areas then entire image can be too bright. See "Post Processing in the Orange Box" for an explanation with some images.


Also I still having problems to understand how to calculate exposure from luminance if the tone mapping operator does not take in count the exposure.


Exposure = some_constant / averageLuminance and then multiply every pixel by exposure just before the tonemapping operator.



To be physically plausible, Bloom/Glare/Glow should added before tonemapping since it simulates scattering due to diffraction effects in the eye/camera lens, which are wavelength but not intensity dependent.


Yes, You are perfectly right.

In Topic: Calculate HDR exposure from luminance Histogram

15 July 2015 - 10:12 AM



This code discards given percentage of lower part (minFractionSum) and higher part of the histogram (maxFractionSum). Resulting middle part of histogram is used to calculate an average luminance value for tonemapping.


Average luminance should be calculated before the glare effects, but god rays aren't glare effects and should be applied before histogram calculation.

In Topic: HDR lightmap compression

04 July 2015 - 09:41 AM

I'm stuck with DX9 api.  LogLUV did have artifact when bilinear filter is on.

Is LogLUV  only good at being a slim HDR color buffer?

Can I implement a HDR deferred shading pipeline,  while using LDR light map at the same time? 


LogLUV is also fine for lightmaps if filtering artifacts are acceptable. You could also filter manually in the shader, but without DX11 GatherX instructions this won't be too optimal. Another possibility is to use other encoding schemes like RGBE, RGBM, RGBK etc. All of them have different kind of artifacts, but maybe something will work better for your's content.


I wouldn't recommend doing a HDR rendering with LDR lightmaps. At least rescale lightmap LDR values to a ~[0;4] range, so there will be some additional range at the cost of worse precision.