[x3d-public] Defaults of SpotLight.cutOffAngle, beamWidth changed (maybe by mistake) in X3D 3.3

Michalis Kamburelis michalis.kambi at gmail.com
Mon Feb 14 03:49:58 PST 2022


I have to say

1. I don't agree that "Thus default values need to have cutOffAngle >
beamWidth."

2. And I don't agree that cutOffAngle = pi/2 is good default. It's
surprisingly wide, all other software/formats I checked (see below)
have smaller cutOffAngle (aka outerConeAngle).

AD 1 - The specification explicitly allows "If the beamWidth is
greater than the cutOffAngle, beamWidth is defined to be equal to the
cutOffAngle and the light source emits full intensity within the
entire solid angle defined by cutOffAngle...." And the equations in
spec reflect that, everything works OK when beamWidth > cutOffAngle.
You don't have a smooth falloff in this case, but it looks reasonable.

AD 2 - This is my main pain point. I really think that cutOffAngle =
pi/2 is too wide, it means that whole spot angle is 180 degrees, so
SpotLight is at "maximally wide" state shining on half of 3D space. I
looked at defaults in other formats/application, and noone has so wide
default:

- glTF punctual lights (
https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_lights_punctual
) have by default outerConeAngle = pi/4

- Blender Spot light has by default size = 45 degrees, but this
expresses 2*outerConeAngle. So Blender default is like outerConeAngle
= 22.5 degrees = pi/8, even smaller

- Unity Spot has by default size = 30 degrees, but this is also
2*outerConeAngle. So again it is even smaller, like outerConeAngle =
15 degrees = pi/12

So really noone has so large default cutOffAngle = pi/2, everyone I
see has smaller. I believe that VRML 97 and X3D 3.0, 3.1, 3.2 did it
right, no change was necessary. And we should revert to that. So
defaults at

  - beamWidth pi/2
  - cutOffAngle pi/4

If you really want to make beamWidth by default smaller, then change
only beamWidth. Make beamWidth by default pi/4 or even pi/8. But don't
change the cutOffAngle to pi/2. This is so large (and
compatibility-breaking for no good reason, IMHO) that I'm really
reluctant to follow X3D 3.3 defaults in Castle Game Engine /
view3dscene, and I'm tempted to just stay with older defaults.

Regards,
Michalis

