Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: Interpolation with alpha during texture sampling

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2011
    Posts
    9

    Interpolation with alpha during texture sampling

    My problem is best explained with a picture:
    Click image for larger version. 

Name:	sampling.jpg 
Views:	98 
Size:	14.3 KB 
ID:	884

    By default OpenGL interpolates all four texture channels, which is why the sampled value gets darker. I'm wondering if there is an automatic way to weigh the interpolated color value based on the alpha. So if the left square is (0,0,0,.25) and the right square is (1,0,0,1), the sampled value between the two texels should be (((0,0,0)*.25 + (1,0,0)*1)/(.25+1), (.25+1)/2) = (.8, 0, 0, .625).
    Last edited by Petwoip; 10-14-2012 at 07:59 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •