Jump to content

  • Log In with Google      Sign In   
  • Create Account

Luminance


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
20 replies to this topic

#1 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 08 April 2013 - 05:14 PM

I have read many papers in my efforts to understand Luminance

 

I understand the other photometric terms (Intensity, Flux, Illuminance, Reflectance, Emittance)

and I have no problem with 3D geometry (solid angles, projected areas) or cosine laws etc.

 

but Luminance still evades me

 

What should I be reading?



Sponsor:

#2 Juliean   GDNet+   -  Reputation: 2722

Like
0Likes
Like

Posted 08 April 2013 - 05:21 PM

Maybe wikipedia?

 

http://en.wikipedia.org/wiki/Luminance

 

In short for a 3d graphics application, luminance often refers to specialy weighted and combined illumination for any given point of your scene. The only term however I heard about it being used practically was for HDR and tonemapping, where you would calculate the average logarythmic luminance of your entire scene from the cameras viewport, for the HDR equation.

 

While this is probably not what you wanted to know in the first place, you might get the most information about this topic by reading articles about HDR like:

 

http://msdn.microsoft.com/en-us/library/windows/desktop/bb173486%28v=vs.85%29.aspx

 

Unless there is some other viable source that I don't know yet...



#3 Matias Goldberg   Crossbones+   -  Reputation: 3696

Like
1Likes
Like

Posted 08 April 2013 - 08:43 PM

The only term however I heard about it being used practically was for HDR and tonemapping, where you would calculate the average logarythmic luminance of your entire scene from the cameras viewport, for the HDR equation.

Don't forget about YUV format. Y is for luminance, and contains the luminance at the given pixel. YUV (and it's variants YUV422, YV42, etc) is the preferred choice when dealing with JPEG, MPEG-2, MPEG-4 & H264 compression, also when broadcasting TV.

Also lately the YUV422 format is comming up in games because it halves the bandwidth and memory requirements for slight losses in quality.

#4 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 09 April 2013 - 02:49 AM

converting rgb radiance to luminance I do understand (spectral weighting)

 

but the wiki article is incoherent

it says that luminance is dependent on the angle of view!

and the terms in the equation it gives are ambiguous and I can't determine any set of terms that makes sense

for example: which solid angle, which area, which angle, which flux, etc. etc.)

 

I believe that:

 

luminance = illuminance * reflectance / pi

 

pi describes the reduction in intensity due to diffuse scattering

and you can use rgb albedo as reflectance

 

and that the units cd/m^2 is almost a play on words

in that luminance is a form of intensity - but for surfaces rather than points

 

and the dot lighting we use in games ignores the pi term for simplicity

 

(editor keeps dropping the first letter of lines)


Edited by skytiger, 09 April 2013 - 02:52 AM.


#5 Bacterius   Crossbones+   -  Reputation: 9281

Like
2Likes
Like

Posted 09 April 2013 - 03:39 AM

Luminance isn't a radiometric quantity. It's basically radiance weighted by an observer's luminosity function. If you compare the definition of radiance and luminance, you will see they are exactly the same with the exception that radiance uses watts whereas luminance uses candelas (which are just watts weighted by "perceived brightness", loosely stated).

 

I have to agree with Juliean, this is probably not the definition of luminance you were thinking of, and I think what you are looking for is pretty much just what you already know - it's just radiance, weighted to match our tristimulus color matching functions (this is what photometry is about - how humans and other species perceive light, not just a radiometric physical interpretation of it)


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#6 Hodgman   Moderators   -  Reputation: 31804

Like
2Likes
Like

Posted 09 April 2013 - 04:23 AM

Your reflectance/pi formula is the Lambertian BRDF, which is off on a completely different tangent.

As above, luminance is a much more general concept -- if you've got some quality of colored (vector/spectral) light, how can we approximate how bright (1d/scalar/monochrome) it will be percieved to be. It's basically just "to greyscale", but with some carefully tuned weights.
You can calculate the luminosity of radiance, irradiance, or even a pixel from an uncalibrated JPEG.

#7 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 09 April 2013 - 08:20 AM

This seems to describe one of the problems I am having:

 

http://www.oceanopticsbook.info/view/radiative_transfer_theory/level_2/the_lambertian_brdf

 

it describes apparently contradictory descriptions of lambertian scattering

 

is this "a different tangent" though, luminance is associated specifically with diffuse surfaces, which lambert is describing



#8 Bacterius   Crossbones+   -  Reputation: 9281

Like
0Likes
Like

Posted 09 April 2013 - 08:42 AM

This seems to describe one of the problems I am having:
 
http://www.oceanopticsbook.info/view/radiative_transfer_theory/level_2/the_lambertian_brdf
 
it describes apparently contradictory descriptions of lambertian scattering
 
is this "a different tangent" though, luminance is associated specifically with diffuse surfaces, which lambert is describing

But "luminance" is mentioned nowhere in that document, do you mean the two reflectance diagrams? If you understand the cosine law then the two are equivalent, it simply depends on how you are interpreting the reflected light, energy per solid angle (that is radiant intensity) or energy per surface area per solid angle (that is radiance). One thing I've learned about radiometry is that units are all over the place, and you need to be sure you know the difference between each definition or you'll get muddled up really quickly.

