<div dir="ltr"><div dir="ltr"><div><br></div><div>My experience implementing Material.xxxTextureMapping<br></div>Material.diffuseTextureMapping "C1T3"<div>TextureTransform.mapping "3"</div><div>TextureCoordinate "1"</div><div><br></div><div>I started with my usual confusion and followed with a few re-writes before I settled on 'combos': the texcoords the vertex shader now sends the frag shader is a combination of any of the shape's texturetransforms with any of the shape's texturecoordinates.</div><div>In gltf valances look like this:</div><div>texture m:1 texcoord   many textures can refer to the same texcoord, each texture refers to one texcoord</div><div>texture 1:(0,1) textrans - a texture may have one texture transform. A texture transform belongs to one texture (its duplicated for each texture that needs it)</div><div>When converting to x3d I decouple the texture transform and for fun compare to already existing texture transforms in the shape to reduce duplicates. Then for the texture I assign "C0" or "C1" up to "C3" for the .xxxTextureMapping string, and if the Texture has textureTransform I append "T0" uo to "T9"  to the mapping string.</div><div>During shape rendering, I detect if the xxxTextureMapping string has that pattern and if so split it to get the separate texcoord "0" to "3" .mapping string and the "0" to "9" textrans mapping string. I look up in a icombo[10][2] array if I already have that combination, and if not add it, and then assign the icombo index to the texture for sending to the frag shader, and send the icombo array to the vertex shader to make the combos and send in order of icombo array to the frag shader as transformed texcoords.</div><div>I don't know how common it is for an artist and authoring tools to have gotten creative with both texcoords and textrans for a given texture. The above technique thunks to the as-written spec when no Cn or Tn detected.</div><div>-Doug</div><div><br></div></div></div>