Giter Club home page Giter Club logo

chunky-denoiser's People

Contributors

atom3333 avatar jackjt8 avatar lemaik avatar peregrine05 avatar thatredox 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

Watchers

 avatar  avatar  avatar

chunky-denoiser's Issues

Issue with loading saved scenes

Documentation about bugs that I have discovered and possible workarounds to those bugs:

Chunky Denoiser Bugs and Workarounds:

Bug 1: To replicate it:

1. Render the albedo and normal maps, and also the path tracing render for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Load the saved scene.

Chunky completely restarts the render, rendering the albedo and normal maps at the default target SPP of 16 for both. Then, Chunky starts rendering the path tracing from the beginning.

Bug 2: To replicate it:

1. Render the albedo and normal maps, and also the path tracing render for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Load the saved scene.
7. Reset the render.
8. Merge render dump from scene directory.
9. (noted that main target SPP is set to 16 from its previous setting, and the current SPP is the same as what was saved in the render dump.)
10. Resume the render.

If the current SPP is greater than the target SPP of the albedo map, then chunky starts rendering the normal map. But if the current SPP is less than the target SPP of the normal map, then Chunky starts rendering the normal map from the current SPP saved in the render dump. But, the normal map is rendered on top of the render dump, so the result looks weird; a combination of the normal map and the path tracing render merged into one frame.

image

Bug 3 (similar to bug 1): To replicate it:

1. Render without the albedo and normal maps for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. (noted that the checkboxes for albedo and normal maps are always on by default.)
7. Load the saved scene.

Chunky not only completely restarts the render, as in bug 1, but also restarts by rendering the albedo and normal maps before starting the path tracing render from the beginning.

Bug 4: To replicate it:

1. Render with or without the albedo and normal maps for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Disable albedo and normal maps in an attempt to stop Chunky from restarting the render to render the albedo and normal maps again.
7. Load the saved scene.

Because the albedo and normal maps are disabled, Chunky does not restart by rendering them. However, it still restarts the path tracing render from the beginning.

Bug 5: To replicate it:

1. Render the albedo and normal maps, and also the path tracing render for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Disable albedo and normal maps in an attempt to stop Chunky from restarting the render to render the albedo and normal maps again.
7. Load the saved scene.
8. After it restarts the path tracing render from the beginning, reset the render.
9. Merge the render dump for the scene.
10. Resume the render.

Chunky continues the path tracing render from where it was saved. When it finishes, the denoiser does not use the albedo and normal maps to denoise. The result is a low quality denoised image.

Workarounds:

For an image without the denoiser:
1. Render without the albedo and normal maps for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Disable the albedo and normal maps.
7. Load the saved scene.
8. The path tracing render will start from the beginning. Reset the render.
9. Merge the render dump from the saved scene.
10. Resume the render.
Chunky continues the path tracing render from where it was saved.

For an image with the denoiser:

1. Render the albedo and normal maps, and also the path tracing render for a time.
2. Pause the render.
3. Save the scene.
4. Close Chunky.
5. Re-open Chunky.
6. Disable the albedo and normal maps.
7. Load the saved scene.
8. The path tracing render will start from the beginning. Reset the render.
9. Merge the render dump from the saved scene.
10. Resume the render.
11. Enable the albedo and normal maps again.

Chunky continues the path tracing render from where it was saved, and when it finishes, the denoiser uses the albedo and normal maps and denoises properly, making a high quality image.

Add the option to generate secondary albedo and normal, to account for reflections.

Add a second normal and albedo, (both off by default?) that calculates that applies to reflected surfaces. Maybe also add the option to combine them with the first based on how reflective the surface is. Will make water look much better.

Also maybe a third for refracted albedo/normal, which will fix underwater areas getting blurred. (also with the option to automatically combine with the first/second.)

Validate denoiser executable

Currently the Plugin does not check if the executable is the right one.

oidnDenoise.exe - Is correct and works.
oidnBenchmark.exe - Is invalid and only throws an Error: invalid argument in the debug console. Also locks up the Renderer.
oidnTest.exe - Is invalid and nothing happens.
DiskInfo64.exe - Is invalid and nothing happens.


Owing to how Chunky responded to oidnBenchmark.exe and Error: invalid argument I would recommend that we actually validate if the provided executable is the right one. Running oidnDenoise.exe or oidnDenoise.exe -h would show a list of valid command-line options.

D:\Programs\oidn-1.4.2.x64.vc14.windows\bin>oidnDenoise.exe
Intel(R) Open Image Denoise
usage: oidnDenoise [-d/--device default|cpu]
                   [-f/--filter RT|RTLightmap]
                   [--hdr color.pfm] [--ldr color.pfm] [--srgb] [--dir directional.pfm]
                   [--alb albedo.pfm] [--nrm normal.pfm] [--clean_aux]
                   [--is/--input_scale value]
                   [-o/--output output.pfm] [-r/--ref reference_output.pfm]
                   [-t/--type float|half]
                   [-w/--weights weights.tza]
                   [--threads n] [--affinity 0|1] [--maxmem MB] [--inplace]
                   [--bench ntimes] [-v/--verbose 0-3]
                   [-h/--help]

