pichou Posted November 27, 2017 Share Posted November 27, 2017 Hey everyone! Is there a way to add a smooth transition when changing the material of a mesh? Thanks, Pichou Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 27, 2017 Share Posted November 27, 2017 Not Built in. You could dupplicate the meshes and play with opacity but can be weird else you could animate to black and back from black to the new mat to ease the transition, but this is a pretty nice idea. pichou and NasimiAsl 1 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 29, 2017 Share Posted November 29, 2017 Or, if only textures were changes, using the different UV definitions possible, and updating the UV coordinates, but programmatically. Dunno if it makes sense... Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 29, 2017 Share Posted November 29, 2017 https://www.babylonjs-playground.com/#4F54K3#2 I HAD TO try one. Using cloning/opacity method, as Sebastian described. This still has a little problem at the end of the animation for the 2nd click. Copying actionManagers from source mesh to cloned mesh... probably not the best idea. Still fun and demented. I probably should have used interpolateValueAction (auto-animate) instead-of executeCodeAction and create&Start's. *shrug* Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 29, 2017 Share Posted November 29, 2017 I wounder if I could make a shader that takes the values of two standardMaterials and has a uniform to blend between the two. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 29, 2017 Share Posted November 29, 2017 the safest would be in 2 render pass with blend and only at zequal with constant blend values but still the cache would need to handle 2 materials. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
pichou Posted November 29, 2017 Author Share Posted November 29, 2017 Thanks guys! I don't understand everything you suggest but I have several possibilities now! I think playing with the UV parameters would be the more simple way to do it but not the most beautiful/clean. Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 18, 2018 Share Posted January 18, 2018 With some inspiration from here I think this could help: https://www.babylonjs-playground.com/#410HFB brianzinn 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.