Merge branch 'master' into blender2.8
This commit is contained in:
@@ -700,4 +700,20 @@ float ShaderManager::linear_rgb_to_gray(float3 c)
|
||||
return dot(c, rgb_to_y);
|
||||
}
|
||||
|
||||
string ShaderManager::get_cryptomatte_materials(Scene *scene)
|
||||
{
|
||||
string manifest = "{";
|
||||
unordered_set<ustring, ustringHash> materials;
|
||||
foreach(Shader *shader, scene->shaders) {
|
||||
if(materials.count(shader->name)) {
|
||||
continue;
|
||||
}
|
||||
materials.insert(shader->name);
|
||||
uint32_t cryptomatte_id = util_murmur_hash3(shader->name.c_str(), shader->name.length(), 0);
|
||||
manifest += string_printf("\"%s\":\"%08x\",", shader->name.c_str(), cryptomatte_id);
|
||||
}
|
||||
manifest[manifest.size()-1] = '}';
|
||||
return manifest;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
Reference in New Issue
Block a user