Re: [osg-users] Mipmapping for downsampling

2012-09-28 Thread Sergey Polischuk
Hi looks like you was hitting NaN's somewhere, as they propagate in such fashion. Cheers. 28.09.2012, 18:11, "Kenzo Lespagnol" : > Hi Sebastian, > > Ok, I've displayed the different mipmap in my application and I realized that > a black square is propagated along the different mipmap level (see

Re: [osg-users] Mipmapping for downsampling

2012-09-28 Thread Kenzo Lespagnol
Hi Sebastian, Ok, I've displayed the different mipmap in my application and I realized that a black square is propagated along the different mipmap level (see pictures). Finally the last level became completely black. We solved the problem by changing the model involved. Thanks for the preciou

Re: [osg-users] Mipmapping for downsampling

2012-09-26 Thread Sebastian Messerschmidt
Okay, one last try: 1. Have you tried showing the last mip-level (i.e. avg. lum) in a separate window so you can check the value? 2. Have you double checked your actual tone-mapping? (say by providing the average luminance via uniform)? I'm asking this rather silly questions, because last tim

Re: [osg-users] Mipmapping for downsampling

2012-09-26 Thread Kenzo Lespagnol
Thank you Sebastian for your support. I appreciate it. > More or less. I don't know the exact wording from the specification, but > the mipmapping should actually do a bilinear interpolation for 4 > neighbouring texels per mip level. I've found many examples that used > the last LOD for averag

Re: [osg-users] Mipmapping for downsampling

2012-09-26 Thread Sebastian Messerschmidt
Am 26.09.2012 17:27, schrieb Kenzo Lespagnol: Hi Sebastian, I've followed your advice, but I've still the issue. So it's seems I'm using a wrong way to generate my mipmaps. Is hardware mipmap generation actually average the values between the different mipmap levels? More or less. I don't know

Re: [osg-users] Mipmapping for downsampling

2012-09-26 Thread Kenzo Lespagnol
Hi Sebastian, I've followed your advice, but I've still the issue. So it's seems I'm using a wrong way to generate my mipmaps. Is hardware mipmap generation actually average the values between the different mipmap levels? Code: logAveragedLumTexture->setUseHardwareMipMapGeneration(true); logAv

Re: [osg-users] Mipmapping for downsampling

2012-09-25 Thread Sebastian Messerschmidt
Hi Kenzo. I think you are misinterpreting the last argument to the textureLod, which is an offset IIRC. I use the following to sample the last level (which is 1 px and gives you exactly the average): exp(texture2DLod(LuminanceSampler, vec2(0.5,0.5), 1000.0)); cheers Sebastian Hi,

Re: [osg-users] Mipmapping for downsampling

2012-09-25 Thread Kenzo Lespagnol
Hi, I've managed to generate my mipmap via the hardware. But I'm guessing I don't have the good mipmap as the result of my tone mapping is unstable. The screen is brighter in a jerky manner for some position of the camera. As below, how to create my mipmap: Code: osg::ref_ptr tex2D = dynami

[osg-users] Mipmapping for downsampling

2012-09-25 Thread Kenzo Lespagnol
Hi, I'm currently implementing my own global tone mapping (without osgPPU). As a first iteration, I'm averaging the luminance by using hardware mipmap generation. Then I'm wondering if there is a mean to retrieve the last level of mipmapping from a osg::Texture? Is someone have a useful link I