December 12, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Trombley | GIMP 2.9, that is. |
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Trombley | On Tuesday, 12 December 2017 at 23:28:23 UTC, Ivan Trombley wrote:
> Here's the code that produces the correct results (exactly the same as GIMP):
Share images you used, please.
|
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry | On Wednesday, 13 December 2017 at 01:44:33 UTC, Dmitry wrote: > On Tuesday, 12 December 2017 at 23:28:23 UTC, Ivan Trombley wrote: >> Here's the code that produces the correct results (exactly the same as GIMP): > Share images you used, please. Background image: http://a4.pbase.com/o10/09/605909/1/166706859.XKZZCnSO.background.png Foreground image: http://a4.pbase.com/o10/09/605909/1/166706860.c1yD4VWp.image.png Composited through SDL: http://a4.pbase.com/o10/09/605909/1/166706869.wLt9RofY.sdl.png Composited in GIMP 2.9: http://a4.pbase.com/o10/09/605909/1/166706870.S01BIhVG.gimp.png When composited using the code I posted looks exactly like the GIMP 2.9 image. |
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Trombley | Here's a page that describes the issue: http://ssp.impulsetrain.com/gamma-premult.html |
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Trombley | On Wednesday, 13 December 2017 at 03:03:09 UTC, Ivan Trombley wrote:
> Foreground image:
> http://a4.pbase.com/o10/09/605909/1/166706860.c1yD4VWp.image.png
Okay, I see. With this image it's obvious that it's not a just blending problem. But previous was look exactly as blending problem. Sorry that took your time.
|
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Trombley | Dne 13.12.2017 v 4:03 Ivan Trombley via Digitalmars-d napsal(a):
> On Wednesday, 13 December 2017 at 01:44:33 UTC, Dmitry wrote:
>> On Tuesday, 12 December 2017 at 23:28:23 UTC, Ivan Trombley wrote:
>>> Here's the code that produces the correct results (exactly the same
>>> as GIMP):
>> Share images you used, please.
>
> Background image: http://a4.pbase.com/o10/09/605909/1/166706859.XKZZCnSO.background.png
>
> Foreground image: http://a4.pbase.com/o10/09/605909/1/166706860.c1yD4VWp.image.png
>
> Composited through SDL: http://a4.pbase.com/o10/09/605909/1/166706869.wLt9RofY.sdl.png
>
> Composited in GIMP 2.9: http://a4.pbase.com/o10/09/605909/1/166706870.S01BIhVG.gimp.png
>
> When composited using the code I posted looks exactly like the GIMP 2.9 image.
I am not sure, about the tool you use to view the images, but on my side (Firefox browser) the sdl and gimp output are very different. Maybe some gamma shenanigans going on? Maybe related to PNG Gamma correction...
|
December 13, 2017 Re: SDL2 texture blend help | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Drašar | On Wednesday, 13 December 2017 at 13:54:28 UTC, Martin Drašar wrote:
> Dne 13.12.2017 v 4:03 Ivan Trombley via Digitalmars-d napsal(a):
>> On Wednesday, 13 December 2017 at 01:44:33 UTC, Dmitry wrote:
>>> On Tuesday, 12 December 2017 at 23:28:23 UTC, Ivan Trombley wrote:
>>>> Here's the code that produces the correct results (exactly the same
>>>> as GIMP):
>>> Share images you used, please.
>>
>> Background image: http://a4.pbase.com/o10/09/605909/1/166706859.XKZZCnSO.background.png
>>
>> Foreground image: http://a4.pbase.com/o10/09/605909/1/166706860.c1yD4VWp.image.png
>>
>> Composited through SDL: http://a4.pbase.com/o10/09/605909/1/166706869.wLt9RofY.sdl.png
>>
>> Composited in GIMP 2.9: http://a4.pbase.com/o10/09/605909/1/166706870.S01BIhVG.gimp.png
>>
>> When composited using the code I posted looks exactly like the GIMP 2.9 image.
>
> I am not sure, about the tool you use to view the images, but on my side (Firefox browser) the sdl and gimp output are very different. Maybe some gamma shenanigans going on? Maybe related to PNG Gamma correction...
Gamma is exactly the problem. A page back I posted some code that will overlay the image onto the background by converting the source and destination pixels to linear RGB, compositing them and then converting the final pixel back to sRGB for display. That code produces the same results as GIMP. Now I just need to figure out how to make GL_FRAMEBUFFER_SRGB (which is supposed to do the right thing in the GPU) work with SDL.
|
Copyright © 1999-2021 by the D Language Foundation