dicarlolab / genthor

Generative models and Bayesian techniques with thor
5 stars 12 forks source link

Surface mapping feature #9

Open yamins81 opened 12 years ago

yamins81 commented 12 years ago

Make the renderer have the ability to swap out the surfaces mapping onto the objects from

1) determine how to describe surface replacements --> presumably in .mtl file, by adding or replacing map_Ka and map_Kd directives in various materials --> We need some kind of format for describing these replacements as a "latent variable" given to the renderer for a particular image

2) write the code that will, on demand, make the relevant (temporary?) modified .mtl file.

3) make the .bam creation read from the modified .mtl file and make .bam names reflect surface replacement (e.g. hash). So now the creation process is: OBJ --> modified OBJ for surface replacement --> EGG --> .BAM (cached)

yamins81 commented 11 years ago

Basically, @pbattaglia convincingly demonstrated how to use panda manipulations to handle this case. In particular, there is not going to be any pre-processing of the obj. Instead, there will simply be some format for describing texture and material remappings that will be interpreted by the renderer during rendering.

@pbattaglia and I looked a little into how that should be done, and we basically decided to implement something that

 1) will allow the user to specify (by name?) which node (or nodes) in the mesh tree should have their (texture/color/material) be remapped.  This node (or nodes) can either be a leaf node of the tree, or a higher level node that contains seveeral submeshes. 

 2) will determine texture coordinates using some simple automatic procedure as supplied e.g. by Panda to make sure that textures are properly applied.    (perhaps this can be an optional thing so that the user can make "wrong" textures, like the weird doguana, if desired) 

Basically, what's left to do here is design exactly what specification of remappings will look like, and then implement it as a series of simple panda method calls in the renderer.construct_scene function ...