Cycles: Objects are invisible in viewport when an object scale is 0 #118325

Open
opened 2024-02-15 14:09:52 +01:00 by Max Mustermann · 9 comments

System Information
Operating system: Fedora Linux
Graphics card: AMD

Blender Version
Broken: 4.0.2
Worked: (newest version of Blender that worked as expected)

Short description of error
When one scale of an object is 0, it's invisible in the shaded viewport with Cycles, but it shows up in the render.

Exact steps for others to reproduce the error

  • Scale an object to 0 on one axis (object scale)
  • Activate shaded view
  • Switch to Cycles
  • Render image
**System Information** Operating system: Fedora Linux Graphics card: AMD **Blender Version** Broken: 4.0.2 Worked: (newest version of Blender that worked as expected) **Short description of error** When one scale of an object is 0, it's invisible in the shaded viewport with Cycles, but it shows up in the render. <video src="/attachments/fafea777-e1cc-48cf-bfdb-57768a652ec3" controls></video> **Exact steps for others to reproduce the error** - Scale an object to 0 on one axis (object scale) - Activate shaded view - Switch to Cycles - Render image
Max Mustermann added the
Severity
Normal
Type
Report
Status
Needs Triage
labels 2024-02-15 14:09:52 +01:00
Author
No description provided.

Hi @max-mustermann,

Thank you for reporting this issue. I can confirm the problem you described, where objects with a scale of 0 on one axis are invisible in the shaded viewport with Cycles, but they show up in the final render.

I will forward this issue to our development team for further investigation.

Hi @max-mustermann, Thank you for reporting this issue. I can confirm the problem you described, where objects with a scale of 0 on one axis are invisible in the shaded viewport with Cycles, but they show up in the final render. I will forward this issue to our development team for further investigation.
Author

I have checked version 3.3.1, and the same thing happens there too.

I have checked version 3.3.1, and the same thing happens there too.
Contributor

taking this one

taking this one
Contributor

@max-mustermann hi , you indicated that some version of blender worked as intended , can you tell me which one it is ?

@max-mustermann hi , you indicated that some version of blender worked as intended , can you tell me which one it is ?
Author

Hi @HamilcarR, It was broken in every version that I tested, down to 3.3.1.

But it only happens in CPU mode, not when using GPU Compute in the Cycles Render Properties

Your Fix makes it seem like it also happens with small values that are not 0, but I can't trigger any bug with any other value greater than 1*10⁻¹⁹. How did you do it?

Hi @HamilcarR, It was broken in every version that I tested, down to 3.3.1. But it only happens in CPU mode, not when using `GPU Compute` in the Cycles `Render Properties` Your Fix makes it seem like it also happens with small values that are not 0, but I can't trigger any bug with any other value greater than 1*10⁻¹⁹. How did you do it?
Contributor

Hi @HamilcarR, It was broken in every version that I tested, down to 3.3.1.

But it only happens in CPU mode, not when using GPU Compute in the Cycles Render Properties

Yeah , the fix isn't ready yet .
this problem makes me scratch my head a bit ... The reason why it's not present in gpu rendering is because embree is used for CPU rendering, and for the viewport shading , it uploads the transformation matrix in the API.
There, embree probably computes the new AABB of the object according to the new transformation matrix , and when you put a scale dimension to 0 , the AABB becomes degenerate , and it messes with ray intersections , hence why you could see other objects behind the one with 0 scale.

Your Fix makes it seem like it also happens with small values that are not 0, but I can't trigger any bug with any other value greater than 1*10⁻¹⁹. How did you do it?

when you put a value < 1e-23 , there's another problem , there is an intersection , but the object becomes totally dark.

Also , I noticed a glitchy behavior with the final render as well concerning this issue , so it's not just the viewport shading .
Even with my "fix" :

original scale 0 bake
118325_ori.png 118325_vp.png 118325_bad.png
> Hi @HamilcarR, It was broken in every version that I tested, down to 3.3.1. > > But it only happens in CPU mode, not when using `GPU Compute` in the Cycles `Render Properties` Yeah , the fix isn't ready yet . this problem makes me scratch my head a bit ... The reason why it's not present in gpu rendering is because embree is used for CPU rendering, and for the viewport shading , it uploads the transformation matrix in the API. There, embree probably computes the new AABB of the object according to the new transformation matrix , and when you put a scale dimension to 0 , the AABB becomes degenerate , and it messes with ray intersections , hence why you could see other objects behind the one with 0 scale. > Your Fix makes it seem like it also happens with small values that are not 0, but I can't trigger any bug with any other value greater than 1*10⁻¹⁹. How did you do it? when you put a value < 1e-23 , there's another problem , there is an intersection , but the object becomes totally dark. Also , I noticed a glitchy behavior with the final render as well concerning this issue , so it's not just the viewport shading . Even with my "fix" : |original|scale 0|bake| |------------|-----------|---------| |![118325_ori.png](/attachments/c9e60bd5-7417-4be8-bf35-1b99aa49a74e)|![118325_vp.png](/attachments/73ddde4f-5374-487a-ad75-63afc1b05163)|![118325_bad.png](/attachments/9c1cc082-c9b1-4cc4-93f5-1e67f57c5b8e)|
Author

The scale factor at which an object becomes totally dark depends on the distance to the viewport camera, so maybe it is a floating point precision limitation. But that distance is different between viewport and final render (it's lower in the final render), which can lead to objects being dark in the final render, but not the viewport.

Does the viewport use more precision than the final render somewhere?

The scale factor at which an object becomes totally dark depends on the distance to the viewport camera, so maybe it is a floating point precision limitation. But that distance is different between viewport and final render (it's lower in the final render), which can lead to objects being dark in the final render, but not the viewport. Does the viewport use more precision than the final render somewhere?
Contributor

Does the viewport use more precision than the final render somewhere?

Not from what I've seen , but I could have missed something, I don't know embree that well .
They do use two different modes , RTC_GEOMETRY_TYPE_INSTANCE for the viewport and RTC_GEOMETRY_TYPE_TRIANGLE for the final render , could be that .

I need to investigate this a bit more on embree's side , and check what's happening behind the scenes for a more elegant solution .

Maybe we even have two distinct bugs on our hands, here .

>Does the viewport use more precision than the final render somewhere? Not from what I've seen , but I could have missed something, I don't know embree that well . They do use two different modes , `RTC_GEOMETRY_TYPE_INSTANCE` for the viewport and `RTC_GEOMETRY_TYPE_TRIANGLE` for the final render , could be that . I need to investigate this a bit more on embree's side , and check what's happening behind the scenes for a more elegant solution . Maybe we even have two distinct bugs on our hands, here .
Brecht Van Lommel added
Type
Bug
and removed
Type
Report
labels 2024-06-14 15:59:14 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#118325
No description provided.