Eevee: Modulo node behaves unexpectedly/inconsistently #68687
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#68687
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
Windows 10 Professional (x64) Version 1903 (build 18362.267)
Graphics: Intel(R) HD Graphics 630
Blender Version
v2.80.75
Here is an attached blend file that illustrates the issue (visible in render preview as you switch between eevee and cycles).
If you compare the outcome of mod(2x, x) between eevee and cycles. Cycles seems to correctly evaluate that to 0 while eevee seems to evaluate that incorrectly to 1 for many values of x (for both integers and fractions).EeveeModError1.blend
The bug also occurs for mod(yx,x) for many values of y (I've tested it for a couple of integer values of y).
Added subscriber: @dohduhdah
Added subscriber: @brecht
Please verify if this is still an issue in the latest build, I believe there was a fix related to this:
https://builder.blender.org/download/
Yes, I've tried it today with the latest build. There have been a few fixes, but there still appear to be problems with the modulo function in eevee.
I notice them in a more complicated setup when comparing the results between eevee and cycles:
https://blenderartists.org/t/confusion-about-color-difference-between-eevee-and-cycles/1173638
I use the modulo function in the shader nodes to generate color combinations:
https://i.imgur.com/BBqAsgv.png
Switching between cycles and eevee in rendered preview causes certain elements to take on completely different colors (while most of the colors remain equal).mod-grid2.blend
Added subscriber: @GpuDevil
This is likely a floating point precision issue regarding GLSL's implementation of
mod()
and GPU code generation, see this thread: https://www.raspberrypi.org/forums/viewtopic.php?t=189455Seems like the issue with mod(x,x) != 0 isa regression. However, the imprecision pointed by @GpuDevil is likely to remain as it is an implementation behavior we cannot ensure. And I tried expanding the terms and it did nothing.
This issue was referenced by
d9be59e872
Changed status from 'Open' to: 'Resolved'
Added subscriber: @IyadAhmed
I still see the problem in 2.82, it occurs whenever there are negative numbers as input for both Vector Math and Math nodes modulo, EEVEE seems to be more accurate, it is the Cycles implementation that doesn't produce desirable results.
@IyadAhmed, it's best to create a new report then with example .blend file and system information, to be sure we are looking at the same problem.
Indeed it is not exactly the same problem, however the problem above still exists in 2.82 and blender-2.83-1a1f2912e65e-windows64, screenshots using the above file "EeveeModError1.blend"
EEVEE
Cycles