Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for generating animated GIFs? #1

Open
swtyree opened this issue Apr 15, 2021 · 2 comments
Open

Code for generating animated GIFs? #1

swtyree opened this issue Apr 15, 2021 · 2 comments

Comments

@swtyree
Copy link

swtyree commented Apr 15, 2021

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?

@dlichy
Copy link
Owner

dlichy commented Apr 16, 2021

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!

@cortes93
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants