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

2018-02-20 Thread antiro black
Hi Robertos, setting "texture->setResizeNonPowerOfTwoHint(false);" fixed the problem After being stuck on this problem for more than a week I can safely say that I would never have found that without your help. I checked the data after generating the image at which point it was still OK,

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

2018-02-20 Thread Robert Osfield
HI Antiro, Thanks for the code example. I don't have the time to test right away. A quick code review and I spotted that the image is 10x10 which will be rescalled to nearest power of two with the default construction of osg::Texture2D. Most modern hardware supports non power of two textures

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

2018-02-20 Thread antiro black
Hi, I made an executable example based on the osgtexture2D example. I removed the code to render the different walls of the cube with the exception of the filter wall. I kept the rest as close to the original as possible. changes to the code have been marked using comments. Essentially all

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

2018-02-20 Thread Robert Osfield
Hi Antiro, Without screenshots and a working example that illustrates what you think is a problem there isn't much we can do to help you. Filtering has worked from the very early days of the OSG, it's not something that is known to be problematic, you just set the filter values and you're done.

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

2018-02-20 Thread antiro black
Hi, As far as I can tell it does not seem to be rendering related, the shader is really sampling data from the texture that was never in the original image. A summary of my experiments: Input is an image which is half red (255,0,0) and half black (0,0,0) and it is set as a texture for the

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

2018-02-19 Thread Lionel Lagarde
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

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

2018-02-19 Thread antiro black
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

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

2018-02-12 Thread Robert Osfield
HI Antiro, You code looks fine, there isn't anything else you need to do to set up filter modes. I haven't heard of issues with setting the filter modes so would expect it to work. Perhaps what is amiss is either something higher up - such as the texture not being used in the subgraph that you

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

2018-02-11 Thread antiro black
Hi, I'm trying to use a texture to get some data to a shader. The texure is created by first creating an osg::Image, setting its pixel values manually and then assigning the image to a texture. I have verified that the image is created correctly by writing it to a file. As for the actual