ozRocker Posted June 3, 2017 Share Posted June 3, 2017 Does anyone know why the edges of my transparent texture have red lines on it? Is there a way to prevent it from happening? https://www.babylonjs-playground.com/#YTHP9D Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 3, 2017 Share Posted June 3, 2017 Just wrap your texture using clamp https://www.babylonjs-playground.com/#YTHP9D#1 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted June 4, 2017 Author Share Posted June 4, 2017 7 hours ago, Deltakosh said: Just wrap your texture using clamp https://www.babylonjs-playground.com/#YTHP9D#1 Thank you!! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 4, 2017 Share Posted June 4, 2017 Weird solution. (Wingy checks texture transparent pixel @ 0, 0 [lower left corner] to see if a mosquito turd got jammed in there.) I wonder why this texture needs wrap-clamping. hmm. Oh, it was upside-down. THAT's why it needed... errr... no. *scratch scratch* It's because pixel 0,0 is transparent. It's fooling some BJS code somewhere, I bet. (Wingy activates his SUPER-DOOPER electron microscope, and examines some shader code. It causes him pink-eye.) I dunno. Something smells fishy, here. How 'bout you, Oz? Are you going to swallow this solution without coughing-up a yak hairball? (without wondering "what the heck?") Things that make ya go "hmm". Gijs 1 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted June 4, 2017 Author Share Posted June 4, 2017 24 minutes ago, Wingnut said: I dunno. Something smells fishy, here. How 'bout you, Oz? Are you going to swallow this solution without coughing-up a yak hairball? (without wondering "what the heck?") Things that make ya go "hmm". I will gladly swallow this solution without question Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 4, 2017 Share Posted June 4, 2017 It is not "fishy" Here is the explanation: pixels on the edge will have an uv of 0,0 (or 0,1 on the bottom). BUT we are using linear filtering which means that more than one texel is read from the texture. Let's just suppose the bilinear uses a box approach. for uv = 0,0 it will actually read 0,0 and -epsilon, 0 and +epsilon,0 and so on.. If wrap is enabled the -epsilon will be converted to 0.99999 so it will capture a bit of red. Does it make sense? Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 4, 2017 Share Posted June 4, 2017 ah ha!!! hehe. Thx dk! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.