[Bf-blender-cvs] [a99e1c1a038] cycles_path_guiding: Merge branch 'master' into cycles_path_guiding

Brecht Van Lommel noreply at git.blender.org
Mon Aug 15 14:25:41 CEST 2022


Commit: a99e1c1a038c31ac3841a9a028c1863ca92e4bdf
Author: Brecht Van Lommel
Date:   Mon Aug 15 13:59:02 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rBa99e1c1a038c31ac3841a9a028c1863ca92e4bdf

Merge branch 'master' into cycles_path_guiding

===================================================================



===================================================================

diff --cc intern/cycles/integrator/path_trace.h
index 82f8862636c,59382b51d23..2efd6ecf61f
--- a/intern/cycles/integrator/path_trace.h
+++ b/intern/cycles/integrator/path_trace.h
@@@ -280,22 -262,9 +281,25 @@@ class PathTrace 
    /* Denoiser which takes care of denoising the big tile. */
    unique_ptr<Denoiser> denoiser_;
  
+   /* Denoiser device descriptor which holds the denoised big tile for multi-device workloads. */
+   unique_ptr<PathTraceWork> big_tile_denoise_work_;
+ 
 +#ifdef WITH_PATH_GUIDING
 +  /* Guiding related attributes */
 +  GuidingParams guiding_params_;
 +
 +  /* The guiding field which holds the representation of the incident radiance field for the
 +   * complete scene. */
 +  unique_ptr<openpgl::cpp::Field> guiding_field_;
 +
 +  /* The storage container which holds the training data/samples generated during the last
 +   * rendering iteration. */
 +  unique_ptr<openpgl::cpp::SampleStorage> guiding_sample_data_storage_;
 +
 +  /* The number of already performed training iterations for the guiding field.*/
 +  int guiding_update_count = 0;
 +#endif
 +
    /* State which is common for all the steps of the render work.
     * Is brought up to date in the `render()` call and is accessed from all the steps involved into
     * rendering the work. */
