On 27/02/2013 at 09:45, xxxxxxxx wrote:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
We have a custom exporter and recently tried to add a function that adds an average color of the color texture to our files for every material, so we can have a simplified representation that automatically somewhat resembles the fully detailed version. The materials we have are just the CINEMA 4D standard material and the color channel really only contains a simple Bitmap Shader.
For that, we thought the BaseMaterial::GetAverageColor() function would come in handy, but we ran into a bunch of problems with it:
(1) Calling BaseMaterial::GetAverageColor(CHANNEL_COLOR) just returns grey (0.5, 0.5, 0.5). Not sure where that is coming from, it's neither in the texture, nor is the plan color set to that value.
(2) Using BaseMaterial::GetAverageColor() returns a color that seems to make sense, but in the tests I made it was in sRGB. Converting back to linear worked fine for the cases I tried, but I don't feel well relying on that.
Any ideas? Did anybody else try something similar?