Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need better specification of light intensity vs power vs radiance #133

Open
ingowald opened this issue Oct 27, 2024 · 3 comments · May be fixed by #135
Open

Need better specification of light intensity vs power vs radiance #133

ingowald opened this issue Oct 27, 2024 · 3 comments · May be fixed by #135

Comments

@ingowald
Copy link

Currently spec allows to set light "intensity/radiance/whatever" through multiple different mechanisms, with some hand-wavy formulation of "takes precedence if also specified". The latter, however, leads to some abiguity of what "if also specified" means, because these values do actually ahve default values. Eg, Directional::irradiance has default value of '1', but if I consider this as 'specified', then 'radiance' would always be overridden - yet if i consider it as "it isn't specified unless explicitly set via a setParameter call" then having a default value doesn't make sense, because the default value can never apply (because the 'value' isn't active unless explicitly specified, at which point it's not longer the default value). This leads to mental gymnastic such as "if i want it to have the default value i have to set the value to the default value", which is very much different from how any other parameter in any other ospray object is being handled.

Note same ambiguity exists for 'radiance' in other light sources; 'point::radiance' is even worse because it says "intensity (or power) take precedence if also specified", so there' even two values that could override, each with their own priorities.

One optoin to make this clearer would be to say that the default value for irradiane is "not specified"; an arguably even cleaner specification would be to specify two differently-behaving lights as being two different classes. In that same vein, a "Sphere" light should really be its separate class, not simply be a point light with an optional added radius.

@johguenther
Copy link
Collaborator

Yes, with "specified" we mean explicitly set. So you are right: default values for parameters that don't have precedence (which are overridden by others) do not make sense.
So, we should at least omit the default, or e.g. say for power's default "use intensity".

@ingowald
Copy link
Author

K, makes sense. I still hate the concept of expressing the same functionality in different ways with different variables - that only increases the burden on the device deloper to implement both - but if we at least make it consistent we already make a huge step forward.
Maybe one formulation for the "default value" column here might also be "only applies if explicitly set, see 'intensity'" ? The "use intensity" sounds like a instruction to the user to "use" intensity instead, which is arguably not what you mean.

@johguenther johguenther transferred this issue from KhronosGroup/ANARI-SDK Nov 12, 2024
@johguenther johguenther linked a pull request Nov 13, 2024 that will close this issue
@johguenther
Copy link
Collaborator

First draft (for directional and point light) in #135.

Extending the discussion: do we really want to keep both intensity and power for many lights? The difference between them is a constant (integrating over the sphere of directions). intensity is easier for implementations (just use the value), while power is more intuitive for users.
The additional alternative radiance is well justified: the behavior when changing the size of the light source is different to intensity/power.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants