Code Monkey home page Code Monkey logo

pbrvulkan's People

Contributors

juanraul8 avatar toxicfork avatar zielon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pbrvulkan's Issues

Validation Errors Acceleration Structure (RTX 2060)

The issue occurs when the user change from the "Cornel Box" scene to the "Dragon Scene":

Console Output:
"[RAYTRACER] Swap chain has been deleted.
[RASTERIZER] Swap chain has been deleted.
[LOADER] Scene processing has begun!
[MESH] ../Assets/Scenes/dragon/dragon.obj has been requested!
[SCENE] All assets have been loaded!
[SCENE] Vertex buffer size = 15.1757 MB
[SCENE] Scene has been loaded!
# meshes: 1
# instances: 1
# textures: 1
# lights: 1
# materials: 2
[SCENE] Loading time: 1707 milliseconds
[COMPILER] Shaders compilation has begun.
[SHADER] Denoiser.comp.spv has been processed
[SHADER] Edgedetect.comp.spv has been processed
[SHADER] Sharpen.comp.spv has been processed
[SHADER] Fragment.frag.spv has been processed
[SHADER] Vertex.vert.spv has been processed
[SHADER] Raytracing.compiled.rchit.spv has been processed
[SHADER] Raytracing.compiled.rgen.spv has been processed
[SHADER] Raytracing.compiled.rmiss.spv has been processed
[SHADER] Shadow.compiled.rmiss.spv has been processed
[COMPILER] Shaders compilation has ended.
VUID-vkCmdBuildAccelerationStructureNV-update-02491(ERROR / SPEC): msgNum: -1617737797 - Validation Error: [ VUID-vkCmdBuildAccelerationStructureNV-update-02491 ] Object 0: handle = 0x23f439e1c98, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x9f9347bb | vkCmdBuildAccelerationStructureNV(): If update is VK_FALSE, The size member of the VkMemoryRequirements structure returned from a call to vkGetAccelerationStructureMemoryRequirementsNV with VkAccelerationStructureMemoryRequirementsInfoNV::accelerationStructure set to dst and VkAccelerationStructureMemoryRequirementsInfoNV::type set to VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV must be less than or equal to the size of scratch minus scratchOffset The Vulkan spec states: If update is VK_FALSE, the size member of the VkMemoryRequirements structure returned from a call to vkGetAccelerationStructureMemoryRequirementsNV with VkAccelerationStructureMemoryRequirementsInfoNV::accelerationStructure set to dst and VkAccelerationStructureMemoryRequirementsInfoNV::type set to VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV must be less than or equal to the size of scratch minus scratchOffset (https://vulkan.lunarg.com/doc/view/1.2.154.1/windows/1.2-extensions/vkspec.html#VUID-vkCmdBuildAccelerationStructureNV-update-02491)
Objects: 1
[0] 0x23f439e1c98, type: 6, name: NULL
[RAYTRACER] Acceleration data structure build: 54 milliseconds
[COMPUTER] Compute pipeline has been deleted."

The output of the renderer:

Dragon_Test

NB: The issue is only related to the RTX 2060 graphics card.

Document required Vulkan extensions

Knowing ahead of time that the project uses VK_KHR_RAY_TRACING_PIPELINE and is not a fully software raytracing implementation could have saved some time.

Full list (from PBRVulkan/RayTracer/src/Vulkan/Device.cpp f19ca90)

VK_KHR_SWAPCHAIN
VK_KHR_SHADER_CLOCK
VK_KHR_PIPELINE_LIBRARY
VK_KHR_DEFERRED_HOST_OPERATIONS
VK_KHR_ACCELERATION_STRUCTURE
VK_KHR_RAY_TRACING_PIPELINE
VK_KHR_BUFFER_DEVICE_ADDRESS

RaytracerGraphicsPipeline Crashes on RTX 2070

The system RaytracerGraphicsPipeline crashes at the line 377 (RaytracerGraphicsPipeline.cpp)

VK_CHECK(extensions->vkCreateRayTracingPipelinesNV(device.Get(), nullptr, 1, &pipelineInfo, nullptr, &pipeline),
"Create ray tracing pipeline");

Scenes, Shaders and Acceleration structures are processed correctly.

The issue only occurs on the RTX 2070 device.

Convergence results depend on diffuseRatio factor

In DisneyBSDF.glsl:

float diffuseRatio = 0.5 * (1.0 - material.metallic);

The 0.5 here says we will 50% use cosineSampleHemisphere and 50% use use importanceSampleGGX. So, the 0.5 is a factor to determine multiple importance sampling strategy. If everything is right, the converge result should not vary from diffrent choices.

However, if you change diffuseRatio like,

float diffuseRatio = 0.08 * (1.0 - material.metallic);
float diffuseRatio = 0.1 * (1.0 - material.metallic);
float diffuseRatio = 0.5 * (1.0 - material.metallic);
float diffuseRatio = 0.8 * (1.0 - material.metallic);
...

you will get different rendering results (test scene is hyperion.scene, observable difference below the white sphere ).

1
2

Is it a bug?

RaytracerGraphicsPipeline Crash on RTX 2070

The system RaytracerGraphicsPipeline crashes at the line 377 (RaytracerGraphicsPipeline.cpp)

VK_CHECK(extensions->vkCreateRayTracingPipelinesNV(device.Get(), nullptr, 1, &pipelineInfo, nullptr, &pipeline),
"Create ray tracing pipeline");

Scenes, Shaders and Acceleration structures are processed correctly.

The issue only occurs on the RTX 2070 device.

Add Shader Compiler

Create a class which will modify shader files accordingly for configuration and compile it

Add models of camera lens

Sample a new direction of a ray going trough a lense.
Variables are already available in the Uniform buffer.

float aperture;
float focalDistance;

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.