Page MenuHome

Fix: wrong material preview colors for the cycles normalmap node
Closed, ResolvedPublic


System Information

Blender Version
all so far

Short description of error
The normalmap node in cycles produces a different result for the glsl material preview.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

  1. open
  2. set the left viewports shading mode to rendered
  3. try different space modes in the normalmap node
  4. change the strength of the normalmap node
  5. disconnect the texture input and change the input color
  6. apply
  7. repeat 1-5

One thing I couldn't wrap my head around is the movement of some regions in the tangent space colors when the viewport is rotated. That is probably a limitation of the current shading system? Anyways - the attached patch is already very close to the rendered output, so I am proposing it now. :)



Event Timeline

Ralf Hölzemer (cheleb) set Type to Bug.
Ralf Hölzemer (cheleb) created this task.
Ralf Hölzemer (cheleb) raised the priority of this task from to Needs Triage by Developer.
Sergey Sharybin (sergey) triaged this task as Normal priority.

This indeed makes viewport match the render which is nice. However, can see there's a flipped y now in color_to_normal(). That was an intentional flip for the BI. Does it introduce shading regressions in BI?

@Brecht Van Lommel (brecht), @Alexander Romanov (a.romanov), you would probably want to have a look into this patch a well.

Yes, there are regressions, try .blend form D1120. I think it is better to use GPU_material_use_new_shading_nodes to detect Cycles/BI.

Hey guys,

sorry for the late reply. I totally forgot to test BI with this patch. Attached is a new patch which combines the old behavior for BI and the previous patch, and a test scene based on the scene in D1120.
There is still something funky going on with the tangents in the cycles nodes, but the rest seems to work fine now.