Closed Moult closed 2 years ago
Note: further reading on the exact details of this proposal is documented by Ilkin here (though I have made some more adjustments since this PDF was written):
So after some discussion with @aothms and @TLiebich it seems as though taking a step back the fact that nobody in 15 years in the X3D world have really appreciated multitextures, and given that they haven't garnered interest in it, it is unlikely to provide much value in IFC. Also, once you start stacking nodes, there is a blurred line between usefulness and when node stacking becomes non-interoperable between rendering engines.
So as a result, I'd like to revise the proposal to follow the direction of X3D and glTF and remove the multitexture support. So no more blending modes. No more texture stacks. No more "list of 4 string parameters where you need to read the X3D spec that even X3D people never reads to fully understand". This will hopefully encourage implementers and not scare them by forcing them to read obscure X3D spec portions to understand blending modes and edge cases. The primary goal is to encourage implementers to build texture support.
Here is the revised proposal (note the original proposal 2 and 3 are now obsolete):
There are two proposals which solve the limitations of the current situation, and heavily simplify textures to follow the direction of X3D and glTF.
This existed in IFC2X3 and was removed for some reason. X3D v3.2 doesn't support texture maps but X3D v4 does. The solution is simple: convert the mode attribute into an attribute which designates which texture map type the IfcSurfaceTexture is part of. This solution is similar to the X3D v4 approach. The mode attribute will be chosen from the following list. Note that we have based the names off IFC2X3, but updated it to match X3D / glTF naming.
Map | PHONG | NOTDEFINED (Physcial) | FLAT (Unlit) |
---|---|---|---|
AMBIENT | Yes | No | No |
NORMAL (upgraded from BUMP) | Yes | Yes | No |
EMISSIVE (called SELFILLUMINATION in IFC2X3) | Yes | Yes | Yes |
METALLICROUGHNESS | No | Yes | No |
OCCLUSION | Yes | Yes | No |
SHININESS | Yes | No | No |
SPECULAR (called REFLECTION in IFC2X3) | Yes | No | No |
DIFFUSE (called TEXTURE in IFC2X3) | Yes | Yes | No |
For example:
#2=IfcImageTexture($,$,'DIFFUSE',$,$,'data/pattern.png')
This is the new description of the Mode attribute:
Mode shall hold the type of map this corresponds to, chosen from the following list: AMBIENT, NORMAL, EMISSIVE, METALLICROUGHNESS, OCCLUSION, SHININESS, SPECULAR, DIFFUSE. For more information on which texture maps apply in different lighting models refer to the X3D specification.
Multitexture support is previously implemented in IFC using the mode attribute and the parameter attribute. Simple solution: deprecate the Parameter attribute.
Also replace this sentence:
If multiple surface textures are included in the IfcSurfaceStyleWithTextures applying them to a geometric item, a mode and optional parameters can be included that blending operations.
... with ...
Only a single texture may be supplied per texture Mode type (DIFFUSE, SPECULAR, etc).
Marking as decided since this was already discussed without issues :)
Can we summarize the schema and doc changes that need to occur?
Note: related to #155. Textures affect the lighting model, so they must be read together.
Credits to Ilkin, mentored by Jakob Beetz, and Michalis from X3D who have helped research, implement, and come to this proposal. However, I have just typed out this proposal, and they have not yet read it yet so do not assume they support this just yet :)
Further reading: https://community.osarch.org/discussion/877/understanding-how-textures-and-shaders-work-in-ifc
Current situation
To our knowledge we're the first people not only to implement this in IFC... but also one of the few people who care about it in the X3D world. IFC seemed to have chosen one of the most obscure and buggily implemented aspects of the X3D spec to reference. That said, referencing X3D is awesome because they can do all the domain research and we can follow them. For example, X3D has since heavily simplified the texture systems to match the behaviour shown in glTF, so the current situation in IFC is already outdated, but we can catch up pretty quickly.
It's difficult to summarise the full extents of the technical implications of the current situation, but here's an attempt to put it into terms that most 3D artists would appreciate.
Proposal description
There are three proposals which solve the limitations of the current situation, shown in order of priority.
Proposal 1: add back texture maps types
This existed in IFC2X3 and was removed for some reason. X3D v3.2 doesn't support texture maps but X3D v4 does. The solution is simple: a fifth parameter is added to the Parameter attribute list designating which texture map type the IfcSurfaceTexture is part of. This solution is similar o the X3D v4 approach. The fifth parameter must include the type of texture map chosen from the following list. Note that we have based the names off IFC2X3, but updated it to match X3D / glTF naming.
For example:
This sentence needs to be added to the description of the Parameter attribute:
Proposal 2: Prevent buggy implementations by making blending and grayscale handling unambiguous and more intuitive
First, to fix the grayscale bug, a few lines need to be added below this existing documentation:
The lines to be added at the bottom are:
Now to fix the blending ambiguity, X3D modes used by IFC by default apply to all channels: RGBA. X3D lets you specify the blending mode separately for RGB and A. To fix the ambiguity, we should enforce the implementer to always specify the blending mode for RGB and A separately. To fix this, this description should be added to the "Mode" attribute of IfcSurfaceTexture:
For example:
Proposal 3: support modern blending modes
I assume most implementers would stick to a single image, because even in X3D it is a very niche topic and the consensus in X3D seems to be moving towards a simplified "single" texture input just like glTF, instead of stacks of blended textures.
However, given that the current scenario is referencing multitextures (i.e. blended stacks of textures) we could easily extend the list of modes. Some ones already exist, like MODULATE, and ADD, so here is a list that could be added:
See https://en.wikipedia.org/wiki/Blend_modes . Also any mode can have the suffix "FACTORALPHA" so that the blending may be applied with a user customised factor intensity. This is a feature artists would expect.
To include this in IFC4.3 it is as simple as adding to the "Mode" attribute description of IfcSurfaceTexture: