Closed davideGiovannini closed 2 years ago
This seems like a good thing to add :+1: The only thing I'm not sure about is the naming of BlendModeCustomParam
(feels a bit overly wordy) - I'll have a look at what other frameworks call that.
I think in 0.7 it might make sense to just have one 'BlendMode' struct with these fields, and then make stuff like BlendMode::Add
a constant/function that returns a preset? That way there's not two ways of doing the same thing.
It's also worth noting that this is technically a breaking change, due to #276 - that said, I think it's fairly unlikely to cause issues in practice. I do have quite a few breaking changes/deprecations building up in my backlog though, so maybe I should just do a 0.7 soon anyway? I'll give that some thought, don't think it'll block this either way 🙂
BlendModeCustomParam (feels a bit overly wordy)
100% agree, it was the first thing I could think of and forgot to change.
Maybe BlendModeMultiplier
or BlendModeFactor
?
BlendFactor
is what other graphics APIs (and the OpenGL spec) seem to call it (I think we can leave mode
out of the name). Similarly, BlendEquation
or BlendOperation
seems to be the common name for what we currently have as BlendModeEquation
.
I got completely nerd sniped by this PR and ended up implementing the new blending API I had in mind for 0.7 😅
It's on the 0.7
branch now, if you want to use it/cherry pick onto your own fork. Let me know if you have any feedback or if there's any bits that don't work for your use case :)
I got completely nerd sniped by this PR and ended up implementing the new blending API I had in mind for 0.7 sweat_smile
It's on the
0.7
branch now, if you want to use it/cherry pick onto your own fork. Let me know if you have any feedback or if there's any bits that don't work for your use case :)
Just tried it out, everything seems to be working :+1:
Thanks :smile:
No problem - thank you for finally forcing me to learn how blending works 😆
I am using a texture to store lighting information (like in this article) in each RGBA channel and in order to write/erase light I need two custom blendmodes.