AakashKT / LTC-Anisotropic

LTC approximation of the Anisotropic GGX for real-time area light shading with anisotropic reflection.
https://aakashkt.github.io/ltc_anisotropic.html
MIT License
81 stars 4 forks source link

Trying to build on Visual Studio 2022 #2

Open lonnietc opened 1 year ago

lonnietc commented 1 year ago

Hello,

I am really interested in your LTC work and am trying to build it on a Windows 10 (x64) with Visual Studio 2022 but am getting an error.

In general for VS2022, you can follow the same basic build:

mkdir build
cd build/
cmake ..

and it will create a solution file that you can start up in the Visual Studio after which you can do a "Build Solution" but I builds 3 out of 4 components only.

I have a Nvidia RTX 3080 Ti with all of the needed libraries to include Vulkan SDK and others but am not sure why this is not building for me.

Any thoughts or help would be greatly appreciated.

BUILD ERROR AT THE BOTTOM

Build started...
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Skipped Build: Project: update_mappings, Configuration: Debug x64 ------
2>Project not selected to build for this solution configuration 
3>------ Skipped Build: Project: uninstall, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration 
4>------ Build started: Project: glfw, Configuration: Debug x64 ------
4>Building Custom Rule D:/Octree-Dist/LTC/LTC2022/test/opengl_renderer/submodules/glfw/src/CMakeLists.txt
4>context.c
4>init.c
4>input.c
4>monitor.c
4>platform.c
4>vulkan.c
4>window.c
4>egl_context.c
4>osmesa_context.c
4>null_init.c
4>null_monitor.c
4>null_window.c
4>null_joystick.c
4>win32_module.c
4>win32_time.c
4>win32_thread.c
4>win32_init.c
4>win32_joystick.c
4>win32_monitor.c
4>win32_window.c
4>Generating Code...
4>Compiling...
4>wgl_context.c
4>Generating Code...
4>glfw.vcxproj -> D:\Octree-Dist\LTC\LTC2022\test\opengl_renderer\build\submodules\glfw\src\Debug\glfw3.lib
5>------ Build started: Project: sphere, Configuration: Debug x64 ------
5>Building Custom Rule D:/Octree-Dist/LTC/LTC2022/test/opengl_renderer/CMakeLists.txt
5>cl : command line  warning D9002: ignoring unknown option '-march=native'
5>imgui.cpp
5>imgui_demo.cpp
5>imgui_draw.cpp
5>imgui_tables.cpp
5>imgui_widgets.cpp
5>sphere.cpp
5>D:\Octree-Dist\LTC\LTC2022\test\opengl_renderer\imgui_impl.h(67,1): fatal  error C1189: #error:  "Cannot detect OpenGL loader!"
5>imgui_impl.cpp
5>D:\Octree-Dist\LTC\LTC2022\test\opengl_renderer\imgui_impl.h(67,1): fatal  error C1189: #error:  "Cannot detect OpenGL loader!"
5>Generating Code...
5>Done building project "sphere.vcxproj" -- FAILED.
6>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
6>Building Custom Rule D:/Octree-Dist/LTC/LTC2022/test/opengl_renderer/CMakeLists.txt
7>------ Skipped Build: Project: INSTALL, Configuration: Debug x64 ------
7>Project not selected to build for this solution configuration 
========== Build: 3 succeeded, 1 failed, 0 up-to-date, 3 skipped ==========
========== Build started at 12:05 PM and took 05.102 seconds ==========
AakashKT commented 1 year ago

Hi,

Thank you for your interest in our work!

I just successfully built the renderer on a windows maching with a RTX card. I am not sure why you get this error -- I think something maybe broken with your visual studio installation, since its unable to find OpenGL. OpenGL should come by default in Microsoft SDK.

Please try re-installing visual studio, and specifically making sure OpenGL is installed with it.

Let me know if it works.

lonnietc commented 1 year ago

Success !!!

It seems that I had to clean up the vcpkg and do a fresh install from what I had previously with another Visual Studio installation.

I installed the GL3W, GLEW, and GLAD libraries for completeness although in the code it only needs one of them, I think.

Additionally, I had to add the command line switch "/bigobj" for some reason to get it to work, but then everything compiled just fine:

image

Now I would like to see what it would take to use these ideas, or the ones from "Real-Time Polygonal-Light Shading with Linearly Transformed Cosines" (https://eheitzresearch.wordpress.com/415-2/) into a Voxel engine project that I am doing now and need to try and provide a more efficient lighting than standard ray-tracing for which I think LTC's can provide.

Any thoughts?

lonnietc commented 1 year ago

Another question is how you generated the kitchen pan version in "Bringing Linearly Transformed Cosines to Anisotropic GGX" (https://aakashkt.github.io/ltc_anisotropic.html) as I would like to replicate both of those images as a first step to validate the functionality in both the 2016 and 2022 LTC libraries, if possible.

Any guidance would be appreciated greatly appreciated. Thanks again.

lonnietc commented 1 year ago

Hello,

Any update on this as I would like to load up and run the scenes that you have in the paper (2022) and/or perhaps Sponza (lke in the 2016 work) if that is possible.

Thanks and have a good day