CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.99k stars 3.5k forks source link

Expose a way to set blend modes with public API #7203

Open OmarShehata opened 6 years ago

OmarShehata commented 6 years ago

Currently, I don't think there's a way to set a blend mode without knowing something about the private API.

BlendingState says it's a helper for custom render states, but renderState is private.

It's come up on the forum here and here.

We can either document the current way, or come up with a way to set blend modes, maybe even on the Entity layer?

hpinkos commented 6 years ago

@OmarShehata it sounds like both of those forum issues could be fixed by passing in orderIndependentTranslucency: false. Is there a different issue here that I'm missing?

OmarShehata commented 6 years ago

I'm not sure how that helps? For example, the last poster before me in the second thread is trying to creating an alpha blending mode to overwrite alpha instead of add, so that in this example, the ten overlapped blue polygons would still have an alpha of 0.1 instead of the alpha growing like it does:

Sandcastle

Maybe you want to define other custom blend functions. There's a lot you can do there if this was easy to set.

hpinkos commented 6 years ago

Oh okay, thanks for the extra explanation

nitzanmo commented 5 years ago

Hello, I'm experiencing the same issue.

Is the solution still in development? Thanks!

OmarShehata commented 5 years ago

@nitzanmo no one is actively working on this at the moment. Can you tell us a bit about your use case/what you're trying to do with blend modes? That helps us inform design decisions when we/other community members develop a feature.

nitzanmo commented 5 years ago

Sure, no problem. I've mentioned it all in this issue : #7541

Thanks!

nitzanmo commented 5 years ago

So as I've mentioned in #7541 , we need a way to customize the blending options in EllipseGraphics.

TY!

OmarShehata commented 5 years ago

Thanks for bumping this @nitzanmo . If you have a chance, opening a pull request to add this feature I think would help a lot!