And as for luminance being associated with diffuse surfaces, that's because diffuse surfaces are the easiest type of surface to analyze, and so it is only natural to describe it using Lambertian reflectors. To be clear, luminance is the photometric equivalent of radiance, so it isn't really associated with anything, it's a broad, general concept, but its use in computer graphics is typically narrow and sometimes pedantically wrong (granted, it's difficult to get it right sometimes when you've got largely similar terms like "intensity", "brightness", "luminosity", "luminance", which in ordinary english are pretty much interchangeable)

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#9 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 09 April 2013 - 09:13 AM

ok things are getting clearer

 

NOW I understand the cosine law ...

 

can you help my thought experiment along

 

point light with intensity I

surface element subtends solid angle O

incident flux is F = I * O

surface element has surface area A

irradiance is E = F / A

reflectance is 100%

so emittance M = E

 

and radiance is ... now I am stuck

 

I could say the radiance is also M

as we have already divided by an area and by a solid angle ...

but we haven't taken into account the diffuse scattering

 

Or I could say that radiance is M / pi

which accounts for the scattering, but is now an average over the hemisphere

now I can see how to calculate the flux entering an eye's pupil

(integrate solid angle subtended by pupil and surface area of surface)

but then projected area pops up ...



#10 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 09 April 2013 - 02:58 PM

I think I understand radiance / luminance now

 

I think that for a lambert diffuse surface that L = M / pi

 

And that dot product lighting in video games bypasses the concept of radiance and defines lights in terms of irradiance

and pixel shaders calculate

 

emittance = irradiance * albedo * dot(N, L)

 

as a simplification that allows us to model "impossible" light sources such as: point and directional and skip the divide by pi (and the whole solid angle * projected area thing cancels out anyway)

 

"luminance" as discussed earlier is really a conversion from radiant emittance to luminous emittance by spectral weighting



#11 Bacterius   Crossbones+   -  Reputation: 9281

Like
1Likes
Like

Posted 09 April 2013 - 06:31 PM

And that dot product lighting in video games bypasses the concept of radiance and defines lights in terms of irradiance

What? No, the solid angle is always taken into account in direct light sampling (which is what games usually do). See that division by the distance to the point light squared? That's the solid angle part. The cosine term (dot product) does happen to cancel out for most BRDF's, though. Radiance and irradiance are two completely different concepts, irradiance does not take direction into account, it's simply the radiant energy flux density (i.e. per unit area) emitted by a surface (in every direction).

