[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 08:27:15 PST 2022


I never said I disagree with "cutOffAngle > beamWidth" :) The "cutOffAngle
> beamWidth" is a completely valid state. It means you have a smooth
falloff at the edge of spot light. Makes sense.

I said I disagree with your statement that "Thus default values need to
have cutOffAngle > beamWidth."

Because, to be clear, both "cutOffAngle > beamWidth" and "cutOffAngle <
beamWidth" (and equal too) are valid states. X3D specification, all
versions, explicitly allows that. The equation for calculating "multiplier"
at SpotLight was made to work in all cases, and the SpotLight text has even
explicit prose to explain that: "If the beamWidth is greater than the
cutOffAngle....".

What I'm saying is that the defaults in VRML 97 / X3D 3.0-3.2 were better
than defaults in X3D 3.3-4.0draft. The new defaults specify a very wide
spot light, 180 degrees total (lights half of 3D space), which is not
consistent with any other software / format (glTF or Blender or Unity).
Everyone has smaller default cutOffAngle (whatever it is called).

The old defaults were not "forever broken". On the contrary, they were
correct, working, and more natural than the defaults after change in X3D
3.3. And the diagram at SpotLight was (and still is) correct too, no need
to change that.

To be clear, neither situation (VRML 97 / X3D 3.0-3.2 or X3D 3.3-4.0) is
equivalent at all to glTF. To be consistent with glTF, the closest thing
would be

- cutOffAngle pi/4
- beamWidth 0

... except it does not work as nicely in X3D, because X3D SpotLight falloff
is linear, while glTF punctual lights have more interesting smooth equation.

So I do not push to make X3D SpotLight precisely equal to glTF SpotLight
defaults. This would require even more changes. I'm just arguing for a
simpler change, to return to the (correct and more reasonable IMHO)
SpotLight defaults we had in VRML 97 / X3D 3.0-3.2.

Indeed it seems we're going in circles, not reaching full understanding :)
I'm happy to explain better at the call, I can join this Friday. I would
appreciate if you can send me a calendar invite, so that I will not mixup
the timezones/dst etc. :) I don't see Friday meetings in
https://www.web3d.org/calendar .

Regards,
Michalis

pon., 14 lut 2022 o 16:14 Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
napisał(a):

> Thanks for continued analysis.
>
>
>
> I like the clearer field names in glTF reference that you provided:
>
> *Property*
>
> *Description*
>
> *Required*
>
> innerConeAngle
>
> Angle, in radians, from centre of spotlight where falloff begins. Must be
> greater than or equal to 0 and less than outerConeAngle.
>
> No, Default: 0
>
> outerConeAngle
>
> Angle, in radians, from centre of spotlight where falloff ends. Must be
> greater than innerConeAngle and less than or equal to PI / 2.0.
>
> No, Default: PI / 4.0
>
>
>
>
>
> It seems clear to me that innerConeAngle corresponds to beamWidth, and
> outerConeAngle corresponds to cutOffAngle.
>
>
>
> If you disagree with “cutOffAngle > beamWidth” (perhaps greater than or
> equals) relationship, then you think the opposite and thus would need a new
> diagram, correct?  Similarly, that is a functional change to the (possibly
> still incorrect?) X3D Spotlight.
>
>    - X3D4 Architecture, Figure 17.1 — SpotLight node
>    -
>    https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/lighting.html#f-SpotLightnode
>
>
>
> If these parameters have been forever broken, then we need to
> unambiguously define and illustrate the correct approach.  I am open to
> possibility of alignment with glTF to ensure that no misunderstandings are
> carried forward.
>
>
>
> If a simpler adjustment of default values might work, that is possible… in
> general though, defaults are chosen to be somewhat forgiving so that
> authors can tell something is going on (directionality is sometimes
> difficult) and then tune values accordingly.
>
>
>
> Taking a step back: this all seems fundamental yet we are circling…
> suggest we get together on Web3D teleconference this week.  Hoping that
> Friday’s regular X3D weekly meeting might work for you?  Several people can
> be in attendance then.
>
>
>
> 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
>
>
>
> -----Original Message-----
> From: Michalis Kamburelis <michalis.kambi at gmail.com>
> Sent: Monday, February 14, 2022 3:50 AM
> To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
> Cc: 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
>
> 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://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKhronosGroup%2FglTF%2Ftree%2Fmain%2Fextensions%2F2.0%2FKhronos%2FKHR_lights_punctual&data=04%7C01%7Cbrutzman%40nps.edu%7C5493278ab60b46b9951e08d9efb03649%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637804363573077429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=d3IA54ENWoYel6mMl6mRHOy9QEdJ7qX%2FERHqNIDVXno%3D&reserved=0
>
> ) 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/P
>
> > art01/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:
>
> > https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftecfa
>
> > .unige.ch%2Fguides%2Fvrml%2Fvrml97%2Fspec%2Fpart1%2FnodesRef.html%23Sp
>
> > otLight&data=04%7C01%7Cbrutzman%40nps.edu%7C5493278ab60b46b9951e08
>
> > d9efb03649%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C63780436357307
>
> > 7429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
>
> > iI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=DR7HBogG27XNmzipDNWEXGHtHw0
>
> > HQyJgaT%2BSPqIcKWY%3D&reserved=0
>
> >
>
> >   - X3D 3.0:
>
> > https://www.web3d.org/documents/specifications/19775-1/V3.0/Part01/com
>
> > ponents/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/com
>
> > ponents/lighting.html
>
> >
>
> >   - X3D 3.2:
>
> > https://www.web3d.org/documents/specifications/19775-1/V3.2/Part01/com
>
> > ponents/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/com
>
> > ponents/lighting.html#SpotLight
>
> >
>
> >   - X3D 4.0 draft:
>
> > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/P
>
> > art01/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://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc.
>
> > instantreality.org%2Fdocumentation%2Fnodetype%2FSpotLight%2F&data=
>
> > 04%7C01%7Cbrutzman%40nps.edu%7C5493278ab60b46b9951e08d9efb03649%7C6d93
>
> > 6231a51740ea9199f7578963378e%7C0%7C0%7C637804363573077429%7CUnknown%7C
>
> > TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVC
>
> > I6Mn0%3D%7C3000&sdata=n1Vnxg6FcwwzV54VjD0hAvPq3X25SCrYvmP%2FFSNtrc
>
> > k%3D&reserved=0
>
> >
>
> > - X3DOM (at least docs) is confused, judging from
>
> > https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc.
>
> > x3dom.org%2Fauthor%2FLighting%2FSpotLight.html&data=04%7C01%7Cbrut
>
> > zman%40nps.edu%7C5493278ab60b46b9951e08d9efb03649%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637804363573077429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=payjbNAnAV%2B2lc8N7Ku0EGt7K6sJdWMyV%2FTJtAsds4Q%3D&reserved=0
> . 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220214/2cb66822/attachment-0001.html>


More information about the x3d-public mailing list