Hi David,

I was able to complete all the steps. As you probably know, the step four was 
tedious.

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 ?
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.

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.

Best regards,

Jonathan Borduas

From: David E DeMarle <[email protected]>
Sent: Friday, May 18, 2018 10:58 AM
To: Jonathan Borduas <[email protected]>
Cc: [email protected]
Subject: Re: [Paraview] OSPRay textures and materials mapping

Hi Jonathan.

Yes you can do that.

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.

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"

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.

4) Make up a categorical lookup table.
   open spreadsheet view, switch to Field Data, look at the Material Names.
   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.
   add annotations, value 0 should be the name of the first entry in the 
Material Names array.

Notes:
* 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.
* in general it isn't a 1:1 match between mtl and ospray, in particular 
multitextures are not yet implemented
* 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.

At some point I'll get around to making this all automatic. Patches are welcome 
in the meantime.

good luck










David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Fri, May 18, 2018 at 10:25 AM, Jonathan Borduas 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

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

I used the PathThracer mode. However, attached to the .obj there is an .mtl 
file containing 50+ materials and 50+ texture (.png) files.

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.

It seems that I have to assign the material and texture to each polydata 
one-by-one.

Is there a feature that will automatically map the respective textures and 
materials ?
Here is the link to download the original .dwg file. 
https://www.easterngraphics.com/pcon/en/wp-content/uploads/2015/03/sample_apartment.dwg
You will need to export it to .obj using PCon Planner Version 7.7 Patch 1 with 
the File/Export/Geometry menu.
I couldn’t share the .obj  file since the size is 60mb+

Thank you

Jonathan Borduas


_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview

Reply via email to