I’d rather not save each texture’s albedo color in memory for the purposes of toggling to grayscale and back. Is there anyway to turn off the albedo color entirely? Turning off the albedoTexture channel does not achieve this. Any suggestions in a different direction are also welcome!
I’m not sure I fully understand the effect you’re trying to achieve. If you’re just trying to desaturate the render, a postprocess effect might be the easiest way to do that. There’s a built-in one for a black-and-white effect; does that do something like what you’re looking for?
Yeah I was thinking that a post process would work best, but black and white isn’t quick what I’m going for. I’m trying to achieve something like this:
Babylon doesn’t seem to offer this style of post process natively.
I can get there by disabling all of the texture channels except ambient occlusion and reflectivity.
But the issue is that (as seen above) some of the materials maintain their albedo colors. If I were to change those materials’ albedo colors to white, I would have to save their original albedo color values in order to switch back, no? I’d rather not save these values in memory, and was wondering if there was a better way to do it.
Seems that BW postProcess, as mentioned above, really could help with the grayscale effect which you are trying to achieve if I understand it correctly.
Here is the example - https://playground.babylonjs.com/#L92PHY#64
I think you need baked textures with ambient occlusion and all materials are nodeMaterials with 2 textures - original and the one just with ambient occlusion. Then add a gradient node and a float input to switch hard or soft between the two textures.