
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "tutorial/03_figures/exercises/c_edl.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_tutorial_03_figures_exercises_c_edl.py>`
        to download the full example code. or to run this example in your browser via Binder

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_tutorial_03_figures_exercises_c_edl.py:


Eye Dome Lighting
~~~~~~~~~~~~~~~~~

Eye-Dome Lighting (EDL) is a non-photorealistic, image-based shading technique
designed to improve depth perception in scientific visualization images.
To learn more, please see `this blog post`_.

.. _this blog post: https://blog.kitware.com/eye-dome-lighting-a-non-photorealistic-shading-technique/

.. GENERATED FROM PYTHON SOURCE LINES 14-18

.. code-block:: Python


    import pyvista as pv
    from pyvista import examples


.. GENERATED FROM PYTHON SOURCE LINES 20-25

Point Cloud
+++++++++++

When plotting a simple point cloud, it can be difficult to perceive depth.
Take this Lidar point cloud for example:

.. GENERATED FROM PYTHON SOURCE LINES 25-29

.. code-block:: Python


    point_cloud = examples.download_lidar()
    point_cloud


.. GENERATED FROM PYTHON SOURCE LINES 30-31

And now plot this point cloud as-is:

.. GENERATED FROM PYTHON SOURCE LINES 31-38

.. code-block:: Python


    # Plot a typical point cloud with no EDL
    pl = pv.Plotter()
    pl.add_mesh(point_cloud, color="tan", point_size=5)
    pl.show()



.. GENERATED FROM PYTHON SOURCE LINES 39-43

We can improve the depth mapping by enabling eye dome lighting on the
renderer with :func:`pyvista.Renderer.enable_eye_dome_lighting`.

Try plotting that point cloud with Eye-Dome-Lighting yourself below:

.. GENERATED FROM PYTHON SOURCE LINES 43-50

.. code-block:: Python


    pl = pv.Plotter()
    pl.add_mesh(point_cloud, color="tan", point_size=5)
    # Turn on eye dome lighting here
    pl.show()



.. GENERATED FROM PYTHON SOURCE LINES 51-54

The eye dome lighting mode can also handle plotting scalar arrays. Try the
above block but by specifying a ``scalars`` array instead of ``color`` in
the ``add_mesh`` call.

.. GENERATED FROM PYTHON SOURCE LINES 56-63

.. raw:: html

    <center>
      <a target="_blank" href="https://colab.research.google.com/github/pyvista/pyvista-tutorial/blob/gh-pages/notebooks/tutorial/03_figures/exercises/c_edl.ipynb">
        <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/ width="150px">
      </a>
    </center>


.. _sphx_glr_download_tutorial_03_figures_exercises_c_edl.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: binder-badge

      .. image:: images/binder_badge_logo.svg
        :target: https://mybinder.org/v2/gh/pyvista/pyvista-tutorial/gh-pages?urlpath=lab/tree/notebooks/tutorial/03_figures/exercises/c_edl.ipynb
        :alt: Launch binder
        :width: 150 px

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: c_edl.ipynb <c_edl.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: c_edl.py <c_edl.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: c_edl.zip <c_edl.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
