Car color switch

HI.How to realize the change of car color from one end to the other.Like this case
https://www.genesis.com/us/en/2021/genesis-g70.html/#/car-configurator/G70_2021 . And their color buttons are cool.I want to do the same function. Who can help me.Thanks

Hi @as88,

Indeed it’s a cool effect!

For that you will need a custom shader that mixes the two colors based on UV coordinates that change over time.

Here is a tutorial on how to make a color transition in a shader, not exactly what you are looking for, but it can be a starting point:

https://developer.playcanvas.com/en/tutorials/custom-shaders/

Well, thank you

Just as a heads up, I did the same thing on the product configurator I was working on. It would switch diffuse materials using 2 spheres that would grow in size give a “splash” transition. It looked pretty cool, but ran into issues with iphones having some hard limits on how many textures could be loaded into frag shaders. (My frag shader would have two texture assets loaded at once). So, if you’re building for iphone usage, be sure to periodically check how it runs. I’m sure it could still be done without issue depending on your scene, it’s just an issue you may run into.

2 Likes