Unexpected behavior when combining Color Attributes with White Noise Texture #103255

Closed
opened 2022-12-16 03:02:38 +01:00 by Elias · 9 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.00

Blender Version
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: a95bf1ac01
Worked: (newest version of Blender that worked as expected)

Short description of error
Plugging in an object's color attributes into a white noise texture yields an unexpected banding pattern, even if every vertex shares the same exact color.

Exact steps for others to reproduce the error

  1. Select the default cube and go into Vertex Paint mode, which will create a new color attribute.
    (notice how each vertex is pure white)
  2. Create a material for the cube.
  3. Add a White Noise Texture node, and plug the Value or Color into the Surface of the Material Output
  4. Add a Color Attribute node, and connect it to the Vector of the White Noise Texture
  5. Notice the banding pattern

Expected result would be identical to plugging in a solid white RGB node.
blender_xie74Qdtg9.png
blender_VJaaspd2iU.png

Actual results:
blender_Pmns47L7gI.png
blender_jiT56z0bPb.png

Blend file:
color attribute white noise bug.blend

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.00 **Blender Version** Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: `a95bf1ac01` Worked: (newest version of Blender that worked as expected) **Short description of error** Plugging in an object's color attributes into a white noise texture yields an unexpected banding pattern, even if every vertex shares the same exact color. **Exact steps for others to reproduce the error** 1. Select the default cube and go into Vertex Paint mode, which will create a new color attribute. (notice how each vertex is pure white) 2. Create a material for the cube. 3. Add a White Noise Texture node, and plug the Value or Color into the Surface of the Material Output 4. Add a Color Attribute node, and connect it to the Vector of the White Noise Texture 5. Notice the banding pattern Expected result would be identical to plugging in a solid white RGB node. ![blender_xie74Qdtg9.png](https://archive.blender.org/developer/F14060986/blender_xie74Qdtg9.png) ![blender_VJaaspd2iU.png](https://archive.blender.org/developer/F14060984/blender_VJaaspd2iU.png) Actual results: ![blender_Pmns47L7gI.png](https://archive.blender.org/developer/F14060987/blender_Pmns47L7gI.png) ![blender_jiT56z0bPb.png](https://archive.blender.org/developer/F14060989/blender_jiT56z0bPb.png) Blend file: [color attribute white noise bug.blend](https://archive.blender.org/developer/F14060955/color_attribute_white_noise_bug.blend)
Author

Added subscriber: @razzzmatazzz30297

Added subscriber: @razzzmatazzz30297

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm the behavior.
I'm not sure why this happens.
It is seen in both Eevee and Cycles.
And it only happens with White Noise Texture.

I can confirm the behavior. I'm not sure why this happens. It is seen in both Eevee and Cycles. And it only happens with `White Noise Texture`.
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

Added subscribers: @brecht, @LukasStockner

Added subscribers: @brecht, @LukasStockner
Member

This is caused by floating-point rounding differences.
The white noise node hashes its input, so the slightest change to any of its inputs will give a completely different output.

Since Vertex attributes are interpolated across the face, a calculation whose inputs depend on the shading location takes place. Of course, in exact arithmetic this should always give the same result since all vertices have the same value, but in floating-point arithmetic expressions like a*(1-b) + a*b might not always be exactly equal to a.

In this particular case, the difference in Cycles ends up being just one bit - 0x3F800000 (1.00000000...) vs. 0x3F7FFFFF (0.999999940395...). This tiny difference would never be visible for regular textures, but for white noise in particular it's enough to get a different output.
You can also demonstrate this without a white noise texture:
Screenshot from 2022-12-17 01-06-55.png

I don't think there's an easy fix for this, I'd lean towards just considering this a known limitation of the white noise texture.
@brecht, sounds good to you?

This is caused by floating-point rounding differences. The white noise node hashes its input, so the slightest change to any of its inputs will give a completely different output. Since Vertex attributes are interpolated across the face, a calculation whose inputs depend on the shading location takes place. Of course, in exact arithmetic this should always give the same result since all vertices have the same value, but in floating-point arithmetic expressions like `a*(1-b) + a*b` might not always be exactly equal to `a`. In this particular case, the difference in Cycles ends up being just one bit - `0x3F800000` (`1.00000000...`) vs. `0x3F7FFFFF` (`0.999999940395...`). This tiny difference would never be visible for regular textures, but for white noise in particular it's enough to get a different output. You can also demonstrate this without a white noise texture: ![Screenshot from 2022-12-17 01-06-55.png](https://archive.blender.org/developer/F14063832/Screenshot_from_2022-12-17_01-06-55.png) I don't think there's an easy fix for this, I'd lean towards just considering this a known limitation of the white noise texture. @brecht, sounds good to you?

Yes, I consider that a known limitation.

Yes, I consider that a known limitation.
Member

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Lukas Stockner self-assigned this 2022-12-17 03:37:20 +01:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#103255
No description provided.