Jump to content

Edges on transparent texture


ozRocker
 Share

Recommended Posts

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".

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...