Page MenuHome

Cycles: Replace ambient occlusion BSDF with a node that output a value
ClosedPublic

Authored by Lukas Stockner (lukasstockner97) on Jun 15 2018, 12:05 AM.

Details

Summary

This allows to use the output to influence other BSDFs, which has been requested for a long time.
Compatibility with the old node is preserved since value outputs connected to shader inputs now automatically get an Emission Closure for conversion.

There still are some things to do:

  • There's no GPU shader yet. I don't know whether that's possible, but we should look into it.
  • OSL isn't supported yet, maybe time for yet another texture name hack?
  • In some cases there is some clearly visible banding in the first few samples, which suggests a RNG problem.

One downside of this is that if there is an AO node and the AO pass is enabled, the two will no longer share the computation.

Also, for full compatibility, if there was something connected to the color input, a MixRGB node has to be inserted by versioning.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D3479
Build Status
Buildable 1757
Build 1757: arc lint + arc unit

Event Timeline

  • Keep Color input and add Color output, for convenience and backwards compat.
  • Default to Only Local, it's faster and sufficient for most cases.
  • Rename Radius to Distance.
  • Add OSL support. Quite ugly but we have no better solution in the OSL API.
  • Placeholder GPU shader for master, will need more work when merging into 2.8 for Eevee.
  • Don't use SVM AO code for global and baking AO. These support transparency which the new node does not, I prefer to keep that feature available at least for baking.
  • Remove VNDF code since sampling it is quite noisy and the discontinuous sampling is quite visible with low number of samples. I also don't see really bad artifacts when just sampling the hemisphere around the smooth normal.

Tested performance on CPU/CUDA GTX 1080, found no significant slowdown.

This revision is now accepted and ready to land.Jun 15 2018, 10:13 PM
This revision was automatically updated to reflect the committed changes.