[vtkusers] Beautiful Rendering

David E DeMarle dave.demarle at kitware.com
Thu May 3 08:46:53 EDT 2018


In VTK 8.1 and ParaView 5.5.0 you can use OSPRay's path tracer. That
will allow you to apply a material to the surface and give it true
reflective and refractive characteristics you are used to seeing in
the real world.

At the VTK level, the most relevant example so far is this bit from a
regression test.
https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OSPRay/Testing/Cxx/TestPathTracerMaterials.cxx#L248.
You will need to download OSPRay and build VTK with
Module_vtkRenderingOSPRay on to use it.

To quickly try it I recommend ParaView. To do so:
* Save the data into a vtk file and load it in a ParaView 5.5.0 binary.
* Change the background in the Properties panel from "Single color" to
"Gradient" to give the reflective and refractive rays something to
work with.
* Type ospray in the search field on the Properties panel to focus on
OSPRay related controls.
* Click Enable OSPRay.
* Change OSPRay Renderer from "scivis" to "pathtracer".
* Increase the "Samples Per Pixel" from 1 to 10 to cut down on the
grainy noise (like underexposure in film).
* Change the OSPRay Material from "None" to "water".

The "water" material in ParaView is just one example which may or may
not be appropriate for your data.
By doing some file editing or coding you can arbitrarily change the
material to make it more blue, more refractive, etc. The VTK tests are
your best guide for that right now. See also the ospray_mats.json file
in the ParaView binary.


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


On Thu, May 3, 2018 at 4:06 AM, virtual tea kit <paul_geus at hotmail.com> wrote:
> Thanks a lot for the vtklightkit advice.
>
> With the following code I am now able to render the following image.
> water.PNG <http://vtk.1045678.n5.nabble.com/file/t342366/water.PNG>
> It looks a lot nicer, than anything I had before.
> But is still a long way away from being water
>
> Do you, or anyone else, have any advice on how to make it more water-like?
>
> Kind regards
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers


More information about the vtkusers mailing list