Page MenuHome

Cycles: More flexible GI Approximation AO distance control
ClosedPublic

Authored by Sergey Sharybin (sergey) on Aug 3 2021, 12:36 PM.

Details

Summary

The goal: allow to easily use AO approximation in scenes which combines
both small and large scale objects.

The idea: use per-object AO distance which will allow to override world
settings. Instancer object will "propagate" its AO distance to all its
instances unless the instance defines own distance (this allows to
modify AO distance in the shot files, without requiring to modify props
used in the shots.

Diff Detail

Repository
rB Blender
Branch
cycles_object_ao_distance (branched from master)
Build Status
Buildable 16208
Build 16208: arc lint + arc unit

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.Aug 3 2021, 12:36 PM
Sergey Sharybin (sergey) created this revision.
  • Support split kernel
  • Gray out object GI panel when scene GI is disabled

The benchmark doesn't make me excited:

                                         master               new
barbershop_interior                      108.9230s            108.8810s
bmw27                                    20.7864s             20.6875s
classroom                                59.9108s             59.4715s
junkshop                                 40.0827s             40.0591s
monster                                  85.1941s             86.2019s
pabellon                                 26.7460s             26.7772s

1% in the monster scene seems a bit too much.
Maybe there is something we can do to mitigate this, or maybe we don't
consider it a stopper (especially if in the Cycles X the impact will be
lower due to different kernel organization?)

Sergey Sharybin (sergey) edited the summary of this revision. (Show Details)Aug 3 2021, 6:10 PM

Use more clear naming which object is expected to be.

Additionally, did a quick test with Cycles X:

                                         cycles-x             new                  
barbershop_interior                      13.6263s             13.5964s             
bmw27                                    9.0782s              8.9319s              
classroom                                17.1637s             17.1616s             
junkshop                                 18.2349s             18.2742s             
monster                                  9.1487s              9.1452s              
pabellon                                 7.8236s              7.8405s

Think it is acceptable timing.

Brecht, one confusing thing is that sometimes we use sect->object and
sometimes intersection_get_object (which does object lookup from a
primitive when object is OBJECT_NONE). Guess the latter one is what we
should be using?

Use sd->object instead of isect->object resolving the following:

  • Makes sure that the object is always properly intialized (shader data does lookup of an object from primitive when needed).
  • Resolves speed regression with the monster scene:
                                         master               new
barbershop_interior                      108.0730s            108.6620s
bmw27                                    20.6307s             21.0102s
classroom                                59.6964s             59.8473s
junkshop                                 40.1238s             40.1425s
monster                                  85.7865s             85.5697s
pabellon                                 26.7905s             26.9822s

The shader data is re-used between volume and surface, but in the main
integration loop the shader data is initialized for surface after it is
used for volume, so seems that this is valid to use shader data to know
last object.

This revision is now accepted and ready to land.Aug 4 2021, 4:43 PM