Noise texture poor precision in Green and Blue color channels #118832

Open
opened 2024-02-28 06:54:27 +01:00 by Lance Phan · 2 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 537.13

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked:
The Red channel works as expected

Short description of error
In large scale (0.01), the green and blue became noticeably jagged

Exact steps for others to reproduce the error
Add a noise texture in the shader editor, use Object texture coordinate
Set the scale of the noise to 0.01
Separate the color output to Red Green and Blue
Use a Greater Than node on the Green or Blue channel, set a threshold to show a clear black and white border
Zoom in to see the jagged edge

The same problem also exists in Blender 3.6

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 537.13 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: The Red channel works as expected **Short description of error** In large scale (0.01), the green and blue became noticeably jagged **Exact steps for others to reproduce the error** Add a noise texture in the shader editor, use Object texture coordinate Set the scale of the noise to 0.01 Separate the color output to Red Green and Blue Use a Greater Than node on the Green or Blue channel, set a threshold to show a clear black and white border Zoom in to see the jagged edge The same problem also exists in Blender 3.6
Lance Phan added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-02-28 06:54:28 +01:00

Thank you for the report.

I can confirm the issue with the noise texture's poor precision in the green and blue color channels.
Attached is the .blend file I used to test.

This could potentially be a technical limitation of float precision, which can lead to jagged edges in certain color channels. However, it is worth noting that the red channel does not exhibit the same problem.

The issue is seems in both EEVEE and Cycles.

Thank you for the report. I can confirm the issue with the noise texture's poor precision in the green and blue color channels. Attached is the .blend file I used to test. This could potentially be a technical limitation of float precision, which can lead to jagged edges in certain color channels. However, it is worth noting that the red channel does not exhibit the same problem. The issue is seems in both EEVEE and Cycles.
Germano Cavalcante added
Module
EEVEE & Viewport
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-02-28 14:30:19 +01:00
Contributor
 #define NOISE_FRACTAL_DISTORTED_3D(NOISE_TYPE) \
 ...
  value = NOISE_TYPE(p, detail, roughness, lacunarity, offset, gain, normalize != 0.0); \
  color = vec4(value, \
               NOISE_TYPE(p + random_vec3_offset(3.0), \
                          detail, \
                          roughness, \
                          lacunarity, \
                          offset, \
                          gain, \
                          normalize != 0.0), \
               NOISE_TYPE(p + random_vec3_offset(4.0), \
                          detail, \
                          roughness, \
                          lacunarity, \
                          offset, \
                          gain, \
                          normalize != 0.0), \
               1.0);

e1023b22f1/source/blender/gpu/shaders/material/gpu_shader_material_tex_noise.glsl (L64-L88)

I noticed only the red channel does not have a random offset. After manually adding up a large float number (e.g. 100.111111f), similar to the range of random_vec3_offset, to the rad channel, the precision problem appears. I believe it is caused by missing precision during float addition.

``` #define NOISE_FRACTAL_DISTORTED_3D(NOISE_TYPE) \ ... value = NOISE_TYPE(p, detail, roughness, lacunarity, offset, gain, normalize != 0.0); \ color = vec4(value, \ NOISE_TYPE(p + random_vec3_offset(3.0), \ detail, \ roughness, \ lacunarity, \ offset, \ gain, \ normalize != 0.0), \ NOISE_TYPE(p + random_vec3_offset(4.0), \ detail, \ roughness, \ lacunarity, \ offset, \ gain, \ normalize != 0.0), \ 1.0); ``` https://projects.blender.org/blender/blender/src/commit/e1023b22f15733c8abe9341aace6eb1b57bbf588/source/blender/gpu/shaders/material/gpu_shader_material_tex_noise.glsl#L64-L88 I noticed only the red channel does not have a random offset. After manually adding up a large float number (e.g. ```100.111111f```), similar to the range of ```random_vec3_offset```, to the rad channel, the precision problem appears. I believe it is caused by missing precision during float addition.
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
3 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#118832
No description provided.