Blender Foundation Work for 2021
July 5th - 9th
Worked on fixing the depth issues with PMJ sampling T79190. It appears the the samples used for each dimension are correlated. To help investigate these I added a number of different sampling methods
- QMC Sobol with Xor scrambling
- QMC Sobol with Owen scrambling
Then to check the pixel hash was not causing issues I added 2 pixel hashes. Next I added Owen shuffling to add more variation to the sample set. So as to be able to experiment with these I add some extra items to the UI so as to be able to combine the various options.
These changes can be found in D11869 Looked over upcoming patch for
- Animation De-noising D11442
And discussion and ideas regarding
- Apple Metal support
- Path Guiding
Aug 9th - 13th
Back from vacation and worked to catch up with how things have developed over the previous weeks. Worked on cleaning up the PMJ sampling patch and also removing any experimental code. The change increases the number of samples that can be drawn from the PMJ sample sets, so that it takes longer to fall back to random sampling which should improve the convergence. Also, selected to use the Tong hash on the pixels so as to avoid any clashes with the same hash being used for other purposes. The PMJ sampling now uses an Owen shuffle along the x and y axes to vary the 2D samples which should provide a good deal of variation between the sample sets used with each pixel and dimension. 1D samples are drawn from the both the x and y dimensions of the sample sets to make better use of the sets. Started integrating these changes into the cycles x branch and working on extending the PMJ sampler to produce a much larger number of samples.
Aug 16th - 20th
- Worked on adding infinite sample count to existing PMJ method for master and cycles-x branches
- Looked at the changes AMD have made in their Blender repo for HIP
- Went over HIP documentation to get a better understanding of it
- Attempted to setup up the HIP dev environment on my machine
- Analysed some pending commits (in preparation for accepting more changes) to get a feel for what is expected
- Analysed the changes in the cycles-x branch w.r.t. master branch
Aug 23rd - 27th
- Analysed various methods of extending PMJ to an effectively infinite sample count using
- Owen shuffling
- XOR shuffling
- Cranley Pattersion Rotation (CPR)
- Created patches for master and cycles-x branches for the above PMJ changes
- Reduced the number sample patterns to use less memory than previous PMJ
- Examined the AMD hip repo and commits
- Reviewed some basic changes
Aug 30th - Sept 3rd
- Further iterations on fixing the PMJ method working towards removing some of the noise by limiting the CPR displacement amounts to only be within the PMJ cells/intervals
- Investigated using micro jittering with PMJ to speed up GPU and possibly CPU rendering. This seemed to work to speed up rendering with relatively minor changes to the new PMJ algorithm. However, the pixels are highly correlated which does not produce a good image with a low number of samples.
- Looking into the Animation Denoising D11442 but need to wait on other changes before this can be finished.
- Looked into a bug in the volumetric rendering that has been pointed out, but I don't have a solution yet.
- Reviewed and committed some changes for viewport navigation resolution selection.
Sept 6th - Sept 10th
- Started working on removing ray offsetting to remove artefacts when rendering instanced objects D6250.
- Further examination of volumetric rendering bug seems related to the ray intersection code.
- Reviewed some patches relating to cycles.
- Looked into updating the PMJ sampler to use scrambling distance.
Sept 13th - Sept 17th
- Continued working on removing ray offsetting to remove artefacts when rendering instanced objects D6250
- The black likes are largely fixed on the test scenes
- Still getting some issues with shadow rays due to lack of offsetting
- Noticed crash bug when switching rendering devices and created a fix D12498 but it was not used in the end
- Writing documentation for the sampling in Cycles in particular the new PMJ sampler mentioned above.
- Analysed some bugs: T89353 T80267
- Reviewed cycles related patches such as D12316 D12514 D12511
Sept 20th - Sept 24th
- Further work on removing ray offsetting the Dynamic BVH is now working but the static BVH ids don't appear to be working
- Fixed correlation issue with PMJ sampler D12610
- Updated PMJ docs
- Reviewed cycles diffs such as D12578 D12318
- Further investigated Distance scrambling on PMJ w.r.t. the issues found in D12610 which necessitates a differnt approach.
Sept 27th - Oct 1st
- Reviewed cycles diffs
- D12593 PMJ02 Sample generation was generating PMJ samples instead of PMJ02 samples. Also noticed that the cmj random number generator has issues with filling out the pmj02 table. Sometimes it never completes, switching to use drand48() help improve this but it still occurs. The float precision may make it hard to generate samples in small gaps. We may need to alter the PMJ02 sample generation to produce a more balanced tree. Below are some convergence results of pmj02 versus the other methods.
- Continuing work on D6250
- Static BVH currently has different prim or object ids than the dynamic which makes solution only work in the dynamic case.
- For the static BVH the object id is always 0, the object id can be retrieved via __prim_object. However, the rest of cycles expects this to be OBJECT_NONE or weird shading happens. So added code to handle this within the scene intersection tests.
- Performance has dropped due to these changes, the code need to be refactored a bit to reduce the amount of tests and memory access.
- Working on fixing all static BVH scenes
|CUDA static||CUDA Error|
|Optix static||CUDA Error|
- There is now a CUDA Error when rendering static scenes with both Optix and CUDA the glitch scene seems to have this
- Adjacent triangles seem to cause and issue which is probably caused by the triangle intersection routine including all edges in the intersection
- There are precision issues in enlarged scenes I believe caused by issues handling the distance along the ray that needs investigation
Oct 4th - Oct 8th
- Trip to Blender HQ in Amsterdam to meet everyone and discuss working at Blender
- Patches reviewed and submitted
- Continued working on D6250
- Optix has an issue with back facing surfaces
- Working on mesh related issues due to close proximity caused by triangle mesh edges. This appears to be because the distance values are compared in camera world space and not the object world space. This is most obvious at really small scales see below for 1e-5 scale.
- Setup AMD GPU on machine (trying a dual GPU setup with Nvidia and AMD GPUs)
- Investigated T92036 It seems the magic texture default input is producing NaNs on GPU but not on CPU causing blackness
Oct 11th - Oct 15th
- Fix for Black volume when using Magic Texture T92036
- Fix for assert when baking with debug build D12767
- Found and helped fix (mostly Sergeys' work) D12853
Work in progress
Added PMJ scrambling distance patch which applies the distance scrambling to the PMJ sampler which is based on Micro-Jittered sampling. This basically works by using the same sample set for each pixel so there is a lot a coherency between the pixels. This coherency results in a speed increase especially on GPUs. To counteract this there is a user controlled random displacement that can be applied to decorrelate the samples. The results proved to be quite good.
The correlation is more obvious with lower samples and is also somewhat scene dependent. For instance the cobwebs in the barbershop really showed up the correlation even with high number of samples.
Some scenes worked really well such as the junk shop below is a table of increasing sample counts for PMJ and PMJ with distance scrambling
Distance Scrambled PMJ
Continue working on removing ray offsetting
- Reviewed some papers and books w.r.t. to ray tracing robustness
- Ray Tracing Gems I
- Ray Tracing Gems II
- Improving Ray Tracing Precision by Object Space Intersection Computation
- Trying using double instead of float to preserve the distance along the ray
- The Optix issue is now fixed :-) but I found another issue that seems to happen .
Oct 18th - Oct 22nd
- Reviewed D12880 Cycles:bake transparent shadows for hair
- Reviewed D12888 Cycles:replace integrator state argument macros
- Reviewed D12889 Cycles: decouple shadow paths from main path on GPU
Work in Progress
- Worked on fixing Optix issue managed to isolate it to a single triangle it seems the rays are getting shot from the wrong side of the surface but only on Optix. This was down to 2 reasons
- Optix __anyhit__ function was disabled in certain scenarios
- prim variable was not always filled out due to being inside a #ifdef that for some reason I did not notice :-(
- Almost there now got volume rendering working again :-)
- Working on improving the precision of intersections
- Performance results for the barbershop scene
|Platform||Ray Offsetting||No Ray Offsetting||% Slower|
- There are still some differences probably due to the curves in the scene as that does not correctly support no offsetting yet :-)
Oct 25th - Oct 29th
Work in progress
- Worked on centring objects around the origin during BVH generation to improve floating point resolution helping small scenes appear less cracked
- Updated https://developer.blender.org/D12318 so that is chooses a valid tile size