While the exact contents of the return may change we could still check and validate some of these results.

`DenoisedPathTracer` missing from Advanced tab

The ALBEDO and NORMAL renderers show up alongside the default PathTracingRenderer, but DenoisedPathTracer (mentioned in the readme) is nowhere to be seen.

obrazek

However, denoising still works (probably) as intended, since the render process starts out by first rendering the normal and albedo passes before anything else, and the denoised image can be found in the scene's snapshots folder:

obrazek

  • Chunky version: 2.4.4
  • Denoiser Plugin version: 0.4.0
  • OIDN package: oidn-1.4.3.x64.vc14.windows
  • Java version: 17.0.1.12 (Adoptium JDK)
  • JavaFX SDK version: 18.0.2
  • OS: Windows 10 Home x64 v1909 (build 18363.1556)

Add a tab to configure the denoiser

Configuration using the JSON config file is somewhat hard to get right by hand, so a tab in Chunky would be better.

That tab could also be used to toggle the normal map. Also, the SPP for albedo and normal maps could be configurable.

Save a denoised frame when clicking "Save current frame"

Currently, the denoiser only denoises the image after it has been rendered to the full configured SPP.

Originally raised by @NJDaeger:

I was wondering if that button could be changed to either save the denoised image by default or to give the option to save the denoised image vs the non denoised image
either that or another button be added into the denoiser tab to save the denoised version of the current frame
which would probably make more sense

Unpausing a render resets it

Paused a render to do something else on my computer, then when I unpaused it, it began re-rendering the normal and albedo (losing the 1k samples I had)

NoSuchMethodError - PictureExportFormat

.tiff - Render is denoised correctly once target SPP is reached and exported as .tiff

Enable Save beauty pass - We get the following error once target SPP is reached and it breaks Chunky (UI functions but no renderer can be reset/used):

Unchecked exception in render manager.
java.lang.NoSuchMethodError: 'void se.llbit.chunky.renderer.scene.Scene.saveFrame(java.io.File, se.llbit.chunky.renderer.export.PictureExportFormat, se.llbit.util.TaskTracker, int)'
	at de.lemaik.chunky.denoiser.DenoisedPathTracingRenderer.render(DenoisedPathTracingRenderer.java:90)
	at se.llbit.chunky.renderer.DefaultRenderManager.run(DefaultRenderManager.java:313)

Add NVidia AI denoiser support

As a user, I would like to have the option to use the NVidia AI denoiser instead of the Intel Open Image denoiser. The way the denoiser operates seems functionally similar except for the program command names (e.g. using -n for normal instead of -nrm) and taking .png images instead of .pfm images.

Resume scene / change Target SPP without re-rendering everything

Issue: Resuming a loaded scene (with albedo and normal map rendered) / changing the Target SPP on a completed render does not resume from current SPP. Rather it resets the render progress; Rendering the albedo & normal map and the image again.

Expected behaviour: Without the Desnoiser you can resume a render and/or change the Target SPP without resetting the render progress. Assuming the scene has not been changed.

Work around: Deselect the Denoiser Plugin and bake the render. Manually denoise using previously rendered albedo and normal maps.

(This is just a reminded. No rush)

The denoiser plugin does not support headless mode and will not be enabled 2.4+0.4.0-pre.1

Loading plugin: "chunky-denoiser.jar"
The plugin DenoiserPlugin was developed for Chunky 2.4.0-159-g8ed94bb7 but this is Chunky 2.4.0-183-gffad4f42 - it may not work properly.
The denoiser plugin does not support headless mode and will not be enabled.
Plugin loaded: DenoiserPlugin 0.4.0-pre.1

Headless denoising still not working. Was meant to be resolved with 0.4.0-pre.1.

Denoiser doesn't use RT preset with OpenImageDenoise

In OidnBinaryDenoiser, the command line arguments don't use the RT preset that OIDN supplies in the native API. The RT preset allows you to use a different denoising method that's better suited for ray / path tracing.

Possible solutions: Create a small wrapper of OIDN for chunky, to allow for you to set the denoising filter.

[2.5.0-snapshot] java.lang.NoSuchMethodError when using `DenoisedPathTracer`

Tested on 2.5.0-snapshot.186.gf0535f2 with #30

Select DenoisedPathTracer, hit Start

Unchecked exception in render manager.
java.lang.NoSuchMethodError: 'void se.llbit.chunky.renderer.scene.Scene.saveFrame(java.io.File, se.llbit.chunky.renderer.export.PictureExportFormat, se.llbit.util.TaskTracker, int)'
	at de.lemaik.chunky.denoiser.DenoisedPathTracingRenderer.render(DenoisedPathTracingRenderer.java:90)
	at se.llbit.chunky.renderer.DefaultRenderManager.run(DefaultRenderManager.java:313)

