Page MenuHome

Cycles: Add bump-map shadow terminator softening term
ClosedPublic

Authored by Lukas Stockner (lukasstockner97) on Aug 2 2019, 5:31 AM.
Tags
None
Tokens
"Like" token, awarded by duarteframos."Party Time" token, awarded by gab3d."Love" token, awarded by jonathanl."Love" token, awarded by SecuoyaEx."Like" token, awarded by billreynish."Like" token, awarded by YAFU."Love" token, awarded by marcog.

Details

Summary

This is an alternative to D4459 that was presented at Siggraph today.

See the paper for comparisons between the two approaches.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Aug 2 2019, 11:26 AM

Did not test yet, but looks great in the paper.

intern/cycles/kernel/closure/bsdf.h
450

To optimize the the non-bump case and handle transmission, this could be:

else if (label & LABEL_DIFFUSE) {
  if (sc->N != sd->N) {
    *eval *= bump_shadowing_term((label & LABEL_TRANSMIT)? -sd->N : sd->N, sc->N, *omega_in);
  }
}
This revision now requires changes to proceed.Aug 2 2019, 11:26 AM

You beat me to this! :)

Seems to work as intended:

I'll commit this with the changes for transmission.

This revision is now accepted and ready to land.Sep 8 2019, 3:52 PM

This breaks OpenCL with the following error:

OpenCL build failed with error CL_BUILD_PROGRAM_FAILURE, errors in console.
OpenCL program split_shadow_blocked_dl build output: source/kernel/closure/bsdf.h:449:5: error: statement requires expression of scalar type ('int __attribute__((ext_vector_type(3)))' (vector of 3 'int' values) invalid)
    if (sc->N != sd->N) {
    ^   ~~~~~~~~~~~~~~
1 error generated.

I uploaded my sample file if someone needs it in the future for regression testing.