Closed xtassin closed 1 year ago
Thanks for the report @xtassin.
@jjhembd Could you please triage this issue?
Hi @xtassin, it is correct for the glTF to have tangents of type VEC4. This is mentioned in the spec, where the description of the tangent reads:
XYZW vertex tangents where the XYZ portion is normalized, and the W component is a sign value (-1 or +1) indicating handedness of the tangent basis
However, within CesiumJS, we store the 'handedness' separately, and use it to compute a 'bitangent'. So in the shader, fsInput.attributes.tangentEC
should always be a vec3
.
If you access it as a vec3
, does the error go away?
If there is still a problem, please share a Sandcastle link showing how you are using the tangent, so we can debug further.
The simple mention of fsInput.attributes.tangentEC in my custom shader generates the following exception:
The attached GLTF model:
ERROR: 0:63: 'w' : vector field selection out of range
cube.zip