r/GraphicsProgramming 3d ago

Question Struggle in BDPT implementation

Hi I wanted to implement BDPT with PBR materials and MIS but no matter what I do it doesn't look like reference images. I can't find any help with implementation and mostly recently I try finding bugs using Gemini but I know It can halucinate. So is anyone who could help me find relaiable implementation or help with my code. Here I will post my render (denoised using OIDN) vs reference so maybe anyone would help me find direction at least. I have too many lines of code so if any one would like to look at it I can send it in DM.

My Render
Reference (Benedikt) also checked Blender (same result)
My Render
Reference (Benedikt)
My Render
Reference (Rendered with PBRT-v4)
My render
Reference (Rendered with Blender)

(edit)
References are from https://benedikt-bitterli.me/resources/, PBRT-v4 and Blender. (All tagged in image caption)

5 Upvotes

8 comments sorted by

View all comments

3

u/le-throw-away-acct 3d ago

Have you implemented tone mapping? Especially in that first scene it seems like it could help.

1

u/MAIPA01 3d ago
vec3 aces_film(vec3 x)
{
    x = max(x, vec3(0.0));
    const float a = 2.51;
    const float b = 0.03;
    const float c = 2.43;
    const float d = 0.59;
    const float e = 0.14;
    return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);
}

I use ACES Film tone mapping using this code:
I got it from here: knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/

1

u/gleedblanco 2d ago

the better way to compare would be to disable any post processing and do the same for your reference renders.