Slow initialization in the rendered viewport after the default normal map added #97378
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#97378
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: Quadro RTX 3000 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.15
Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash:
c77597cd0e
Worked: (newest version of Blender that worked as expected)
Short description of error
slow initialization time in viewport rendering.mp4
The slow initialization in the rendered viewport occurs after the default normal map node was added in the Skin shader. (The Skin shader is very simple - it contains just a Principled BSDF and Material Output.) I have tried both CUDA and Optix, and the slow initialization exists in both cases after the default normal map node added.
Exact steps for others to reproduce the error
Sample to test slow initialization in viewport rendering.blend
Steps to reproduce the bug:
1, Download the sample file and open Blender;
2, Select the mesh, and go to the Sculpting mode, and then under the "Remesh" tab change the Voxel Size from 0.4 m to 0.004 m, or even smaller value if your computer can handle. Click "Remesh".
3, Then click the rendered preview. You will find that the higher the poly-count, the slower initialization speed.
4, Go to the Shading mode, and remove the Normal Map, and click the rendered preview. Your initialization speed returns to normal, even if the poly-count is high.
Added subscriber: @Stay_Here
Added subscriber: @LukasStockner
If the issue can't be reproduced with another file, here are some things you can check to narrow it down a bit:
The task has been updated, and a sample file has been uploaded and the steps to reproduce the bug are included.
This problem has something to do with the poly-count of the mesh.
To answer your questions:
Thank you!
Thanks for the info!
Turns out that the slowdown is the tangent space computation. The reason for the slowdown when adding the node is that the Normal Map node requires tangents to operate. In an F12 render, the shader graph would be optimized, and the unconnected node would be removed. However, for viewport renders, this optimization is not performed. This is on purpose: Otherwise, you'd end up in a situation where e.g. changing a mix factor from 0 to 0.1 would trigger a complete rebuild since a branch of the shader just "came alive". Therefore, interactiveness is prioritized over startup time.
You can verify this by connecting the Normal Map node to the shader: Now an F12 render also takes longer.
I've added some optimizations in D14675 to speed this up a bit, but some level of slowdown is expected here unfortunately.
Thank you for your explanation!
In the sample file, after remeshing the cube with the voxel size from 0.4 m to 0.004 m to get 1.5 M vertices, my render result after pressing F12 is:
Unconnecting the Normal Map node: 10.10 s
Connecting the Normal Map node to the Normal on Principled BSDF: 18.01 s
Thanks again!
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @PratikPB2123