nvpro-samples / vk_raytrace Goto Github PK
View Code? Open in Web Editor NEWRay tracing glTF scene with Vulkan
License: Apache License 2.0
Ray tracing glTF scene with Vulkan
License: Apache License 2.0
Hello. Please explain how rayquery variant of renderer works.
Created acceleration structure and used or so?
Where is no fully compute renderer with self-made bvh, not use vulkan acceleration structure?
Hello,
During compilation with VS2022 of vk_raytrace.exe I ended with an error I can't fix.
\vk_raytrace\out\build\x64-Debug\nvml.lib(nvml.dll) : error LNK2001: symbole externe non résolu __delayLoadHelper2
I tried to add
C:\Program Files\NVIDIA Corporation\NVSMI\nvml.dll
C:\Program Files\NVIDIA Corporation\NVSMI\nvml.lib
I have installed latest CUDA 12.2
https://developer.nvidia.com/gpu-deployment-kit says :
The GPU Deployment Kit is part of the CUDA Toolkit, in versions 8 and later, and is no longer available as a separate download.
I do not know how to proceed
I notice some problems in pathtrace.glsl. I am sorry I have no time to fix them myself. If these problems exist, I hope this issue post can help you out.
cmake configuration failed:
$ cmake ..
-- Building for: Ninja
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- -------------------------------
-- Processing Project vk_raytrace:
CMake Error at CMakeLists.txt:30 (find_path):
Could not find BASE_DIRECTORY using the following files:
nvpro_core/cmake/setup.cmake
-- Configuring incomplete, errors occurred!
Hi there, just to let you know, this sample is hanging for me during startup after the debug statement "Create RtCore" in updatePipeline, specifically : vk_raytrace\rtx_pipeline.cpp (line 134).
The other vulkan KHR ray tracing samples seem to work fine with the mainline nvidia VK drivers, so I figured I'd try it here. No dice.
Hello.
My question is about final image.
Is used float or integer format for image data?
Hi! For which purposes is declared functions
vec3 getPunctualRadianceSubsurface()
vec3 getPunctualRadianceTransmission()
vec3 getPunctualRadianceClearCoat()
vec3 getPunctualRadianceSheen()
but not used?
How to plan use it?
Hello.
I cant find in code
The thread include is missing in main.cpp
:
In file included from /home/chris/lab/ray-tracing/vk_raytrace/main.cpp:32:
/usr/include/vulkan/vulkan.hpp:14218:5: note: declared here
14218 | operator T const& () const & VULKAN_HPP_NOEXCEPT
| ^~~~~~~~
/home/chris/lab/ray-tracing/vk_raytrace/main.cpp: In function ‘int main(int, char**)’:
/home/chris/lab/ray-tracing/vk_raytrace/main.cpp:175:8: error: ‘thread’ is not a member of ‘std’
175 | std::thread([&] {
| ^~~~~~
/home/chris/lab/ray-tracing/vk_raytrace/main.cpp:46:1: note: ‘std::thread’ is defined in header ‘<thread>’; did you forget to ‘#include <thread>’?
45 | #include "sample_example.hpp"
+++ |+#include <thread>
46 |
The README.md incorrectly refers to the repo as "vk_raytracing":
git clone https://github.com/nvpro-samples/vk_raytracing.git
It should be "vk_raytrace" instead.
I get a compilation error for just this shader:
1>Generating D:/poojan/projects/nvpro-samples/vk_raytrace/autogen/pathtrace.rgen.spv
1>C:/VulkanSDK/1.2.189.2/bin/glslangValidator.exe -g --target-env vulkan1.2 -o D:/poojan/projects/nvpro-samples/vk_raytrace/autogen/pathtrace.rgen.spv D:/poojan/projects/nvpro-samples/vk_raytrace/shaders/pathtrace.rgen
1>D:/poojan/projects/nvpro-samples/vk_raytrace/shaders/pathtrace.rgen
1>CUSTOMBUILD : error : D:/poojan/projects/nvpro-samples/vk_raytrace/shaders/traceray_rtx.glsl:46: 'no rayPayloadEXT/rayPayloadInEXT declared' : with layout(location = 0)
1>CUSTOMBUILD : error : D:/poojan/projects/nvpro-samples/vk_raytrace/shaders/random.glsl:34: '' : syntax error, unexpected UINT, expecting COMMA or SEMICOLON
1>CUSTOMBUILD : error : 2 compilation errors. No code generated.
Ofcourse, if I don't compile that shader, the sample runs (atleast the compute pipeline works as expected), so I suspect it's probably something different with my validator/version/sdk.
I twiddled around a lot with moving code, etc. No luck. I can't seem to understand what is so different than say the ray tracing gltf sample (all the samples except this one compile/run fine incidentally)
Any ideas?
The cfgmgr.h
is a windows-specific dependency preventing compilation on Linux.
[ 86%] Building CXX object CMakeFiles/vk_raytrace.dir/home/chris/lab/ray-tracing/shared_sources/imgui/imgui_camera_widget.cpp.o
[ 88%] Building CXX object CMakeFiles/vk_raytrace.dir/home/chris/lab/ray-tracing/shared_sources/imgui/imgui_impl_vk.cpp.o
In file included from /home/chris/lab/ray-tracing/vk_raytrace/sample_example.cpp:55:
/home/chris/lab/ray-tracing/vk_raytrace/nvml_monitor.hpp:19:10: fatal error: cfgmgr32.h: No such file or directory
19 | #include <cfgmgr32.h>
| ^~~~~~~~~~~
This works on Jetson nano or xavier?
Please explain how "Remove banding" from shaders/post.frag works:
// Remove banding
uvec3 r = pcg3d(uvec3(gl_FragCoord.xy, 0));
vec3 noise = uintBitsToFloat(0x3f800000 | (r >> 9)) - 1.0f;
color = dither(sRGBToLinear(color), noise, 1. / 255.);
and give please example file to check this code.
I dont see differencies in many scenes
Commit
The issue was: both libdl
and pthreads
were missing. I am not sure what the optimal route would be in the context of the overall tutorial/example system. But, I got things working with the following change in CMakeLists.txt
circa line 151 (the Linkage
section):
From:
#####################################################################################
# Linkage
#
target_link_libraries(${PROJNAME} ${PLATFORM_LIBRARIES} shared_sources)
To:
#####################################################################################
# Linkage
#
find_package(Threads REQUIRED)
set(PROJECT_LIBRARIES ${CMAKE_DL_LIBS} -lpthread)
target_link_libraries(${PROJNAME} ${PLATFORM_LIBRARIES} ${PROJECT_LIBRARIES} shared_sources)
←[0mVulkan Version:
←[0m - available: 1.3.268
←[0m - requesting: 1.3.0
←[0m______________________
←[0mUsed Instance Layers :
←[0m
←[0mUsed Instance Extensions :
←[0mVK_KHR_surface
←[0mVK_KHR_win32_surface
←[0mVK_EXT_debug_utils
←[0m____________________
←[0mDevices : 2
←[0m0: NVIDIA GeForce RTX 3060 Laptop GPU
←[0m - Compatible
←[0m1: Intel(R) UHD Graphics
←[0m - Missing extensions: ←[0mVK_KHR_acceleration_structure ←[0mVK_KHR_ray_tracing_pipeline ←[0mVK_KHR_deferred_host_operations ←[0m
←[0mCompatible physical devices found : ←[0m1
←[0mUsing Device:
←[0m - Device Name : NVIDIA GeForce RTX 3060 Laptop GPU
←[0m - Vendor : NVIDIA
←[0m - Driver Version : 551.92.0
←[0m - API Version : 1.3.271
←[0m - Device Type : Discrete GPU
←[0m________________________
←[0mUsed Device Extensions :
←[0mVK_KHR_swapchain
←[0mVK_KHR_shader_clock
←[0mVK_KHR_acceleration_structure
←[0mVK_KHR_ray_tracing_pipeline
←[0mVK_KHR_ray_query
←[0mVK_KHR_deferred_host_operations
←[0mVK_KHR_buffer_device_address
←[0m
←[0mCreate Offscreen←[0m --> (5.602 ms)
←[0mLoading HDR and converting C:/msys64/home/user/from-git/nv-feb24/bin_x64/Release/../../downloaded_resources//std_env.hdr
←[0m --> (57.192 ms)
←[0mLoading scene: C:/msys64/home/user/from-git/nv-feb24/bin_x64/Release/../../downloaded_resources//robot_toon/robot-toon.gltf←[0m --> (99.653 ms)
←[0m←[33m←[0mConvert to internal GLTF←[0m --> (61.516 ms)
←[0mCreate Buffers
←[0m - Create 18 Material Buffer←[0m --> (0.020 ms)
←[0m - Create 2 Textures, 2 Images←[0m --> (0.734 ms)
←[0m - Create 50 Vertex Buffers←[0m --> (94.095 ms)
←[0m ←[0m --> (6.171 ms)
←[0mCreate acceleration structure
←[0m BLAS(50)←[0mRT BLAS: reducing from: 64887040 to: 25686016 = 39201024 (60.41% smaller)
←[0m TLAS(52)←[0m --> (35.301 ms)
←[0mSwitching renderer, from 2 to 0
←[0mCreate RtxPipeline←[0m --> (17.305 ms)
←[0m
Ran into this error compiling the shaders:
[ 53%] Linking CXX static library /home/chris/ray-tracing/bin_x64/libshared_sources.a
[ 53%] Built target shared_sources
[ 55%] Generating ../autogen/shaders/post.frag.h
/usr/bin/glslangValidator -o autogen/shaders/post.frag.h -V /home/chris/ray-tracing/vk_raytrace/shaders/post.frag --vn post_frag --target-env vulkan1.2
/home/chris/ray-tracing/vk_raytrace/shaders/post.frag
ERROR: Failed to open file: autogen/shaders/post.frag.h
[ 57%] Generating ../autogen/shaders/passthrough.vert.h
/usr/bin/glslangValidator -o autogen/shaders/passthrough.vert.h -V /home/chris/ray-tracing/vk_raytrace/shaders/passthrough.vert --vn passthrough_vert --target-env vulkan1.2
/home/chris/ray-tracing/vk_raytrace/shaders/passthrough.vert
ERROR: Failed to open file: autogen/shaders/passthrough.vert.h
[ 59%] Generating ../autogen/shaders/pathtrace.rahit.h
/usr/bin/glslangValidator -o autogen/shaders/pathtrace.rahit.h -V /home/chris/ray-tracing/vk_raytrace/shaders/pathtrace.rahit --vn pathtrace_rahit --target-env vulkan1.2
/home/chris/ray-tracing/vk_raytrace/shaders/pathtrace.rahit
ERROR: /home/chris/ray-tracing/vk_raytrace/shaders/pathtrace.rahit:88: 'ignoreIntersectionEXT' : undeclared identifier
ERROR: /home/chris/ray-tracing/vk_raytrace/shaders/pathtrace.rahit:88: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
GLSL
is installed:
AMDGPU Packages
Installed Packages
glslc.x86_64 2020.4-1.fc33
Available Packages
glslc.x86_64 2020.2-1.fc33
glslc.x86_64 2020.4-1.fc33
GLSL Lang is @11.0
Installed Packages
glslang.x86_64 11.0.0-1.20200803.git5743eed.fc33
I cant find credits of used method in source codes
Declared as needed in line
Line 108 in 558b878
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.