Zero sized normals if the object scale to zero in one axis. #74317

Open
opened 2020-02-29 15:32:30 +01:00 by Shish · 9 comments

System Information
Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 555X OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.5.5

Blender Version
Broken: version: 2.82 (sub 7), branch: master, commit date: 2020-02-12 16:20, hash: 77d23b0bd7

A 3D object with a reflective texture turns black when flattened by scaling x0 along an axis

~

I was rendering a transform of a reflective hemisphere from concave to convex, seeing how the reflection changes over time.

  • With Cycles, this works as expected. Concave is warped one way, flat is a flat mirror, convex is warped the other way.
  • With Eevee, the concave and convex reflections are fine, but for one frame where the hemisphere has become a 2D circle, it shows up black.

Example file attached, saved at the half-way point in the animation where this bug occurs: spoon.blend

Videos attached to show the effect just in case this is hardware-specific and only happens on my laptop.

Eevee, with one black frame right in the middle:
spoon-eevee0001-0120.webm

Cycles, everything is fine:
spoon-cycles0001-0120.webm

**System Information** Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 555X OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.5.5 **Blender Version** Broken: version: 2.82 (sub 7), branch: master, commit date: 2020-02-12 16:20, hash: `77d23b0bd7` A 3D object with a reflective texture turns black when flattened by scaling x0 along an axis ~ I was rendering a transform of a reflective hemisphere from concave to convex, seeing how the reflection changes over time. - With Cycles, this works as expected. Concave is warped one way, flat is a flat mirror, convex is warped the other way. - With Eevee, the concave and convex reflections are fine, but for one frame where the hemisphere has become a 2D circle, it shows up black. Example file attached, saved at the half-way point in the animation where this bug occurs: [spoon.blend](https://archive.blender.org/developer/F8380159/spoon.blend) Videos attached to show the effect just in case this is hardware-specific and only happens on my laptop. Eevee, with one black frame right in the middle: [spoon-eevee0001-0120.webm](https://archive.blender.org/developer/F8380166/spoon-eevee0001-0120.webm) Cycles, everything is fine: [spoon-cycles0001-0120.webm](https://archive.blender.org/developer/F8380167/spoon-cycles0001-0120.webm)
Author

Added subscriber: @shish_blender

Added subscriber: @shish_blender

#97031 was marked as duplicate of this issue

#97031 was marked as duplicate of this issue
Member

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

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

Added subscriber: @Rodrigo_S.T

Added subscriber: @Rodrigo_S.T
Clément Foucault changed title from Black reflections in eevee to Zero sized normals if the object scale to zero in one axis. 2020-04-23 18:06:28 +02:00

Added subscribers: @brecht, @fclem

Added subscribers: @brecht, @fclem

This happens because the object is scaled to 0.0 in one axis.

This also happens for workbench too.

@brecht what does cycles do to prevent this?

This happens because the object is scaled to 0.0 in one axis. This also happens for workbench too. @brecht what does cycles do to prevent this?

It might be this code to invert degenerate matrices:

  if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) {
    /* matrix is degenerate (e.g. 0 scale on some axis), ideally we should
     * never be in this situation, but try to invert it anyway with tweak */
    M[0][0] += 1e-8f;
    M[1][1] += 1e-8f;
    M[2][2] += 1e-8f;

    if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) {

I doubt Cycles handles scale 0 well in all cases though, in general such transforms with zero scale along one axis should not be expected to give meaningful results.

It might be this code to invert degenerate matrices: ``` if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { /* matrix is degenerate (e.g. 0 scale on some axis), ideally we should * never be in this situation, but try to invert it anyway with tweak */ M[0][0] += 1e-8f; M[1][1] += 1e-8f; M[2][2] += 1e-8f; if (UNLIKELY(!transform_matrix4_gj_inverse(R, M))) { ``` I doubt Cycles handles scale 0 well in all cases though, in general such transforms with zero scale along one axis should not be expected to give meaningful results.

Well we use the matrices computed by the depsgraph so that would have to be fixed here.

But since this matrix can be used for other purpose, I would not touch it for the sake of fixing this corner case.
If we were to recompute the inverse matrix again with this fix just for display purpose, we would take a significant performance hit.

Well we use the matrices computed by the depsgraph so that would have to be fixed here. But since this matrix can be used for other purpose, I would not touch it for the sake of fixing this corner case. If we were to recompute the inverse matrix again with this fix just for display purpose, we would take a significant performance hit.
Member

Added subscriber: @Leo-Luther

Added subscriber: @Leo-Luther
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:15:08 +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
7 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#74317
No description provided.