Add and render differential per-vertex feature while keeping original rendering #831
Replies: 3 comments 2 replies
-
This is not fully supported. We have recently added some functions that might make the implementation of something like this a bit easier in the future. I think the easiest approach would be to add your "feature" as a mesh attribute (read a guide about this here). Attributes are only supposed to be 1 or 3 channels. You would therefore need to add support for whatever feature width you need. The second and lost modification you would need to do, is modify the |
Beta Was this translation helpful? Give feedback.
-
Ok! Thanks for your reply! It really helps : ) |
Beta Was this translation helpful? Give feedback.
-
I try to add mesh_attribute for "base_color", it becomes bsdf.base_color.scale, but the original base_color ( bsdf.base_color.value) seems missing. mesh = mi.load_dict({
"type": "obj",
"filename": FLAGS.base_mesh,
"bsdf": {
"type": "principled",
"base_color": {
"type": "mesh_attribute",
"name": "vertex_feat1", # This will be used to visualize our attribute
},
},
})
attribute_size = mesh.vertex_count() * 3
mi.traverse(mesh )
SceneParameters[
---------------------------------------------------------------------------------------------
Name Flags Type Parent
---------------------------------------------------------------------------------------------
bsdf.clearcoat.value ∂ Float UniformSpectrum
bsdf.clearcoat_gloss.value ∂ Float UniformSpectrum
bsdf.metallic.value ∂ Float UniformSpectrum
bsdf.main_specular_sampling_rate float Principled
bsdf.clearcoat_sampling_rate float Principled
bsdf.diffuse_reflectance_sampling_rate float Principled
bsdf.specular ∂, D Float Principled
bsdf.roughness.value ∂, D Float UniformSpectrum
bsdf.base_color.scale float MeshAttribute
bsdf.anisotropic.value ∂ Float UniformSpectrum
bsdf.spec_tint.value ∂ Float UniformSpectrum
bsdf.sheen.value ∂ Float UniformSpectrum
bsdf.sheen_tint.value ∂ Float UniformSpectrum
bsdf.spec_trans.value ∂ Float UniformSpectrum
bsdf.flatness.value ∂ Float UniformSpectrum
vertex_count int OBJMesh
face_count int OBJMesh
faces UInt OBJMesh
vertex_positions ∂, D Float OBJMesh
vertex_normals ∂, D Float OBJMesh
vertex_texcoords ∂ Float OBJMesh
vertex_feat1 ∂ Float OBJMesh
] I try to add new parameter name but it says I can't create new one Unreferenced property "features" in plugin of type "principled"! mi.load_dict({
"type": "obj",
"filename": FLAGS.base_mesh,
"bsdf": {
"type": "principled",
"features": {
"type": "mesh_attribute",
"name": "vertex_feat1", # This will be used to visualize our attribute
},
},
}) could you give me some help? Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi! Thanks for the great mistuba work!! I am working for an inverse rendering task and I'd like to add and output the differential per-vertex feature (4 channel feature) in an AOV style while keeping the original PRB rendering. I plan to pass this feature to a pytorch decoder to supervise the original RGB rendering. I look at the AOV tutorial and latent variable tutorial, but I don't know how to add this kind latent varible. Could you give me some guidance? Thanks!
System configuration
System information:
OS: linux
CPU: ...
GPU: Nvidia A40
Python version: 3.9
LLVM version: ...
CUDA version: 12.1
NVidia driver: 530.30.02
Dr.Jit version: 0.4.2
Mitsuba version: 3.3.0
Compiled with: pip
Variants compiled: ...
Description
I load a .obj mesh in this way:
It outputs these parameters, but there is no 'feature' among them. And It seems AOV does not support self-defined output.
Is there any possibility to set two "material" for the same mesh and optimize them together? In this way I can output vertex feature using one material, and output RGBA rendering using original principled BSDF. Thanks!
Steps to reproduce
None
Beta Was this translation helpful? Give feedback.
All reactions