Crash with latest Chunky 2.5.0 snapshots

Render worker 6 crashed with uncaught exception.
java.lang.NoSuchMethodError: 'se.llbit.chunky.renderer.scene.Sky se.llbit.chunky.renderer.scene.Scene.sky()'
	at de.lemaik.chunky.denoiser.AlbedoRenderer$AlbedoTracer.trace(AlbedoRenderer.java:39)
	at se.llbit.chunky.renderer.scene.Scene.rayTrace(Scene.java:675)
	at se.llbit.chunky.renderer.PathTracingRenderer.lambda$render$0(PathTracingRenderer.java:92)
	at se.llbit.chunky.renderer.TileBasedRenderer.lambda$submitTiles$1(TileBasedRenderer.java:82)
	at se.llbit.chunky.renderer.RenderWorkerPool.work(RenderWorkerPool.java:141)
	at se.llbit.chunky.renderer.RenderWorkerPool.access$100(RenderWorkerPool.java:29)
	at se.llbit.chunky.renderer.RenderWorkerPool$RenderWorker.run(RenderWorkerPool.java:101)

`Denoise Current Render` issues

Tested on Chunky 2.4.0 with #30

Note, using default 16 SPP for Albedo and Normal maps. Opted to write this SPP as a number opposed to a variable to ease confusion.

Upon using Denoise Current Render:

  • If the current beauty pass SPP is 0 & albedo+normal are disabled - Renderer breaks at 0 of 16 ETA: Somelargenumber. Beauty pass SPP is also set to 16 SPP internally and the field needs to be refreshed. Advanced Tab Renderer is not updated and still shows PathTracingRenderer. Upon toggling/updating this tab it will show the actual Renderer as being DenoiserPasses.
  • If the current beauty pass SPP is 0 & albedo+normal are enabled - Only the Albedo is rendered and it is rendered to 16 SPP. Saved as <scene_name>-spp.png? This is the default snapshot format? Beauty pass SPP is also set to 16 SPP internally and the field needs to be refreshed. Same as the Renderer in the Advanced Tab.
  • If the current beauty pass SPP is at N & albedo+normal are disabled - Renderer breaks at 0 of 16 ETA: Somelargenumber. See above.
  • If the current beauty pass SPP is at N & albedo and/or normal are enabled - We get the (noisy) beauty pass saved at N spp at a certain time. We also get a denoised beauty pass at 16 SPP 20 minutes "before" the (noisy) beauty pass was made. eg- beauty pass completed 21:17. Denoised 20:57. -- This behaviour is repeatable. Beauty pass SPP is also set to 16 SPP internally and the field needs to be refreshed; Same as the Renderer in the Advanced Tab.

Key Issues:

  1. If the albedo and normal are disabled Denoise Current Render does not function correctly. We do not need any feature/auxiliary images to use OIDN.
  2. Selected Renderer is changed to DenoiserPasses but UI does not always reflect this and needs to be refreshed.
    a) Ideally the Renderer should default back to the original Renderer after the operation has completed.
  3. The Beauty pass Target SPP is set to match the Albedo/Normal map SPP (I assume it is the last one) and the UI does not reflect this and needs to be refreshed.
  4. Outputted (denoised) files lack any suffixes to identify them under

Extended issues:

This button does not address similar issues ( #13 #15 #27 ) and is regarded to be highly destructive to in progress renders and will overwrite render dumps. If the button is to be kept in it's current form we will need to implement a warning.

Starting render SPP 1 issue

When starting the render, if you disable the albedo map, and render the standard scene, chunky starts by rendering the first SPP of the normal map, but immediately after renders the path tracing scene.
After that, if you render the scene without the albedo map, Chunky starts by rendering the first SPP twice, and then it continues normally.
If you reenable the albedo map, chunky starts by rendering the first SPP of the path tracing render, before rendering the normal maps. Afterwards, if you start the render, it renders the first SPP of the normal map twice before proceeding.

When using `DenoisedPathTracer` only denoised is outputted to `snapshots`

Tested on Chunky 2.4.0 with #30

In past versions of the plugin both the beauty pass and the denoised beauty would be exported to snapshots. Currently, when using the DenoisedPathTracer Renderer only denoised beauties are outputted to snapshots. The option the Save beauty pass within the Denoiser Tab only applies to the beauty .pfm.There are a multitude of benefits from having the option to still export the noisy snapshots.

  1. #33 shows that denoising behaviour is mixed and that when using the Denoise Current Render button both the noisy and denoised beauty are snapshotted. Ideally we would want consistency with how denoising works.

  2. The options listed within the Denoiser Tab lack clarification as to what they do. Expanding the visible descriptions or adding tooltips would help clear things up.

  3. Disabling or redirecting inbuilt functionality without having an option to retain defaults and to export the denoised output with a suffix, as was done in the past with .denoised, should be avoided.

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.