pon., 14 lut 2022 o 09:32 Brutzman, Donald (Don) (CIV)
<brutzman at nps.edu> napisał(a):
>
> Thanks for looking at this Michalis.  Further detail is available at
>
>
>
> Mantis 441: 17.4.3 SpotLight -- Default Values
> https://www.web3d.org/member-only/mantis/view.php?id=441
>
>
>
> Essential point: beamWidth is the inner angle of full intensity, cutOffAngle is the outer angle of zero intensity. Thus default values need to have cutOffAngle > beamWidth.
>
>
>
> So I think that this change, performed in 2009, fixed a prior problem in the specification.  Brightest area needs to be the inside cone, with intensity gradually fading until reaching the outside cone.
>
>
>
> Hopefully that now looks better to you.  Thanks for all scrutiny.
>
>
>
> *  https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/lighting.html#SpotLight
>
> 17.4.4 SpotLight
>
> SpotLight : X3DLightNode {
>
>   SFFloat [in,out] ambientIntensity 0        [0,1]
>
>   SFVec3f [in,out] attenuation      1 0 0    [0,∞)
>
>   SFFloat [in,out] beamWidth        π/4      (0,π/2]
>
>   SFColor [in,out] color            1 1 1    [0,1]
>
>   SFFloat [in,out] cutOffAngle      π/2      (0,π/2]
>
>   SFVec3f [in,out] direction        0 0 -1   (-∞,∞)
>
>   SFBool  [in,out] global           TRUE
>
>   SFFloat [in,out] intensity        1        [0,∞)
>
>   SFVec3f [in,out] location         0 0 0    (-∞,∞)
>
>   SFNode  [in,out] metadata         NULL     [X3DMetadataObject]
>
>   SFBool  [in,out] on               TRUE
>
>   SFFloat [in,out] radius           100      [0,∞)
>
>   SFBool  [in,out] shadows          FALSE
>
>   SFFloat [in,out] shadowIntensity  1        [0,1]
>
> }
>
>
>
> p.s. I just confirmed correctly matching values in X3D XML Schema and DTD.
>
>
>
> all the best, Don
>
> --
>
> Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
>
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
>
> X3D graphics, virtual worlds, Navy robotics https:// faculty.nps.edu/brutzman
>
>
>
> From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of Michalis Kamburelis
> Sent: Sunday, February 13, 2022 8:42 PM
> To: X3D Graphics public mailing list <x3d-public at web3d.org>
> Subject: Re: [x3d-public] Defaults of SpotLight.cutOffAngle, beamWidth changed (maybe by mistake) in X3D 3.3
>
>
>
> Note: I have a hypothesis why this happened.
>
>
>
> The drawing presented at SpotLight description (it is the same in all X3D versions) shows a situation when beamWidth < cutOffAngle. The drawing shows a situation when these is smooth falloff between beamWidth and cutOffAngle. Maybe someone thought that defaults do not match this drawing, ans thus reversed the defaults.
>
>
>
> I would say that the drawing just doesn't, and never meant to, show the default state. It just shows an example state that is possible.
>
>
>
> Regards,
>
> Michalis
>
>
>
> W dniu pon., 14.02.2022 o 05:10 Michalis Kamburelis <michalis.kambi at gmail.com> napisał(a):
>
> Hi,
>
> I just noticed an alarming regression at SpotLight definition across
> X3D versions.
>
> 1. In VRML 97, X3D 3.0, 3.1 and 3.2 the default values are:
>
>   - beamWidth pi/2
>   - cutOffAngle pi/4
>
>   This means that there is no smooth falloff from beamWidth to
> cutOffAngle. Spot light has multiplier = 1 in range 0...pi/4, and then
> it's zero outside of pi/4.
>
>   I think this is the good definition. It makes sense as default.
>
>   See:
>
>   - VRML 97: http://tecfa.unige.ch/guides/vrml/vrml97/spec/part1/nodesRef.html#SpotLight
>
>   - X3D 3.0: https://www.web3d.org/documents/specifications/19775-1/V3.0/Part01/components/lighting.html#SpotLight
>
>   - X3D 3.1: this version seems to be published only as "diff from X3D
> 3.0", and it has no change regarding SpotLight, see
> https://www.web3d.org/documents/specifications/19775-1/V3.1/Part01/components/lighting.html
>
>   - X3D 3.2: https://www.web3d.org/documents/specifications/19775-1/V3.2/Part01/components/lighting.html#SpotLight
>
> 2. In X3D 3.3 and 4.0 however, the defaults are reversed:
>
>   - beamWidth pi/4
>   - cutOffAngle pi/2
>
>   This makes a different behavior, and one that is IMHO less expected.
> cutOffAngle pi/2 means that "total angle of spotlight" is pi, 180
> degrees. This is possible, but unexpected as default for a spot light.
> It's a very wide light, effectively shining on half of 3D space.
>
>   See:
>
>   - X3D 3.3: https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/lighting.html#SpotLight
>
>   - X3D 4.0 draft:
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/lighting.html#SpotLight
>
> What others do?
>
> - Castle Game Engine and view3dscene always followed AD 1. I didn't
> even know that there was a change to this in X3D 3.3.
>
> - InstantReality (at least docs) also follows AD 1, looking at
> https://doc.instantreality.org/documentation/nodetype/SpotLight/
>
> - X3DOM (at least docs) is confused, judging from
> https://doc.x3dom.org/author/Lighting/SpotLight.html . They say that
> both cutOffAngle and beamWidth are both pi/2 by default, which is not
> consistent with any X3D version.
>
> I didn't test InstantReality or X3DOM in practice, only looked at docs now.
>
> Proposal: let's fix X3D 4.0. Revert the defaults to what was in X3D 3.2:
>
>   - beamWidth pi/2
>   - cutOffAngle pi/4
>
> Unless someone knows a good reason for change in X3D 3.3, I'm tempted
> to call this just a simple human mistake when someone was editing X3D
> 3.3.
>
> Regards,
> Michalis



More information about the x3d-public mailing list