Skip to content

InstancedMesh: Tangents are not transformed by instance matrices #27116

@gkjohnson

Description

@gkjohnson

Description

When adding batching shading I noticed that the tangent seemed to not be transformed by the instance matrix - is this a bug?

#ifdef USE_TANGENT
vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif

Reproduction steps

Issue found by looking at shader code.

Code

From defaultnormal_vertex.glsl.js:

#ifdef USE_TANGENT

	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;

	#ifdef FLIP_SIDED

		transformedTangent = - transformedTangent;

	#endif

#endif

Live example

Issue found by looking at shader code.

Screenshots

No response

Version

dev

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions