[x3d-public] TwoSidedTexture node

Andreas Plesch andreasplesch at gmail.com
Sat Nov 4 14:41:28 PDT 2017


Yeah, the spec at
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#CommonGeometryFields
is clear that solid=true means no back faces are displayed, no matter
what else is going on. I agree that behaviour is cleanest and probably
what most/all browsers follow. It may be worth having a tooltip hint
for TwoSidedMaterial which points out that solid=false is required to
display the back faces.

Following the TwoSidedMaterial approach of having a single node
dealing with both sides, it is probably preferable to think about a
TwoSidedAppearance node implementing X3DAppearanceNode rather than an
additional BackAppearance node.

TwoSidedAppearance then would have FrontAppearance and a
BackAppearance fields also implementing X3DAppearanceNode, or
alternatively following TwoSidedMaterial back and front version of all
the Appearance node fields. In the first case one could spec. use of a
TwoSidedAppearance value for Front/BackAppearance as undefined
behaviour.

Functionality would simply be specified in terms of regular Appearance
but applied to just the front or backfaces:

'The TwoSidedAppearance node specifies the visual properties of front
and back faces of a geometry independently and separately. Front and
back faces are determined as described in 11.2.3 for the solid field
of geometry nodes.

The FrontAppearance field specifies the visual properties of front
faces as an Appearance node and the BackAppearance field the visual
properties of back faces.

There are opportunities to optimize rendering if both Front and
BackAppearance are of the same type but this is an implementation
detail.'

This is from the design side. Perhaps it is impossible to implement
even the naive version but perhaps now worth trying. I am unsure if I
should give it a try.

Next it may be useful to explore the implementation view, perhaps just
focusing on a TwoSidedImageTexture node as an example.

-Andreas

On Sat, Nov 4, 2017 at 4:23 PM, Michalis Kamburelis
<michalis.kambi at gmail.com> wrote:
> 2017-11-04 13:39 GMT+01:00 Andreas Plesch <andreasplesch at gmail.com>:
>> Another initial, minor question is how is TwoSidedMaterial expected to
>> interact with solid='true' surfaces ? Presumably by not using the
>> backMaterial but since solid='true' is the default another option is
>> that TwoSidedMaterial always implies solid='false'. After all, this is
>> surely what the author intended as she could have used a regular
>> Material otherwise. I could not find that resolved in the spec.
>
> My current understanding is that TwoSidedMaterial does *not* imply
> solid=FALSE. Since the specification doesn't say anything about it,
> then there's no automatic connection between "TwoSidedMaterial"
> existence and "solid" value.
>
> In my head, this is good, as we have two independent functionalities
> controlled by two independent things:
>
> 1. "solid" says whether the object is visible or not from the back
> side (i.e. whether to use "backface culling")
>
> 2. TwoSidedMaterial (or lack or if it) says if the object interacts
> with lighting differently when viewed from the back side.
>
> This feels clean to me. It's the responsibility of the 3D authoring
> tool to suggest that "hey, if you have TwoSidedMaterial, than maybe
> you want to use solid=FALSE". It is *not* the responsibility of the
> X3D standard (or X3D implementations) to hardcode such connection
> between TwoSidedMaterial and "solid".
>
> Otherwise, mixing these two things would complicate the specification
> and logic, you would need to say that "backface culling is used if
> solid = FALSE *or* some TwoSidedMaterial is present". How to turn on
> the backface culling then? You will need to set solid = TRUE *and*
> remove any TwoSidedMaterial nodes. It seems simple on paper, but I'm
> afraid that such rule would be a source of bugs/inconsistencies
> between implementations.
>
> This is just my "feeling" (not some definite mathematical proof) that
> "TwoSidedMaterial existence" and "backface culling (solid value)"
> should not interact with each other. In the end, I would be fine with
> any behavior, as long as clearly articulated in the X3D spec :)
>
> Regards,
> Michalis



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list