#X3D V3.0 utf8 PROFILE Interchange COMPONENT Texturing:3 # Test of multitexturing MODULATE and ADD modes used together. # It shows that the order of operations matters (for some cases). # # From left to right: # 1. yellowish material * squirrel texture # 2. yellowish material * bricks texture # 3. yellowish material * squirrel texture + bricks texture # 4. yellowish material * bricks texture + squirrel texture # # Notice how 3. and 4. are different --- order matters! # # "yellowish material" above means actually # "X3D yellowish material combined with lighting". # A nice test is to disable headlight (Ctrl + H in view3dscene). # If the X3D implementation calculates the lighting before texturing # (which is always true for Gouraud shading), then turning headlight off # should make the lighting result black, which should result in: # # From left to right: # 1. black # 2. black # 3. black + bricks texture = just bricks texture # 4. black + squirrel texture = just squirrel texture # NavigationInfo { headlight FALSE } Transform { children Shape { appearance Appearance { material Material { diffuseColor 1 1 0 } texture DEF I1 ImageTexture { url "data/squirrel.png" } } geometry Box { } } } Transform { translation 3 0 0 children Shape { appearance Appearance { material Material { diffuseColor 1 1 0 } texture DEF I2 ImageTexture { url "data/bricks.jpg" } } geometry Box { } } } Transform { translation 6 0 0 children Shape { appearance Appearance { material Material { diffuseColor 1 1 0 } texture MultiTexture { texture [ USE I1 USE I2 ] mode [ "MODULATE", "ADD" ] } } geometry Box { } } } Transform { translation 9 0 0 children Shape { appearance Appearance { material Material { diffuseColor 1 1 0 } texture MultiTexture { texture [ USE I2 USE I1 ] mode [ "MODULATE", "ADD" ] } } geometry Box { } } } # Viewpoint ------------------------------------------------------------------ # Camera settings "encoded" in the VRML/X3D declaration below : # direction 0 0 -1 # up 0 1 0 # gravityUp 0 1 0 Viewpoint { position 4.5 0 12.499993324279785 orientation 0 0 1 0 }