[osg-users] problem setting texture min/mag filter

Lionel Lagarde lionel.lagarde at oktal-se.fr
Mon Feb 19 06:48:44 PST 2018


Hi,

The half red half black pixels may come from some kind of anti-aliasing. 
Check your frame buffer settings.

My 2 cents.


On 19/02/2018 15:18, antiro black wrote:
> Hi,
>
> Thank you for response robertos, I've been playing around with the code the last few days and it seems like the filters are doing something, it is just not what I expected. I'm wondering if I misinterpreted the meaning of a "NEAREST" filter.
>
> As I understand it, putting both the min and mag filters on nearest means that, when sampling a location on your texture it will return the color of the nearest pixel. In other words: you will always get a value back that is present in the pixeldata from the image.
>
> However, as far as I can see from my test, this is not the case: I created an image with red pixels on one half (255,0,0) and black pixels on the other half (0,0,0).  When sampling the texture to which this image was set and simply drawing the sampled values onto a bigger texture for debugging purposes, I see a red half, a black half and a line of dark red "pixels" separating them. As if the values have been interpolated when sampling.
> If i turn off the "nearest" filters this line becomes a gradient, so clearly the filtering is doing something.
>
> Am I just completely misinterpreting the intended behavior of the "nearest" filters? or is there something wrong in the implementation?
>
> Thank you!
>
> Cheers,
> antiro
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72964#72964
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list