Baking normal maps with Cycles and Open Shading Language enabled is broken.
Closed, ResolvedPublic

Description

System Information
CPU: Intel i7 870 2.93 GHz
RAM: 16 GB
GFX: NVIDIA Geforce GT 420
OS: Windows 7 Home 64 bit
Drivers: NVIDIA 9.18.13.4752

Blender Version
Blender: 2.79c 5e9132b Release Candidate 2017-08-01 17:31

Short description of error
Baking normal maps with Cycles and Open Shading Language enabled gives blank normal map.

Exact steps for others to reproduce the error

  • Open the file OSLTest.blend
  • In the Render panel press 'Bake' (with bake type 'Normal') -> a correct normal map is baked.
  • Now enable 'Open Shading Language' in render settings.
  • Press 'Bake' again -> the normal map is rendered but remains blank. I guess this is a bug. (Note that the project does not actually use any OSL, checking the options is enough for the bug to appear.)

The same happens with Blender 2.78 (official)

Details

Type
Bug
Dalai Felinto (dfelinto) triaged this task as "Confirmed" priority.

To be clear, OSL baking works fine. The issue is that "Displacement" normal map baking doesn't work with OSL.

For the records here is an example of normal map baking working fine when not using the displacement socket:

When you turn on OSL all the nodes are replaced by their OSL counterpart. Even if you are not using the (OSL) Script node.

@Brecht Van Lommel (brecht) do you have any clues on what is happening here? (original OSLTest.blend, not this OSLTest2.blend)

I must have tried with an old Blender, my bad. Thanks brecht