Devsh-Graphics-Programming / Nabla

Vulkan, OptiX and CUDA Interoperation Modular Rendering Library and Framework for PC/Linux/Android
http://devsh.eu
Apache License 2.0
448 stars 56 forks source link

Path Tracer V2 #367

Open devshgraphicsprogramming opened 2 years ago

devshgraphicsprogramming commented 2 years ago

Description

This one is really hard to start because there's a lot of required moving parts.

Goals

Integrate Denoiser and Post Processing into the Sample

Probably need an ext::BasicDenoiser:

Need to allow for overridable store/load of image data as OptiX is weird and only does Buffers for pixels, not images.

Write small wrappers to adapt existing extensions to new interfaces.

Factor out raytraceCommon.glsl into an ext::PathTracer

Obviously a compute shader megakernel, but make it easy to replace with an impl based off KHR_raytracing_pipeline.

Be agnostic of (have separate GLSL modules provide):

Being agnostic of raygen and accumulation lets us be oblivious to adaptive sampling.

Need to be able to handle:

Gradually evolve towards:

Do a semi rewrite of existing example 22

Port what can be ported, backfill anything that can't with a "test harness".

Application Framework

Start by using ex 42 as a starting base. Backport the refactor and rewrite ex 42 to use the ext.

AS traversal harness

Use ex 42 ball traversal.

Material harness

Use ex 42 material impl and table, then use material compiler again.

NEE harness

Use ex 42 light modes, then just use a function that always fails to pick a light.

Path Guiding harness

Use our envmap RIS.

devshgraphicsprogramming commented 1 year ago

Features

Toggleable Post Processing stack

Disable/Enable denoiser, tonemap and bloom.

Scene Reload

While saving sensor ID and transformation.

GUI

For adjusting denoiser, RWMC, and tonemap+bloom.

Scene Edit

Instances, Textures and Materials need to have string names and UUIDs.

Serialization

We need to come up with our own way of serializing the scene and reloading it which is not Mitsuba.

Material Edit

In order to be able to support runtime edit, Material Compiler backends should defer optimization of the VM (make it optional).

Live Edit

A little Node Based Editor for our Material IR in GUI.

Add

Could support reading Mitsuba XML files of just materials.

Remove

By clicking a dropdown list in GUI.

Texture Edit

Requires our virtual texturing or descriptor indexing to be able to add/remove textures at runtime.

Replace

This would be hard on the VT as the page table alloc/handle would change.

Add

Relatively straight forward.

Delete

Would need to go through material compiler's output and safely neuter any references to the texture.

Instance Edit

Picking

Being able to pick the geometry on screen or a searchable list.

Also support multi-pick.

Warning: The geometry could be diced up into multiple parts thanks for BVH rethreading.

Delete

Remove from scene.

Transformation

First via GUI, then add gimbals.

For multi-pick compute the compound transform as the transform of the OBB.

Clone

Add a copy of the picked items.

Add

File Open dialog for the model and drop-down list of materials to pick.

devshgraphicsprogramming commented 1 year ago

Related

https://github.com/Devsh-Graphics-Programming/Nabla/issues/297 https://github.com/Devsh-Graphics-Programming/Nabla/issues/310