Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: transparency support #17

Open
noerw opened this issue Jan 1, 2021 · 9 comments
Open

FR: transparency support #17

noerw opened this issue Jan 1, 2021 · 9 comments

Comments

@noerw
Copy link

noerw commented Jan 1, 2021

The framebuffer does not apply transparency correctly. It seems alpha values other than 0 are ignored?

See this comparison between shoreline (top) and pixelnuke (bottom) with similar inputs:

Screenshot from 2021-01-01 05-11-23 Screenshot from 2021-01-01 05-08-55

Thanks for this amazingly fast toy <3

@TobleMiner
Copy link
Owner

TobleMiner commented Jan 1, 2021

Yes, there is no full transparency support. However, at the time of implementation that was a contious decision to keep performance as high as possible. I could implement full transparency support as an optional feature, that needs to be enabled/disabled at compile time though. Would that be fine with you?

@noerw
Copy link
Author

noerw commented Jan 1, 2021

Yeah, that sounds perfect! I just looked at the code, it'll be interesting to see the performance difference

@TobleMiner
Copy link
Owner

Please have a look at https:/TobleMiner/shoreline/tree/feature-alpha-blending

I'm not sure whether or not that is waht exactly you are looking for. Please let me know if it's ok or not.

@TobleMiner
Copy link
Owner

I've just updated the branch again. Now transparent colors can also be composed ontop of one another

@noerw
Copy link
Author

noerw commented Jan 2, 2021

Thanks, that was quick!

Looks good so far. Just a minor thing: There is some flickering going on now on some pixels, when no data is coming in:
Peek 2021-01-02 04-53
First thought was that this might be because of -Ofast / -ffast-math, but compiling without this option gives the same results.
If you think it's related to specific input data, I can test with other inputs.
edit: or is this #2?

Regarding performance: a standard build with SDL frontend peaks at 6.2 Gb/s on my laptop. With ALPHA_BLENDING it peaks at 5.4 Gb/s., so ~12% perf is lost.

@TobleMiner
Copy link
Owner

TobleMiner commented Jan 3, 2021

Cool! The flickering is interesting. Right now I'm not entirely sure where it is coming from. Would you mind providing me with the picture you are using for testing? That could make replicating the issue a lot easier.

I'm pretty sure it is not #2, that should be strictly a performance thing. The issue you are seeing might also be related to the coalescing mechanism though.

@noerw
Copy link
Author

noerw commented Jan 3, 2021

to reproduce:

git clone https:/speckij/hochwasser -b new-rgbsplit
cd hochwasser
go build .
wget https://nroo.de/pixelflut/pro_aktion.png
(sleep 0.2; echo 'rgbsplit' ) | ./hochwasser -image pro_aktion.png -order shuffle

@TobleMiner
Copy link
Owner

Sorry for the delay. 5a0bcb9 should address the flickering you were seeing

@noerw
Copy link
Author

noerw commented Apr 25, 2021

Just came back to this; your last commit fixed the flickering :) Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants