Digital Art Zone

 
     
::GetRenderingFacetMesh() for a terrain
Posted: 06 October 2013 09:53 PM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  29
Joined  2004-03-30

While working on a fix for a number of my plugins that need to have a preview mesh and a rendering mesh I’ve come back to an unresolved issue.  Can one get the rendering quality facet mesh for a terrain ?  During a render the full mesh will be given to a deformer but I need to do my stuff during the preview.

The code I’m using works for all the other object types I’ve tried.  Inside a modifier I start with the I3DShTreeElement then get the I3DShPrimitive.

TMCCountedPtr<I3DShInstance> Instance;
tree->QueryInterface(IID_ShInstance),(void**)&Instance;);
ThrowIfNil(Instance);
TMCCountedPtr<I3DShObject> Object;
Instance->Get3DObject(&Object;);
TMCCountedPtr<I3DShPrimitive> Primitive;
Object->QueryInterface(IID_I3DShPrimitive,(void**)&Primitive;);
ThrowIfNil(Primitive);
TMCCountedPtr<FacetMesh> RenderMesh;
Primitive->GetRenderingFacetMesh(&RenderMesh;);

I also tried to call ::GetRenderingFacetMesh() from the I3DExGeometricPrimitive but I can only ever get the preview mesh for a terrain.

The Carrara surface replicator and the Inagoni Replica plugin work properly and always distribute over the full quality mesh so there must be a way to do it…

 Signature 

www.Sparrowhawke3D.com

Profile
 
 
Posted: 07 October 2013 10:26 AM   [ Ignore ]   [ # 1 ]
Member
Rank
Total Posts:  51
Joined  2007-02-27

I’m totally spit-balling this, but is there a way of setting the preview mesh to match the rendering mesh, perform your operation, and then dropping the preview mesh back down to it’s former preview quality?

P

Profile
 
 
Posted: 07 October 2013 07:18 PM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  29
Joined  2004-03-30

With a number of my plugins, like the terrain follower or footprints, the user currently has to turn up the terrain render mesh to full quality themselves.  That slows down the workflow so I really want to avoid that.  For what I am doing in those plugins the mesh can’t be turned back down.  In the fix I am working on for Jiggle I’m recording both the preview and render mesh vertex weights so the plugin can work at render time with a subdivision vertex model.  Currently the user would have to turn a figure’s preview up to full quality which makes them very slow to work with.

 Signature 

www.Sparrowhawke3D.com

Profile
 
 
Posted: 10 October 2013 07:43 AM   [ Ignore ]   [ # 3 ]
Member
Avatar
Rank
Total Posts:  81
Joined  2006-06-18

But if you ask it for the render quality mesh, won’t it be slow anyways, since it has to generate that each time it evaluates your plugin? Maybe even slower, if it threw away the mesh each time, and then your plugin asks for it again the next frame.

Profile
 
 
Posted: 10 October 2013 08:04 AM   [ Ignore ]   [ # 4 ]
Member
Avatar
Rank
Total Posts:  29
Joined  2004-03-30

If I can’t get hold of the full terrain mesh the plugins rely upon the user to turn it up and they may have to leave it up or loose the results.  Displaying the highly detailed mesh in the preview is one part of what would slow it down for the user - if a terrain is hidden from view the preview is not slowed down at all.  The render quality can be turned up higher than the preview which is limited to 1025x1025.  You could be right about Carrara regenerating the mesh every time it is called but that would have to be put to the test.

 Signature 

www.Sparrowhawke3D.com

Profile