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

Color blend mode support for vertex shaders #5874

Closed
wants to merge 6 commits into from

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Oct 2, 2017

Adds support for tileset.colorBlendMode of REPLACE or MIX when the diffuse uniform marked with the _3DTILESDIFFUSE semantic is used in the vertex shader. The common case where this happens is if the vertex shader uses a color lookup table. Another case is vertex colors, which isn't supported right now but I think it's just a matter of tweaking a regex.

TODO

  • Work with vertex color attribute
  • Tests, especially changing the color blend mode dynamically.

@cesium-concierge
Copy link

@lilleyse, thanks for the pull request! Maintainers, we have a signed CLA from @lilleyse, so you can review this at any time.

I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.

I am a bot who helps you make Cesium awesome! Thanks again.

@@ -943,19 +960,29 @@ define([
// Replace: tile_colorBlend is 1.0 and the tile color is used
// Mix: tile_colorBlend is between 0.0 and 1.0, causing the source color and tile color to mix
var finalDiffuseFunction =
'bool isWhite(vec3 color) \n' +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because I noticed the == vec3(1.0) was too exact and started causing lots of aliasing on my desktop.

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 3, 2017

Thanks for the quick tunraround. Code looks OK at quick glance.

Bump when ready for @bagnell to review.

@pjcozzi pjcozzi requested a review from bagnell October 3, 2017 11:24
@lilleyse lilleyse force-pushed the color-blend-mode-doc branch from 879affb to 3c80aff Compare October 3, 2017 14:09
@@ -52,6 +56,7 @@ Change Log
* Added `customTags` property to the UrlTemplateImageryProvider to allow custom keywords in the template URL. [#5696](https://github.com/AnalyticalGraphicsInc/cesium/pull/5696)
* Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/AnalyticalGraphicsInc/cesium/pull/5917)
* Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754)
>>>>>>> master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A diff marker slipped through here.

@lilleyse
Copy link
Contributor Author

All these changes are now in #6089

@lilleyse lilleyse closed this Jan 10, 2018
@lilleyse lilleyse deleted the color-blend-mode-doc branch January 10, 2018 05:17
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

Successfully merging this pull request may close these issues.

4 participants