Page MenuHome

Huge performance drop with Eevee under certain conditions
Closed, InvalidPublic

Description

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.67

Blender Version
Broken: version: 2.80 (sub 59), branch: Unknown, commit date: Unknown Unknown, hash: rBUnknown
Worked: (optional)

Short description of error
Eevee is very slow under unexpected conditions.

Exact steps for others to reproduce the error
In the attached scene, rendering with Eevee is slow (press spacebar to playback and see the fps in the top left corner).
Open this blend and switch to render mode. It contains 5 coconut trees only.

Weirdly, by doing one of the following operation listed below, the fps suddenly jumps from 4fps to 40-60fps.

  1. Unplug the "Normal Map" node on the right from the "Diffuse BSDF" node next to it.
  2. Remove the "coconut_trunk" material slot from the active object, the palms. Note this material is useless, it's not assigned to any faces. However it seems it's still evaluated in the loop, causing important slowdown.
  3. Remove the "Wave" modifier from all palms objects.

Event Timeline

lucas veber (lucky3) updated the task description. (Show Details)

Yeah, i can reproduce the issue

Ovionis (Phigon) added a comment.EditedMay 15 2019, 12:10 AM

The Normal Map has a performance leak on dense meshes, and leaks even if said mesh, does not have the material with it assigned to anything.

I increased my fps (with my scene) in eevee from 3 fps to around 30 fps, by muting the normal map node from their materials.
There were no textures in it, it was just there to make adding a texture faster if I needed to.

Sebastian Parborg (zeddb) lowered the priority of this task from 90 to 50.

As a temporary workaround, we use a script to mute the normal nodes, which gives regular viewport performance and another to un-mute the nodes later for rendering:

Mute Nodes:

import bpy
for mat in bpy.data.materials:
    mat_node = mat.node_tree.nodes
    for node in mat_node:
        if isinstance(node, bpy.types.ShaderNodeNormalMap):
            node.mute = True

Un-Mute Nodes

import bpy
for mat in bpy.data.materials:
    mat_node = mat.node_tree.nodes
    for node in mat_node:
        if isinstance(node, bpy.types.ShaderNodeNormalMap):
            node.mute = False
Clément Foucault (fclem) changed the task status from Unknown Status to Unknown Status.Jun 17 2019, 10:32 AM

This is because we recalculate the tangent space if the mesh changes. There is no workaround because normalmaps uses it. Realtime engines assume the tangents do not change and use GPU skinning, 2 things we cannot do in a program in blender (at least without special cases that are going to tangle everything).

Made an add-on that does the toggling, aptly named: Toggle Normal Maps
https://github.com/theoldben/ToggleNormalMaps

lucas veber (lucky3) added a comment.EditedSep 4 2019, 11:04 AM

Made an add-on that does the toggling, aptly named: Toggle Normal Maps
https://github.com/theoldben/ToggleNormalMaps

Thanks for sharing!

Realtime engines assume the tangents do not change and use GPU skinning

@Clément Foucault (fclem) Are there any plans for such optimizations? Would be a game changer, even if it's scheduled for Blender 3.0. Thanks for your work!

There has been an alternate solution suggested here:
https://blenderartists.org/t/way-faster-normal-map-node-for-realtime-animation-playback-with-tangent-space-normals/1175379/3

We made an addon to replace Normal Map Nodes with the above-mentioned setup and return them back to normal with a toggle button for render time.
This add-on is available free of charge here:
https://github.com/theoldben/BlenderNormalGroups

Thanks a lot for mentioning it, this is more than welcome! Will make happy thousand of users.