fluid-engine-dev icon indicating copy to clipboard operation
fluid-engine-dev copied to clipboard

Regarding OpenGL basd visualizer

Open mmmovania opened this issue 9 years ago • 8 comments

I noticed that there is no opengl/directx based previsualizer or renderer builtin this engine. Are there plans to do that?

mmmovania avatar Nov 14 '16 02:11 mmmovania

Thanks for the comment! Yes, although some examples in this engine have some exporters to Matplotlib, it would be great to have a built-in previz tool. Let me use this issue to track it. Maybe simple glfw-based viewer would be nice.

doyubkim avatar Nov 14 '16 03:11 doyubkim

Great I am working on this for myself. Will share with you when done.

mmmovania avatar Nov 14 '16 14:11 mmmovania

Sounds great, thanks!

doyubkim avatar Nov 14 '16 15:11 doyubkim

This feature is almost ready to roll out (checkout viz branch). I'm introducing jet.viz module with GL implementation inside. Documentation and Python binding is still missing, though. Also, name of the module may change since I think there should be a better name than viz :)

doyubkim avatar Dec 09 '17 07:12 doyubkim

Thanks will have a look :)

mmmovania avatar Dec 20 '17 15:12 mmmovania

I've merged (technically, I rebased, but..) viz branch into gpu branch. Any latest dev work will happen in gpu branch. Note that it also contains some CUDA experiments, so if you don't want that feature, you can turn if off by passing -DUSE_CUDA=OFF to the cmake command. Both GL and CUDA are WIP, so there might be some build issues. (I'm mostly testing with macOS and Windows + Visual C++ 2015)

doyubkim avatar Jan 09 '18 08:01 doyubkim

Solution how to fix the glfw3 dependency (on MacOSX):

> mkdir build
> cd build
> cmake -DUSE_CUDA=OFF ..
...
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/OpenGL.framework
CMake Error at CMakeLists.txt:53 (find_package):
  By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "glfw3", but
  CMake did not find one.

  Could not find a package configuration file provided by "glfw3" with any of
  the following names:

    glfw3Config.cmake
    glfw3-config.cmake

  Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
  "glfw3_DIR" to a directory containing one of the above files.  If "glfw3"
  provides a separate development package or SDK, be sure it has been
  installed.

Need to install glfw per their instructions. As you can see, this includes all the headers, libs, and the .cmake files needed to find glfw

git clone https://github.com/glfw/glfw.git
cd glfw
mkdir build
cd build/
cmake ..
make -j 8
make install

-- Install configuration: ""
-- Installing: /usr/local/include/GLFW
-- Installing: /usr/local/include/GLFW/glfw3.h
-- Installing: /usr/local/include/GLFW/glfw3native.h
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Config.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3ConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/glfw3.pc
-- Installing: /usr/local/lib/libglfw3.a

cd ../../fluidengine/build
cmake -DUSE_CUDA=OFF ..
make -j 8

subatomicglue avatar Jan 22 '18 22:01 subatomicglue

Thanks for trying out the branch, @subatomicglue ! For macOS, you can use Homebrew to install glfw. (For Ubuntu, apt-get. For Windows, NuGet.) But yeah, I also want to make the code almost self-buildable with very basic build tools, so let me see if I can think of alternative approaches (such as git submodule or CMake externalproject_add).

doyubkim avatar Jan 23 '18 09:01 doyubkim