AdamYuan / SparseVoxelOctree

A GPU SVO Builder using rasterization pipeline, a efficient SVO ray marcher and a simple SVO path tracer.
MIT License
606 stars 55 forks source link

I want to add tonemapper to code. Where to add? #21

Closed tigrazone closed 11 months ago

tigrazone commented 11 months ago

Where is in code now convert of hdr accumulated image to show to screen - is it right it is path_tracer_viewer_main.frag? I want to add tone mapper and save to ldr - to png, jpg. In which source code I must add my code? dep/MyVK/src/imgui/ImGuiRenderer.cpp have encoded code. Can you show source of this encoded code?

AdamYuan commented 11 months ago

It's in path_tracer_viewer_gen.frag i think:

// ...
    if (uViewType == 0) {
        vec4 color = imageLoad(uColor, ivec2(gl_FragCoord.xy));
        oColor = vec4(pow(color.xyz, vec3(1.0 / 2.2)), 1.0);
    } else if (uViewType == 1) {
// ...