[x3d-public] gltf distance attenuation [was glTF compatibility]

Michalis Kamburelis michalis.kambi at gmail.com
Mon Sep 4 05:31:57 PDT 2023


Fantastic, thank you for doing this.

Sorry for not giving a more substantial answer, I have in TODO to read
everything from this thread and "Need for colorspaceConversion field
in ImageTexture, glTF compatibility" , and think what to do (both in
CGE/view3dscene, and what change we should propose to X3D 4.1). From a
quick glance, it seems we have a consensus and we could just align to
glTF easily in some aspects.

So, I'll post a more detailed thoughts ~next week, but for now: just
wanted to send thanks :) Great job!

Regards,
Michalis


pon., 4 wrz 2023 o 06:51 Andreas Plesch <andreasplesch at gmail.com> napisał(a):
>
> https://github.com/x3dom/x3dom/issues/1259#issuecomment-1704585434
>
> has a few plots which show similarities and differences for default
> x3d and gltf point light attenuation.
>
> The default parameters for x3d are 1,0,0 and radius=100.
> The default parameters for gltf are 0,0,1 and radius=infinite
>
> The plots show attenuation for these default settings with the x3d
> math and the gltf math.
> For the radius=infinite case the gltf and x3d maths boil down to the
> same, so no differences..
> For short distances (0 to 10) there are essentially no differences
> between the different maths.
> For large distances (close to 100), there are differences between gltf
> and x3d maths. x3d has a step for 1,0,0 and a small step for 0,0,1.
> gltf maths produces smooth falloffs for both 1,0,0 and 0,0,1. The
> largest differences occur for 1,0,0 between 60m and 100m distance
> where gltf generates significant attenuation and darker scenes, and
> x3d does not..
>
> Is the impact of adopting the gltf denominator acceptable for x3d ?
>
> One way to check is to look through the large example archive for
> examples with point or spotlights (not too many) with default
> attenuation (most of those) and see if any shapes are more than 50m
> away from the light. The first part should be possible with some
> grepping but the second part is difficult and probably requires a
> quick manual check.
>
> Andreas
>
> > > 2. As for attenuation and spot cutoff: Indeed glTF math is a bit different.
> > >
> > > Personally: I'm OK with
> > >
> > > - adding fields to change the math to follow glTF.
> > >
> > > - Or just change X3D spec to follow glTF equations. At these points,
> > > glTF equations are just better IMHO, more realistic, and the X3D
> > > equations are simpler and just followed what old OpenGL ancient
> > > fixed-function pipeline could do. It would indeed change how things
> > > look, but I think it would be a change for better.
> > >
> > > I would not want to have different attenuation / spot behavior for
> > > Material versus PhysicalMaterial. Conceptually (when describing it to
> > > humans) and technically (when implementing) this seems a bit
> > > unexpected. Material versus PhysicalMaterial should not determine
> > > light attenuation or spot light beam falloff, they should be
> > > independent IMHO (and they are independent now).
> >
> > Yes, attenuation should not be related to the kind of Material. I was
> > thinking about that only as a way to not break anything.
> >
> > I tend to agree that just changing the spec. for attenuation is
> > acceptable. But others may disagree since there are users of
> > SpotLight. It may come down to how different the defaults look.
> >
> > Let's see. For distance attenuation, there could be a combined
> > equation which preserves the x3d parameters in the denominator and
> > adds the glTF range/radius transition in the numerator. I think this
> > could work.



More information about the x3d-public mailing list