[x3d-public] [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

doug sanden highaspirations at hotmail.com
Fri Sep 9 07:19:37 PDT 2016


Hypothesis: the original intent in the specs was to have a cascade of fallbacks:
- if the image textures don't show up (perhaps can't be downloaded), then maybe there's CPV (color per vertex)
- if the browser can't do CPV, maybe there's diffuse color
-each fallback replacing the missing more advanced predecessor
And if all historical scenes are tuned to this fallback / REPLACE, then changing to MODULATE will make items darker.
Example: SharkLefty.x3d in KelpForest has all 3: texture, CPV and diffuseColor.
- using modulation, it comes out darker than pure texture
- so scenes would need to be re-tuned if the specs changed from REPLACE to MODULATE
- or MODULATE options would need to self-retune to lighten
- or MODULATE would need to be an advanced property for those that want to tune for it
-D


________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of doug sanden <highaspirations at hotmail.com>
Sent: August 26, 2016 10:13 AM
To: x3d-public at web3d.org
Subject: Re: [x3d-public] [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

Solution:
1) elliminate table 17-3
2) put post-table-17-2-modulation formula in its place:
ODrgb = Irgb x IDrgb
A = A x (1-TM)
-Doug
...
There were a few more entries that need fixing for post-17-3 modulation, in the no CPV column.
...
This still won't give full modulation ie Crgb x Trgb x IDrgb, rather, it will make more sense of the current specs.
________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of doug sanden <highaspirations at hotmail.com>
Sent: August 26, 2016 8:11 AM
To: x3d-public at web3d.org
Subject: Re: [x3d-public] [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

might be just one term in table 17-3 needs to change to get post-table modulation as per sentences.
And perhaps v3.4 or BrowserOption for FULL modulation.
-Doug

For proper post-table modulation, I think only one entry in 17-3 needs to change:
Post-Table modulation:
v channels    CPV                        noCPV
0 ODrgb = ICrgb                   ODrgb=  (1,1,1)* only change
0   A = (1-TM)                         A= (1-TM)
1 ODrgb = ICrgb                   ODrgb= IT
1  A = (1-TM)                          A= (1-TM)
2 ODrgb = ICrgb                   ODrgb= IT
2  A = (1-TM) x AT                   A = (1-TM) x AT
3 ODrgb = ICrgb                   ODrgb = ITrgb
3 A = (1-TM)                           A = (1-TM)
4 ODrgb = ICrgb                   ODrgb = ITrgb
4  A = (1-TM) x AT                    A = (1-TM) x AT
Then post-table modulation:
ODrgb = ODrgb x IDrgb

If textures from images with no alpha, have their alpha padded to 1.0, then post-table calculation of alpha:
A = Image ? (1-TM) x AT : (1-TM) x 1.0  //assumes no-alpha images are give alpha 1.0

========== FULL MODULATION OF CRGB ===============================
For post-table FULL MODULATION of CPV (color per vertex) -a change to web3d.org prescribed behaviour-
v channels    CPV                        noCPV
0 CDrgb = ICrgb                   TDrgb=  (1,1,1)* only change
1 CDrgb = ICrgb                   TDrgb= IT   //expand luminance to RGB = LLL
2 CDrgb = ICrgb                   TDrgb= IT  //expand luminance to RGB = LLL
3 CDrgb = ICrgb                   TDrgb = ITrgb
4 CDrgb = ICrgb                   TDrgb = ITrgb
Post-Table Modulation:
TDrgb *= IDrgb
ODrgb = CPV ? CDrgb x TDrgb : TDrgb
A = Image ? (1-TM) * AT : (1-TM) * 1.0  //assumes no-alpha images are give alpha 1.0

Or simplifying
Post-Table FULL modulation of TDrgb with ICrgb:
v channels  noCPV
0 TDrgb=  (1,1,1)* only change
1 TDrgb= IT //expand luminance to RGB = LLL
2 TDrgb= IT //expand luminance to RGB = LLL
3 TDrgb = ITrgb
4 TDrgb = ITrgb
Post-Table Modulation:
TDrgb *= IDrgb
ODrgb = CPV ? CDrgb x TDrgb : TDrgb
A = Image ? (1-TM) * AT : (1-TM) * 1.0  //assumes no-alpha images are give alpha 1.0

________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of doug sanden <highaspirations at hotmail.com>
Sent: August 24, 2016 1:23 PM
To: x3d-public at web3d.org
Subject: Re: [x3d-public] [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

This developer recommends further modulation than what I show in my table below:
https://sourceforge.net/p/freewrl/mailman/message/35292626/

________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of doug sanden <highaspirations at hotmail.com>
Sent: August 24, 2016 1:16 PM
To: x3d-public at web3d.org
Subject: Re: [x3d-public] [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

vivaty, freewrl v3 show just a background, because they modulate alpha.
octaga, instantReality, cortona, H3D show a sphere.
http://dug9.users.sourceforge.net/web3d/temp/29C_screenshots.png
-Doug
more....
The sphere has a texture. The texture has an alpha channel.
The sphere has a material. I set mat.transparency = 1.
Modulating alpha means alpha = AT*(1-TM)

There are a few sentences in the LightingOn section suggesting modulation. And other web3d browser developers recommend modulation - you get free features at no cost by doing that.

The problem: table 17-3 doesn't do in-table modulation, and the output of table 17-3 is not suitable for modulation.
For example, no CPV, no Texture, ODrgb = IDrgb (= mat.diffuse).
If we modulate the table output ODrgb with mat.diffuse, its ODrgb = ODrgb x IDrgb. But in the table ODrgb = IDrgb, so post-table modulation ODrgb = IDrgb x IDrgb or mat.diffuse * mat.diffuse.

Hypothesis: modulation sentences were added for version 3+ but table 17-3 was never updated to show in-table modulation, or to make the output suitable for modulation.
...

Here's what I think the table 17-3 should look like for in-table modulation:
v channels    CPV                        noCPV
0  ODrgb = ICrgb x IDrgb         ODrgb=  IDrgb
0   A = (1-TM)                         A= (1-TM)
1 ODrgb = ICrgb x IDrgb           ODrgb= IT x IDrgb
1  A = (1-TM)                          A= (1-TM)
2 ODrgb = ICrgb x IDrgb           ODrgb= IT x IDrgb
2  A = (1-TM) x AT                   A = (1-TM) x AT
3 ODrgb = ICrgb x IDrgb           ODrgb = ITrgb x IDrgb
3 A = (1-TM)                           A = (1-TM)
4 ODrgb = ICrgb x IDrgb            ODrgb = ITrgb x IDrgb
4  A = (1-TM) x AT                    A = (1-TM) x AT


________________________________________
From: Don Brutzman <brutzman at nps.edu>
Sent: August 24, 2016 11:03 AM
To: doug sanden
Cc: X3D Graphics public mailing list
Subject: Re: [x3d] Spec Comment by on 19775-1: Abstract X3D Definitions - V3.3: Material alpha modulation with Lighting on (Mantis 973)

Doug, again thanks for this response.

If you have some screenshots specifically illustrating the rendering differences that you are seeing between different browsers (i.e. for different lighting algorithms), that would be a helpful addition.


On 8/24/2016 9:35 AM, Don Brutzman wrote:
> Doug: thanks for this helpful specification comment.
>
> Roy has entered this topic as Mantis issue 973:
>
>     http://www.web3d.org/member-only/mantis/view.php?id=973
>
> Am moving this discussion to the x3d-public mailing list.  Additional insight is welcome.
>
>
> On 8/15/2016 9:56 AM, Spec Feedback wrote:
>> Comment on 19775-1: Abstract X3D Definitions - V3.3
>> 17.2.2.3
>> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/lighting.html#Lightingon
>>
>> -----------------
>> "The Material's transparency field modulates the alpha in the texture. Hence,
>> a transparency of 0 will result in an alpha equal to that of the texture. A
>> transparency of 1 will result in an alpha of 0 regardless of the value in the
>> texture."
>> That doesn't seem to me to be what browsers Octaga, InstantReality, or
>> Cortona are doing, and its not what table 17-3 and the Lighting equation say
>> is happening. In the table, alpha is never 'modulated' ie there's never an
>> alpha= AT * (1-TM)
>> - freewrl version 3 and vivaty do modulate.
>> The following 29C, 29D .wrl have texture alpha and material transparency=1,
>> show differently as noted above.
>> http://dug9.users.sourceforge.net/web3d/tests/DebateModulateAlpha.zip
>> or directly:
>> http://dug9.users.sourceforge.net/web3d/tests/29C.wrl
>> http://dug9.users.sourceforge.net/web3d/tests/29D.wrl
>>
>> -----------------
>>
>> Submitted on Monday, 2016,  August 15 - 9:56am
>> by  (Doug Sanden )
>> IP: 75.159.141.42
>>
>> See: http://www.web3d.org/node/1694/submission/895
>
> all the best, Don


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 http://faculty.nps.edu/brutzman

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org



More information about the x3d-public mailing list