Your calculation using irradiance is technically correct for diffuse surfaces, but the only reason this is true is because such surfaces have constant reflectance (for diffuse surfaces, irradiance is equal to reflectance, this is what light baking actually does but it only works for diffuse-only surfaces, or generally surfaces where the reflectance happens to be independent of view angle). It does not work for more complex reflectance functions (BRDF's), this is what simple pixel shaders do:
set the lighting term to zero
calculate the surface normal N

for every point light in the world:
-- calculate the distance D from the light to this pixel
-- calculate the view vector V (camera to pixel) and the light vector L (pixel to light source)
-- evaluate the BRDF for (L, V) as reflectance ratio R (both for diffuse and specular)
-- divide everything by D^2 (inverse square law) and multiply/divide by dot(N, L), PI, as needed
-- add this to your "lighting term"

add ambient, light-independent stuff
modify your pixel's color depending on the lighting term calculated
 
Computer graphics shaders aren't a role model of clarity, generally they are not concerned with making sense, they just need to be fast and correct. Sometimes you'll see things like the inverse square division missing as it was accounted for elsewhere, the PI division was baked outside the shader, and so on.. shaders probably aren't the best way to learn radiometry.

I think it's really the notion of BRDF that you are missing here, diffuse surfaces aren't everything and tend to simplify a lot of stuff which is actually relevant for every other type of surface. As for the BRDF, the concept is fairly simple, if a bit abstract - for a light vector L and a view vector V, the BRDF returns the fraction of light incident to the surface along vector L (note this is radiance) which will be reflected along vector V.

PS: in the pseudocode above you also need to check if the point light is occluded by geometry, if so you need to cast a shadow instead. And you will notice this is not physically accurate, as it is ignoring the light contribution from light bouncing around the world and only considering direct lighting contribution from the point light sources themselves.

Area lights are in theory handled like an infinite number of point lights clumped together (but in computer graphics different methods are used, obviously).

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#12 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 10 April 2013 - 02:51 AM

I understand your point about distance squared and solid angle

 

I thought dot(N, L) *was* the BRDF?

 

I think my problem stems from trying to define radiance at a point on the surface

which is impossible ... you need the view direction also



#13 Hodgman   Moderators   -  Reputation: 31804

Like
0Likes
Like

Posted 10 April 2013 - 03:06 AM

Technically N•L is outside of the BRDF, and is a part of the rendering equation which is multiplied by the BRDF.

#14 Bacterius   Crossbones+   -  Reputation: 9281

Like
0Likes
Like

Posted 10 April 2013 - 03:28 AM

I think my problem stems from trying to define radiance at a point on the surface
which is impossible ... you need the view direction also

Yes, "radiance at a point" doesn't make much sense. Radiance is precisely defined as radiant exitance per solid angle (for computer graphics, read: "in a given direction"). You can sort of think of radiance as the flux through the cross-section of a cone originating from a surface in some direction. Note the flux decreases with cross-section area, and the cross-section area increases with distance squared (inverse square law). Whereas irradiance is just the total amount of light which falls onto a surface (per unit area).

This isn't a very rigorous way of thinking about it, but if it helps...

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#15 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 10 April 2013 - 04:44 AM

I see

so you could consider diffuse lighting as: 
 
const float BRDF = 1.0;

Cirradiance = Clight * dot(N, L) / pow(distance, 2); // Clight is radiance

Cradiance = Cirradiance * Calbedo * BRDF;
Could Calbedo be considered part of the BRDF (the part dependent on wavelength?)

And Cspecular would require a function for the BRDF ...

#16 Bacterius   Crossbones+   -  Reputation: 9281

Like
0Likes
Like

Posted 10 April 2013 - 05:07 AM

No, stop trying to fit irradiance into all this! For diffuse surfaces, the BRDF is equal to the constant (up to wavelength) albedo:

BRDF(V, L) = albedo;

And the rendering equation tells you that:

Radiance = (emitted light) + integral of directions L over the hemisphere centered of the surface normal of BRDF(V, L) * L * dot(N, L) dL

The integral itself includes the solid angle term, but since unless you are doing global illumination you are not evaluating the entire integral but only sampling a few point lights, you need to add it manually. This is basically what the pseudocode I gave above does, it evaluates the rendering equation's integral at a few discrete point lights (so the integral becomes a sum, as expected).

As you can see irradiance just doesn't come up when trying to perform ordinary lighting. It may come up when doing irradiance caching or baking light maps but if you are just doing simple lighting calculations, it is not something you need to think about.

You have the right idea but are just confused, I think. Do you understand the rendering equation? If not, try reading these links which I found useful myself: http://www.rorydriscoll.com/2008/08/24/lighting-the-rendering-equation/

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#17 skytiger   Members   -  Reputation: 262

Like
1Likes
Like

Posted 10 April 2013 - 09:24 AM

the rorydriscoll rendering equation is very good

I am going to digest everything you and Hodgman have said

when I return I will be a full fledged radiometric butterfly instead of the maggot I am now

thanks for your efforts

#18 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 14 April 2013 - 09:05 AM

The best explanation I have found is here:

 

http://www.oceanopticsbook.info/view/radiative_transfer_theory/level_2/the_lambertian_brdf

 

The key is understanding that measured radiance increases as the viewing angle increases

(due to the the projected area term in the radiance equation)

 

(Intuitively this is due to the same amount of light being compressed into a smaller area - thus it is "brighter")

 

A Lambertian surface cancels this out by using another cosine term

 

This means if you are working with Lambertian surfaces you can

- drop the cosine term from the BRDF

- drop the projected area term from radiance

(as these 2 cancel out)

 

and you end up with typical shader code where the diffuse BRDF is just albedo

 



#19 skytiger   Members   -  Reputation: 262

Like
0Likes
Like

Posted 05 May 2013 - 09:16 AM

BRDF is defined as a function which returns the ratio of incident _irradiance_ to outgoing radiance ...

Cirradiance = Clight * dot(N, L) / pow(distance, 2); // Clight is radiance 

my computer graphics book says:

E = R * dot(N, L) * differential_solid_angle 

which is the same thing ... so I really don't think I am wrong about this part?



#20 Bacterius   Crossbones+   -  Reputation: 9281

Like
0Likes
Like

Posted 05 May 2013 - 09:44 AM

BRDF is defined as a function which returns the ratio of incident _irradiance_ to outgoing radiance ...

Cirradiance = Clight * dot(N, L) / pow(distance, 2); // Clight is radiance 

my computer graphics book says:

E = R * dot(N, L) * differential_solid_angle 

which is the same thing ... so I really don't think I am wrong about this part?

 

That is the irradiance incident on the surface from the point light source's direction only, correct. And then you multiply that by the BRDF to work out how much of this irradiance (intensity: watts / surface area) is actually reflected towards any given direction (= exitant radiance) - probably the camera's view angle.

 

To be perfectly correct, Clight is not the radiance. It's the light source's power. Then the radiance towards the surface you are trying to work out the irradiance of is:

 

 

Clight / pow(distance, 2) // this is the radiance - no need for the area since this is a point light source

 

And you multiply by the cosine term to obtain the irradiance from this point light source (by taking into account the projected of the irradiated surface)

 

Now the book's version is slightly more general. With a differential solid angle you can do stuff like integration, whereas with your version you are restricted to dealing with point light sources as the distance requires knowledge of the surrounding geometry. This is an important distinction.


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS