playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
20 lines (19 loc) • 501 B
JavaScript
var particle_TBN_default = `
let rot3 = mat3x3f(
vec3f(rotMatrix[0][0], rotMatrix[1][0], 0.0),
vec3f(rotMatrix[0][1], rotMatrix[1][1], 0.0),
vec3f(0.0, 0.0, 1.0)
);
let viewBasis = mat3x3f(
-uniform.matrix_viewInverse[0].xyz,
-uniform.matrix_viewInverse[1].xyz,
uniform.matrix_viewInverse[2].xyz
);
let tempMat = viewBasis * rot3;
output.ParticleMat0 = tempMat[0];
output.ParticleMat1 = tempMat[1];
output.ParticleMat2 = tempMat[2];
`;
export {
particle_TBN_default as default
};