ShapeAndMaterial
ShapeAndMaterial copied to clipboard
Code for generating animated GIFs?
Thanks for the easy to use code! This is a really cool method. Would you be able to share the code for generating the rendered GIF animations, e.g. https://github.com/dlichy/ShapeAndMaterial/blob/main/media/bear_cup/object_motion_video_gif.gif?
The gifs were rendered with the Mitsuba 2 ray tracer https://github.com/mitsuba-renderer/mitsuba2. The Cook-Torrance BRDF is custom implemented. I'm planning on releasing it in the near future. For now you can try rendering with only the diffuse albedo using Mitsuba 2's diffuse pluggin or any of their other BRDF models.
Here is the python syntax to load the integrated mesh in Mitsuba 2:
bsdf = {
"type": "diffuse",
"reflectance" : { "type" : "mesh_attribute",
"name" : "vertex_albedo" },
}
myshape = {
"type" : "ply",
"filename" : mesh_path,
"bsdf": bsdf,
}
When I release the Torrance implementation:
bsdf = {
"type": "torrance",
"diffuse_reflectance" : { "type" : "mesh_attribute",
"name" : "vertex_albedo" },
"specular_reflectance" : {"type": "rgb",
"value": [0.05,0.05,0.05]},
"alpha" : { "type" : "mesh_attribute",
"name" : "vertex_rough"}
}
Thanks for your interest in our project!
Hi @dlichy, thanks for releasing the code and for such a nice work you have done! I also wanted to generate the GIF animations you produced and I tried creating them with Mitsuba 2 with the bsdf you posted above, but I got the error:
RuntimeError: [Mesh] Invalid attribute requested vertex_albedo
It seems that Mitsuba does not recognize the albedo attributo in the mesh.ply
. I tried to search online how to render with the diffuse albedo using Mitsuba, but I was not able to find anything. Can you help me?