diff --cc intern/cycles/kernel/closure/bsdf.h
index e1eda577a82,d6b7e7bfa88..1bb7f2f0591
--- a/intern/cycles/kernel/closure/bsdf.h
+++ b/intern/cycles/kernel/closure/bsdf.h
@@@ -105,10 -105,7 +105,9 @@@ ccl_device_inline int bsdf_sample(Kerne
                                    float randv,
                                    ccl_private Spectrum *eval,
                                    ccl_private float3 *omega_in,
-                                   ccl_private differential3 *domega_in,
 -                                  ccl_private float *pdf)
 +                                  ccl_private float *pdf,
 +                                  ccl_private float2 *sampled_roughness,
 +                                  ccl_private float *eta)
  {
    /* For curves use the smooth normal, particularly for ribbons the geometric
     * normal gives too much darkening otherwise. */
@@@ -117,355 -114,80 +116,133 @@@
  
    switch (sc->type) {
      case CLOSURE_BSDF_DIFFUSE_ID:
-       label = bsdf_diffuse_sample(sc,
-                                   Ng,
-                                   sd->I,
-                                   sd->dI.dx,
-                                   sd->dI.dy,
-                                   randu,
-                                   randv,
-                                   eval,
-                                   omega_in,
-                                   &domega_in->dx,
-                                   &domega_in->dy,
-                                   pdf);
+       label = bsdf_diffuse_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
 +      *sampled_roughness = make_float2(1.0f, 1.0f);
 +      *eta = 1.0f;
        break;
  #ifdef __SVM__
      case CLOSURE_BSDF_OREN_NAYAR_ID:
-       label = bsdf_oren_nayar_sample(sc,
-                                      Ng,
-                                      sd->I,
-                                      sd->dI.dx,
-                                      sd->dI.dy,
-                                      randu,
-                                      randv,
-                                      eval,
-                                      omega_in,
-                                      &domega_in->dx,
-                                      &domega_in->dy,
-                                      pdf);
+       label = bsdf_oren_nayar_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
 +      *sampled_roughness = make_float2(1.0f, 1.0f);
 +      *eta = 1.0f;
        break;
  #  ifdef __OSL__
      case CLOSURE_BSDF_PHONG_RAMP_ID:
-       label = bsdf_phong_ramp_sample(sc,
-                                      Ng,
-                                      sd->I,
-                                      sd->dI.dx,
-                                      sd->dI.dy,
-                                      randu,
-                                      randv,
-                                      eval,
-                                      omega_in,
-                                      &domega_in->dx,
-                                      &domega_in->dy,
-                                      pdf,
-                                      sampled_roughness);
 -      label = bsdf_phong_ramp_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
++      label = bsdf_phong_ramp_sample(
++          sc, Ng, sd->I, randu, randv, eval, omega_in, pdf, sampled_roughness);
 +      *eta = 1.0f;
        break;
      case CLOSURE_BSDF_DIFFUSE_RAMP_ID:
-       label = bsdf_diffuse_ramp_sample(sc,
-                                        Ng,
-                                        sd->I,
-                                        sd->dI.dx,
-                                        sd->dI.dy,
-                                        randu,
-                                        randv,
-                                        eval,
-                                        omega_in,
-                                        &domega_in->dx,
-                                        &domega_in->dy,
-                                        pdf);
+       label = bsdf_diffuse_ramp_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
 +      *sampled_roughness = make_float2(1.0f, 1.0f);
 +      *eta = 1.0f;
        break;
  #  endif
      case CLOSURE_BSDF_TRANSLUCENT_ID:
-       label = bsdf_translucent_sample(sc,
-                                       Ng,
-                                       sd->I,
-                                       sd->dI.dx,
-                                       sd->dI.dy,
-                                       randu,
-                                       randv,
-                                       eval,
-                                       omega_in,
-                                       &domega_in->dx,
-                                       &domega_in->dy,
-                                       pdf);
+       label = bsdf_translucent_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
 +      *sampled_roughness = make_float2(1.0f, 1.0f);
 +      *eta = 1.0f;
        break;
      case CLOSURE_BSDF_REFLECTION_ID:
-       label = bsdf_reflection_sample(sc,
-                                      Ng,
-                                      sd->I,
-                                      sd->dI.dx,
-                                      sd->dI.dy,
-                                      randu,
-                                      randv,
-                                      eval,
-                                      omega_in,
-                                      &domega_in->dx,
-                                      &domega_in->dy,
-                                      pdf,
-                                      eta);
 -      label = bsdf_reflection_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
++      label = bsdf_reflection_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf, eta);
 +      *sampled_roughness = make_float2(0.0f, 0.0f);
        break;
      case CLOSURE_BSDF_REFRACTION_ID:
-       label = bsdf_refraction_sample(sc,
-                                      Ng,
-                                      sd->I,
-                                      sd->dI.dx,
-                                      sd->dI.dy,
-                                      randu,
-                                      randv,
-                                      eval,
-                                      omega_in,
-                                      &domega_in->dx,
-                                      &domega_in->dy,
-                                      pdf,
-                                      eta);
 -      label = bsdf_refraction_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
++      label = bsdf_refraction_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf, eta);
 +      *sampled_roughness = make_float2(0.0f, 0.0f);
        break;
      case CLOSURE_BSDF_TRANSPARENT_ID:
-       label = bsdf_transparent_sample(sc,
-                                       Ng,
-                                       sd->I,
-                                       sd->dI.dx,
-                                       sd->dI.dy,
-                                       randu,
-                                       randv,
-                                       eval,
-                                       omega_in,
-                                       &domega_in->dx,
-                                       &domega_in->dy,
-                                       pdf);
+       label = bsdf_transparent_sample(sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
 +      *sampled_roughness = make_float2(0.0f, 0.0f);
 +      *eta = 1.0f;
        break;
      case CLOSURE_BSDF_MICROFACET_GGX_ID:
      case CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID:
      case CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID:
      case CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID:
-       label = bsdf_microfacet_ggx_sample(kg,
-                                          sc,
-                                          Ng,
-                                          sd->I,
-                                          sd->dI.dx,
-                                          sd->dI.dy,
-                                          randu,
-                                          randv,
-                                          eval,
-                                          omega_in,
-                                          &domega_in->dx,
-                                          &domega_in->dy,
-                                          pdf,
-                                          sampled_roughness,
-                                          eta);
 -      label = bsdf_microfacet_ggx_sample(kg, sc, Ng, sd->I, randu, randv, eval, omega_in, pdf);
++      label = bsdf_microfacet_ggx_sample(
++          kg, sc, Ng, sd->I, randu, randv, eval, omega_in, pdf, sampled_roughness, eta);
        break;
      case CL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list