<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi David, <br>
<br>
I was able to complete all the steps. As you probably know, the step four was tedious.
<br>
<br>
However I couldn’t get the result I wanted since I couldn’t assign the right textures to the right areas. Is there a mechanism to assign the texture just like we assign materials ?<br>
I guess this is what you mean by “multi-texture isn’t implemented yet”. I could probably extract all objects using a connectivity filter and then manually assign the textures, but again it is a tedious process for complex objects.
<br>
<br>
Is there a roadmap as to when the multi-texture could be implemented ? It would be great to have readers that can load texture/Geometry/Materials files such as .obj (.mtl and .png), .fbx and .dwg.
<br>
<br>
Best regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Jonathan Borduas<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> David E DeMarle <dave.demarle@kitware.com> <br>
<b>Sent:</b> Friday, May 18, 2018 10:58 AM<br>
<b>To:</b> Jonathan Borduas <jonathan.borduas@caboma.com><br>
<b>Cc:</b> paraview@public.kitware.com<br>
<b>Subject:</b> Re: [Paraview] OSPRay textures and materials mapping<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Jonathan.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Yes you can do that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">1) File->Load OSPRay Materials, switch the file type from "OSPRay Material Files (*.json)" to "Wavefront Material FIles (*.mtl)". That will let you load all of the materials and textures. They should all show up in the Material list.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">2) The OSPRay Material selection (on Display section of Properties Tab advanced) will have all of the individual materials listed in it + a few others including "Value Indexed" which is all the way at the bottom. Choose that it means "use
the categorical color lookup table to decide what material to use for each block and or polygon"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">3) Now change the scalar array to color by to "Material Id", a cell aligned array which has the material index to use for each cell.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">4) Make up a categorical lookup table.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> open spreadsheet view, switch to Field Data, look at the Material Names.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> open the color map editor for the "Material Id", click on Interpret Values As Categories and the color will change from bluewhitered to extremely YELLOW.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> add annotations, value 0 should be the name of the first entry in the Material Names array.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Notes:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">* I have the trivial script somewhere that I used for the SC17 demo that makes up the lookup table for you. I'll try and dig that up.<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal">* in general it isn't a 1:1 match between mtl and ospray, in particular multitextures are not yet implemented<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* along those lines, the mtl parser I whipped up $PVSRC/VTK/Rendering/OSPRay/vtkMaterialLibrary::InternalParseMTL recognizes a "type" extension outside of mtl that lets you bring in ospray's nice materials instead of the default OBJMaterial.
Glass and Metal are particularly nice.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">At some point I'll get around to making this all automatic. Patches are welcome in the meantime.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">good luck<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">David E DeMarle<br>
Kitware, Inc.<br>
Principal Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, May 18, 2018 at 10:25 AM, Jonathan Borduas <<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi,
<br>
<br>
I tried rendering an .obj file running OSPRay that was exported from PCon Planner Version 7.7 Patch 1. The original file is a .dwg
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I used the PathThracer mode. However, attached to the .obj there is an .mtl file containing 50+ materials and 50+ texture (.png) files.
<br>
<br>
I didn’t find an automated way to map all polydata of the .obj with their respective material and texture file and rendering them using OSPRay.
<br>
<br>
It seems that I have to assign the material and texture to each polydata one-by-one.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt">Is there a feature that will automatically map the respective textures and materials ?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Here is the link to download the original .dwg file.
<a href="https://www.easterngraphics.com/pcon/en/wp-content/uploads/2015/03/sample_apartment.dwg" target="_blank">
https://www.easterngraphics.com/pcon/en/wp-content/uploads/2015/03/sample_apartment.dwg</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">You will need to export it to .obj using PCon Planner Version 7.7 Patch 1 with the File/Export/Geometry menu.
<br>
I couldn’t share the .obj file since the size is 60mb+ <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thank you<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#888888"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="color:#888888">Jonathan Borduas<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#888888"> <o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>