[Paraview] OSPRay textures and materials mapping
David E DeMarle
dave.demarle at kitware.com
Fri May 18 10:57:51 EDT 2018
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 <
jonathan.borduas at caboma.com> 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
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180518/4c90d052/attachment.html>
More information about the ParaView
mailing list