[GEM-dev] gemframebuffer flood

cyrille henry ch at chnry.net
Wed Oct 26 11:39:40 CEST 2011


i forget an other solution not to have the problem with repeated texture. since you use shader, you can insert somthing like :
texture_position.x = max(1./(2.xframebuffersize));
texture_position.x = min(1. - 1./(2.xframebuffersize));
...

c



Le 26/10/2011 10:31, cyrille henry a écrit :
> hello Guido,
>
> i investigated your patch and have a few comments.
>
> - in "rectangle 1" mode, the repeat message is useless. this was confirmed yesterday by Iohannes, as an openGL limitation.
> - i don't have the same problem of black border. could you try using texture size of 512 better than 500 and tell us if it make a difference?
> - i have the same problem about the overlap from one side to the other. but it's not a 1 pixel bar, it's smaller. you can noticed when changing the size of the "square 3.9" that it can disappear.
> in fact, after investigation, i don't think this is a bug.
> imagine a 10 pixels size frambuffer. in rectangle mode, coordinate goes from 0 to 1. so 1st pixel coordinate goes from 0 to 0.1, 2nd pixel goes from 0.1 to 0.2 etc.
> so 1st pixel center is at 0.05 and 2nd pixel center is at 0.15
> when rendering in gl_linear, you interpolate between pixels. so reading texture at position 0.05 gives exactly the color of the 1st pixel.
> but reading at 0.1 gives a mix between 1st and 2nd pixel.
> now, if you have to read at position 0.01, then, you also have to interpolate. between 1st pixel at position 0.05, and previous pixel. this previous pixel can be the same as the 1st one in "repeat 0" mode, or the same as the last pixel of the texture (position 0.95) in "repeat 1" mode.
>
> So, if you have to interpolate the framebuffer texture when rendering, you may have small artefact on the border.
>
> the key not to have this problem should be :
> - use "rectangle 0" mode. this works for me, but it look like your experiencing an other problem
> - in "rectangle 1" mode, do not interpolate the framebuffer image. This can be done in different way :
> - using "quality 0" mode
> - using the pixel size that fit the rendering size : if you render in a 500 x 500 window, then use a 500 x 500 framebuffer size to render on a "square 4". if you wish to render the image on a square 3.9, then the pixel size of this square should be 500 x 3.9 / 4 = 487.5
> since you can't have half pixel, just use 487.5 x 2 = 975.
> you will not interpolate between pixels any-more...
>
>
> hope that help
> Cyrille
>
>
>
>
> Le 25/10/2011 15:46, Guido Tamino a écrit :
>> Thanks for getting back to me so quickly.
>>
>>> @guido: is that what you mean? -> http://iem.at/~zmoelnig/GEM/blur.png
>>
>> Not really, it looks like [gemframebuffer] has a weird black pixel border all around the edges.
>> http://img717.imageshack.us/img717/8998/osxfastblur.jpg
>>
>> This has something to do with osx, please see the patch attached.
>> http://www.mediafire.com/?tw3jb9o0ac9fq6i
>>
>> Best,
>> Guido
>>
>>
>>
>> _______________________________________________
>> GEM-dev mailing list
>> GEM-dev at iem.at
>> http://lists.puredata.info/listinfo/gem-dev
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
>



More information about the GEM-dev mailing list