upgrade Filament to v1.41
This commit is contained in:
@@ -430,8 +430,21 @@ constexpr TQuaternion<T> TMat33<T>::packTangentFrame(const TMat33<T>& m, size_t
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
} // namespace details
|
||||
|
||||
/**
|
||||
* Pre-scale a matrix m by the inverse of the largest scale factor to avoid large post-transform
|
||||
* magnitudes in the shader. This is useful for normal transformations, to avoid large
|
||||
* post-transform magnitudes in the shader, especially in the fragment shader, where we use
|
||||
* medium precision.
|
||||
*/
|
||||
template<typename T>
|
||||
constexpr details::TMat33<T> prescaleForNormals(const details::TMat33<T>& m) noexcept {
|
||||
return m * details::TMat33<T>(
|
||||
1.0 / std::sqrt(max(float3{length2(m[0]), length2(m[1]), length2(m[2])})));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
typedef details::TMat33<double> mat3;
|
||||
|
||||
Reference in New Issue
Block a user