提交 c7f8f3d1 编写于 作者: S sunag

invert S, T when the UV direction is backwards

上级 6f63ebba
......@@ -49,7 +49,7 @@ NormalMapNode.Nodes = ( function () {
// Workaround for Adreno GPUs gl_FrontFacing bug. See #15850 and #10331
// http://hacksoflife.blogspot.com/2009/11/per-pixel-tangent-space-normal-mapping.html?showComment=1522254677437#c5087545147696715943
vec3 NfromST = cross( S, T );
if( dot( NfromST, N ) > 0.0 ) {
if( dot( NfromST, N ) < 0.0 ) {
S *= -1.0;
T *= -1.0;
......
......@@ -41,7 +41,7 @@ export default /* glsl */`
// Workaround for Adreno GPUs gl_FrontFacing bug. See #15850 and #10331
// http://hacksoflife.blogspot.com/2009/11/per-pixel-tangent-space-normal-mapping.html?showComment=1522254677437#c5087545147696715943
vec3 NfromST = cross( S, T );
if( dot( NfromST, N ) > 0.0 ) {
if( dot( NfromST, N ) < 0.0 ) {
S *= -1.0;
T *= -1.0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册