When animating a mixnodes mix property and hitting 0 or 1, the shader recompiles #105057
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105057
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: win10
Graphics card: 3060 rtx
Blender Version
Broken: this has been that way for some time since around 3.4 alpha i think
Short description of error
When animating a mixnode's mix property with 2 textures connected and hitting 0 or 1 to switch these etxtures, the shader kinda recompiles.
When you are playing the scenes in rendered or preview mode, this will give some frame dropping/jankyness and the object will flash with a white material.
Hi, thanks for the report. Can you share .blend file where this happens? I'm not able to repro this reliably.
Does this happen every time you switch mix node factor?
It sounds logical if this is a consequence of greedy optimization through inline node values.
No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.
Thanks again for the report. If the problem persists please open a new report with the required information.
This is a 100% reproducable. Dont close.
Here, I attached a Demo file of the issue. It gets worse if there are a ton of other objects in the scene and Eevee is closer to maxing out. But its visible in this demo too.
Go into rendered mode and hit play, when the mixnode keyrames reach 0 or 1 there can be a flicker and the image plane gets white/grey like an object with default material for a few frames.
Play the scene on loop as its not consistent. Sometimest the compilation happens before the next frame and you cant see it, sometimes its slower and the material flashes white/grey.
It also breaks viewport animation rendering because these glitches are saved into the rendered image.
It also causes a performance degredation in playback! There are framerate dips when an animated scene is highly populated. I optimize the scenes so they run in 24fps in the viewport but this shader recompiling causes a dip in an otherwise perfectly playing scene.
For an just eevee guy like me who wants to render his cartoons, this is pretty bad. It only began some recent time ago , like i said , around 3.4 alpha.
I think this should be set to important instead of being closed. It breaks the whole viewport experience for me (in scenes where i use extensive texture animation)
EDIT: maybe this only happens on materials with alpha ... Ill check it out tommorrow.
This indeed seems to be due to optimization, where if factor is 1, the input is essentially not present.
Since the issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors.
For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests
For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug
it causes unpredictable visual glitches in render output and preview
it causes framerate dips and lagging in animation playback
this isnt just my usecase, blending normalmaps or texture maps for destruction models, whenever a mixnode hits 0 or 1, a shader will recompile.
dont you think this qualifies as a bug? graphical glitches in a graphics programs output ?
from a programmers viewpoint it might not technically be a bug , but from a graphics designers viewpoint its worse than a program crash.
especially since this is rather new behaviour and was not present and working just fine before 3.4 or 3.3.
@Ulf3000 With 3.3 I can't open this file, can you provide example that works with that version? If this is regression, I can bisect this so I can look if this was intentional change or not.
EEVEE : When animating a mixnodes mix property and hitting 0 or 1, the shader recompilesto When animating a mixnodes mix property and hitting 0 or 1, the shader recompilesHeres a file made for 3.3. Everything is smooth and looks great.
I had to replace the MixRGB nodes. Files saved with blender 3.4+ opened in blender 3.3- will not detect the new mix node. The mix node is not backwards compatible! (i guess thats unwanted behaviour )
So yeah thats when the new mix node was programmed, around alpha 3.4.
I´d be happy with the old behaviour, but i would suggest that mixnodes with keyframes or drivers are just treated and compiled with 2 channels all the time.
Being recompiled while in playback doesnt make sense for any material anyways though.
Being asynchrounous means many shader recompilations come in too late by default and create visual glitches not matter what triggered the recompilation.
Thanks for the file. This behabior was introduced in
6d7a067a83
and it is clearly intentional. However I can't tell whether the effects of this change are as desired. I would expect a previously used shader to be cached and ready to be reused quickly.@pragma37, @fclem can you check?
Yes, this was indeed intentional although I wasn't aware of the playback issue.
There's a simple fix for it, but it can cause small hiccups when the shader cache gets garbage collected, so I'd like to improve the shader GC behavior as well.
Miguel Pozo referenced this issue2023-03-31 15:14:01 +02:00
@Ulf3000
Could you double check this? I can't reproduce it myself and looking at the code I don't see how it could actually happen.
For actual viewport playback, there's no good way to go back to the old behavior without introducing other regressions. The improved GC behavior helps, but doesn't fully solve it.
I'd suggest you to use object attributes for the animated mix factors, so the inactive nodes can't be optimized out and cause a recompilation.
Like this:
In the end, we have decided that blocking the scene playback for shader compilation could cause more harm than good.
The improved GC behavior helps, but the best "fix" is to use object attributes for the animated mix factors.
no i connot confirm, i now tried with multiple scenes and they all rendered correctly , maybe it was just one or versions inbetween which did that.
Imagine loading a scene, switch to render / lookdev shading mode, hitting play, then your screen freezes until all shaders are compiled.
thats notthe problem , but in animation work you have to watch everything in loop... imagine people who use switching textires for their characters face and cant even evaluate the animation because the head turns white/grey/unshaded on every new facial expression.
for other people who might find this through google though:
i found a better fix though(something which doesnt force you to use multiple settings panels), or maybe not better but easier to handle for the artist.
just use a value node and a clamp at a really low value aka 0.001, the alpha channel from the 0.001 doesnt seem to create artifacts, it looks exactly like 0.
with clamp
without clamp
If you prefer to only use nodes, simply connecting a Value node to the Factor input should do the trick too.