stuff
This commit is contained in:
15
modules/wallpaper-engine/shaders/common_vertex.h
Normal file
15
modules/wallpaper-engine/shaders/common_vertex.h
Normal file
@@ -0,0 +1,15 @@
|
||||
mat3 BuildTangentSpace(const vec3 normal, const vec4 signedTangent)
|
||||
{
|
||||
vec3 tangent = signedTangent.xyz;
|
||||
vec3 bitangent = cross(normal, tangent) * signedTangent.w;
|
||||
return mat3(tangent, bitangent, normal);
|
||||
}
|
||||
|
||||
mat3 BuildTangentSpace(const mat3 modelTransform, const vec3 normal, const vec4 signedTangent)
|
||||
{
|
||||
vec3 tangent = signedTangent.xyz;
|
||||
vec3 bitangent = cross(normal, tangent) * signedTangent.w;
|
||||
return mat3(mul(tangent, modelTransform),
|
||||
mul(bitangent, modelTransform),
|
||||
mul(normal, modelTransform));
|
||||
}
|
||||
Reference in New Issue
Block a user