Mitsuba3 provides SOTA for pbr. This article focuses on using Mitsuba's principled_hair
BSDF and custom adjustments for high-fidelity hair rendering.
Firstly, defining the scene and hair BSDF.
import mitsuba as mi
mi.set_variant('cuda_rgb')
# Define the hair scene with a principled hair BSDF
scene_dict = {
"type": "scene",
"integrator": {"type": "volpath"},
"sensor": {
"type": "perspective",
"film": {"type": "hdrfilm", "width": 1024, "height": 768}
},
"hair_object": {
"type": "ply",
"filename": "../scenes/hair_model.ply",
"bsdf": {
"type": "principled_hair",
"melanin_concentration": 0.6,
"sigma_a": [0.1, 0.05, 0.02],
"roughness": 0.3,
"azimuthal_roughness": 0.2
}
},
"light": {
"type": "point",
"intensity": {"type": "spectrum", "value": 150.0},
"position": [2.0, 2.0, 2.0]
}
}
# Load and render the scene
scene = mi.load_dict(scene_dict)
image = mi.render(scene, spp=512)
# Display the rendered image
import matplotlib.pyplot as plt
plt.axis('off')
plt.imshow(image ** (1.0 / 2.2))
plt.show()
Python
Leave a Reply