Code Monkey home page Code Monkey logo

openfx-lic's Introduction

Line Integral Convolution effect for OpenFX

Disclaimer: This is just a proof-of-concept at the moment.

Line Integral Convolution (LIC) is a visualization technique for vector fields. It uses a noise texture warped by the vector field to show its structure. It is commonly found in specialized CFD simulation and post-processing software.

This implementation of LIC is an OpenFX plug-in, which brings this kind of visualization into compositing software such as Nuke, Natron, Fusion (DaVinci Resolve) and others.

How to use the effect

  1. You will need image with screen-space X, Y vectors - presumably in EXR format.
    • Magnitude of the vectors is not important, the effect will normalize them.
    • Pixels where X or Y is NaN or X = Y = 0 are excluded and will be made transparent black in the output.
  2. Download lic.ofx.bundle from GitHub releases page, or build it yourself (lic target in CMake, then create the bundle directory structure manually).
  3. Install the plug-in:
    • On Windows, put the lic.ofx.bundle directory into C:\Program Files\Common Files\OFX\Plugins
    • On Linux, put the lic.ofx.bundle directory into /usr/OFX/Plugins
    • For more information, see 'Packaging OFX Plug-ins' in OpenFX docs
  4. Now you can use the plug-in, see below for instructions.

LIC effect in Natron

  • In Natron, the usage is straightforward.
  • Add the LIC effect node (located in menu: LIC > LIC)
  • Connect both inputs ("Vector X", "Vector Y") to your EXR node.
  • In properties of the LIC node, select appropriate source layers for "Vector X" and "Vector Y".
  • For display it's suitable to Merge the LIC output with your beauty pass using blend mode "overlay" and using the alpha channel from LIC as mask.

How to use LIC effect - Natron screenshot

LIC effect in DaVinci Resolve / Fusion

  • In Fusion, some wrangling with the layers is necessary.
  • I was able to make it work in DaVinci Resolve 17.4.6 with the following node graph:
    • One MediaIn node with RGB layers (beauty pass RGB from EXR)
    • Another MediaIn, where Red layer is read from X vectors and Green layer is read from Y vectors in the EXR file.
    • Two Channel Boolean nodes that shuffle the X/Y vector layer into Red layer (come to think of it, you only need one for the Y vectors, the X vectors can be read from the MediaIn).
    • LIC effect node (located in menu: LIC > LIC) that is connected to the Channel Boolean nodes.
    • A Merge node with "overlay" blend mode for displaying.

How to use LIC effect - Fusion screenshot

License

The LIC effect itself (source code located in ./src directory) is licensed under MIT License, see LICENSE.txt.

Dependencies of the code are licensed as follows:

  • The SimplexNoise C++ libary by Sebastien Rombauts is licensed under MIT License, see SimplexNoise/LICENSE.txt.
  • The OpenFX support C++ library and examples from The Open Effects Association Ltd. are licensed under 3-clause BSD License, see openfx/Support/LICENSE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.