confusing dr3d:lighting-mode

classic Classic list List threaded Threaded
3 messages Options
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

confusing dr3d:lighting-mode

Hi all,

in ODF 1.2 exists the attribute
19.99 dr3d:lighting-mode

It has the description
"The dr3d:lighting-mode attribute specifies whether lighting is used in
a three-dimensional chart." and "... a three-dimensional scene."

And for data type: "The dr3d:lighting-mode attribute has the data type
boolean 18.3.3."

What is the purpose of this attribute? From the text I would expect,
that it enables/disables the use of lights in the scene or chart.



But in addition exists in ODF 1.2 for 3D Objects the style property
20.79 dr3d:lighting-mode

The description is, "The dr3d:lighting-mode attribute specifies whether
lighting is used for a three-dimensional object."
Notice the "three-dimensional object" here.

And for data type: "The defined values for the dr3d:lighting-mode
attribute are:
     ●double-sided: the front and back sides of all planes are displayed
if they are visible from the viewer's perspective.
     ●standard: Depending on the value of the dr3d:normals-direction
attribute, only the front or only the back side sides of the plane are
displayed. The opposite sides are not displayed, whether they are
visible from the viewer's perspective or not."

So this style property is connected to normals.



The code is very confusing. I find in mbLightingMode(false) in
SdXML3DSceneAttributesHelper and later
setPropertyValue("D3DSceneTwoSidedLighting", uno::Any(mbLightingMode))
That makes no sense to me.

I do not find any place where "double-sided" vs "standard" is evaluated
on file open, I see no UI element to set it, and the property
"D3DDoubleSided", which sounds so, is mapped to XML_BACKFACE_CULLING in
sdpropls.cxx, which is another different style property. And my test
files do not work as I expect it in regard to normals, in case I write
dr3d:lighting-mode="standard" in the file.


Reason for my investigation is, that the OASIS ODF TC will revise these
texts for ODF1.3.

Kind regards
Regina



_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Armin Le Grand-2 Armin Le Grand-2
Reply | Threaded
Open this post in threaded view
|

Re: confusing dr3d:lighting-mode

Hi Regina,

yes, looks irritating. I took a look and it seems that the attribute is
used in two different scenarios.

When used in 'style-graphic-properties-attlist' it is

             <optional>
                 <attribute name="dr3d:lighting-mode">
                     <choice>
                         <value>standard</value>
                         <value>double-sided</value>
                     </choice>
                 </attribute>
             </optional>

while in 'dr3d-scene-attlist' it is

             <optional>
                 <attribute name="dr3d:lighting-mode">
                     <ref name="boolean"/>
                 </attribute>
             </optional>

In the 1st case it is used as object attribute for each SdrObject (but
only of use when it is a 3D object) and in the style hierarchy to define
if double-sided lighting is applied. This is equivalent to the button in
the 3D dialog (Tab 'GeometryÄ, Button 'Double-Sided'). Mostly useful for
non-closed 3D objects.

In the 2nd case it is used for 3D Scene objects only and defines if
lighting is applied at all to the whole scene. If applied, flat, phong
or gourard is used, if not, the objects are rendered without lighting
calculations in their FillStyle definitions. This is also in the 3D
dialog, see Tab 'Textures' the 'Mode' switches.

Something must have run out of order though, the original 'Mode' was not
a bool but had three states (as the 3D dialog shows). Someone at some
time must have changed it to bool, but probably forgot to cleanup the 3D
dialog.

I am not sure if the attribute is allowed to be used with the same name
in two scenarios (maybe valid), but probably not with two different data
types (?) so one probably should be renamed.

And the 3D dialog should be corrected...


Regards,

ALG



Am 22.07.2016 um 00:44 schrieb Regina Henschel:

> Hi all,
>
> in ODF 1.2 exists the attribute
> 19.99 dr3d:lighting-mode
>
> It has the description
> "The dr3d:lighting-mode attribute specifies whether lighting is used
> in a three-dimensional chart." and "... a three-dimensional scene."
>
> And for data type: "The dr3d:lighting-mode attribute has the data type
> boolean 18.3.3."
>
> What is the purpose of this attribute? From the text I would expect,
> that it enables/disables the use of lights in the scene or chart.
>
>
>
> But in addition exists in ODF 1.2 for 3D Objects the style property
> 20.79 dr3d:lighting-mode
>
> The description is, "The dr3d:lighting-mode attribute specifies
> whether lighting is used for a three-dimensional object."
> Notice the "three-dimensional object" here.
>
> And for data type: "The defined values for the dr3d:lighting-mode
> attribute are:
>     ●double-sided: the front and back sides of all planes are
> displayed if they are visible from the viewer's perspective.
>     ●standard: Depending on the value of the dr3d:normals-direction
> attribute, only the front or only the back side sides of the plane are
> displayed. The opposite sides are not displayed, whether they are
> visible from the viewer's perspective or not."
>
> So this style property is connected to normals.
>
>
>
> The code is very confusing. I find in mbLightingMode(false) in
> SdXML3DSceneAttributesHelper and later
> setPropertyValue("D3DSceneTwoSidedLighting", uno::Any(mbLightingMode))
> That makes no sense to me.
>
> I do not find any place where "double-sided" vs "standard" is
> evaluated on file open, I see no UI element to set it, and the
> property "D3DDoubleSided", which sounds so, is mapped to
> XML_BACKFACE_CULLING in sdpropls.cxx, which is another different style
> property. And my test files do not work as I expect it in regard to
> normals, in case I write dr3d:lighting-mode="standard" in the file.
>
>
> Reason for my investigation is, that the OASIS ODF TC will revise
> these texts for ODF1.3.
>
> Kind regards
> Regina
>
>
>
> _______________________________________________
> LibreOffice mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/libreoffice

--
--
ALG (PGP Key: EE1C 4B3F E751 D8BC C485 DEC1 3C59 F953 D81C F4A2)

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: confusing dr3d:lighting-mode

Hi,

comments inline.

Armin Le Grand schrieb:

> Hi Regina,
>
> yes, looks irritating. I took a look and it seems that the attribute is
> used in two different scenarios.
>
> When used in 'style-graphic-properties-attlist' it is
>
>              <optional>
>                  <attribute name="dr3d:lighting-mode">
>                      <choice>
>                          <value>standard</value>
>                          <value>double-sided</value>
>                      </choice>
>                  </attribute>
>              </optional>
>
> while in 'dr3d-scene-attlist' it is
>
>              <optional>
>                  <attribute name="dr3d:lighting-mode">
>                      <ref name="boolean"/>
>                  </attribute>
>              </optional>
>
> In the 1st case it is used as object attribute for each SdrObject (but
> only of use when it is a 3D object) and in the style hierarchy to define
> if double-sided lighting is applied. This is equivalent to the button in
> the 3D dialog (Tab 'GeometryÄ, Button 'Double-Sided'). Mostly useful for
> non-closed 3D objects.
>
> In the 2nd case it is used for 3D Scene objects only and defines if
> lighting is applied at all to the whole scene. If applied, flat, phong
> or gourard is used, if not, the objects are rendered without lighting
> calculations in their FillStyle definitions. This is also in the 3D
> dialog, see Tab 'Textures' the 'Mode' switches.


That does not fit to my experiments. The Button "Double-Sided" sets the
attribute dr3d:backface-culling. The Button "Double-Sided Illumination"
sets the attribute dr3d:lighting-mode in the boolean version.

I do not find any UI or code which corresponds to the dr3d:lighting-mode
in the double-sided/standard version.

'Textures'>'Mode' is total different in my experiments. It corresponds
to the attribute dr3d:texture-mode, which has the values "blend",
"modulate" and "replace" in ODF. Whatever that means, it seems, it is
not what LibreOffice does, but LibreOffice writes this attribute.
Anyway, "Textures" is another matter.

>
> Something must have run out of order though, the original 'Mode' was not
> a bool but had three states (as the 3D dialog shows). Someone at some
> time must have changed it to bool, but probably forgot to cleanup the 3D
> dialog.

There is indeed something wrong with 'Textures'. Formerly "Mode" had two
states, now it has three, but I cannot use the third, right choice.

>
> I am not sure if the attribute is allowed to be used with the same name
> in two scenarios (maybe valid), but probably not with two different data
> types (?) so one probably should be renamed.
>
> And the 3D dialog should be corrected...

Not only the dialog. It seems to me, that the whole 3D is a mess in
regard to ODF. And it will be hard to get ODF and LibreOffice
implementation aligned.

Kind regard
Regina



_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice