Optix render errors with motion blur and unknown bone constraint relationship #71344

Closed
opened 2019-11-04 20:01:01 +01:00 by stephen thomas · 9 comments

System Information
Operating system: Linux-5.3.0-19-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-03 03:57, hash: 8ab6ef30ab
Worked: (optional)

Short description of error
For the past couple of hours I've been trying to figure out what exactly is causing this bug, so apologies for it being a bit vague.

Find attached part of a character from a project I'm currently working on. When rendering with Optix with motion blur switched on, the character shows errors on certain parts of the body, the eye being one of them. I've stripped the rig down as far as I can while keeping the bug active, but I can't narrow it down further to find the exact cause. I believe it's something to do with the stretch to constraint on the 'body' bone, which is also squashing the eye bone. The error doesn't occur when rendering with CUDA.

Currently, the eye is parented to the eye.l bone. If the the Armature modifier is used instead of parenting, the render error doesn't occur.

Exact steps for others to reproduce the error
Open 'rtx-optix-motion-blur-bug.blend'.
Change Cycles Render Device to OptiX and hit render
Turn off motion blur and hit render.
Compare results.

system-info.txt

parented-to-bone-vs-armature-modifier.png

with-motion-blur.png

without-motion-blur.png

rtx-optix-motion-blur-bug.blend

**System Information** Operating system: Linux-5.3.0-19-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-03 03:57, hash: `8ab6ef30ab` Worked: (optional) **Short description of error** For the past couple of hours I've been trying to figure out what exactly is causing this bug, so apologies for it being a bit vague. Find attached part of a character from a project I'm currently working on. When rendering with Optix with motion blur switched on, the character shows errors on certain parts of the body, the eye being one of them. I've stripped the rig down as far as I can while keeping the bug active, but I can't narrow it down further to find the exact cause. I believe it's something to do with the stretch to constraint on the 'body' bone, which is also squashing the eye bone. The error doesn't occur when rendering with CUDA. Currently, the eye is parented to the eye.l bone. If the the Armature modifier is used instead of parenting, the render error doesn't occur. **Exact steps for others to reproduce the error** Open 'rtx-optix-motion-blur-bug.blend'. Change Cycles Render Device to OptiX and hit render Turn off motion blur and hit render. Compare results. [system-info.txt](https://archive.blender.org/developer/F7935358/system-info.txt) ![parented-to-bone-vs-armature-modifier.png](https://archive.blender.org/developer/F7935359/parented-to-bone-vs-armature-modifier.png) ![with-motion-blur.png](https://archive.blender.org/developer/F7935360/with-motion-blur.png) ![without-motion-blur.png](https://archive.blender.org/developer/F7935361/without-motion-blur.png) [rtx-optix-motion-blur-bug.blend](https://archive.blender.org/developer/F7935362/rtx-optix-motion-blur-bug.blend)
Author

Added subscriber: @stephenthomas

Added subscriber: @stephenthomas
Patrick Mours was assigned by Brecht Van Lommel 2019-11-05 16:15:54 +01:00
Member

So, this is an interesting one. The problem here is that there is a mismatch between the motion SRT transform that OptiX uses for traversal and the one Cycles computes for shading. Which causes these artifacts.

OptiX essentially expects a SRT with a scaling/shear matrix of the form

/ sx a b px \
| 0 sy c py |
| -- |
\ 0 0 sz pz /

But the transform decomposition code in Cycles generates a scaling matrix of the form

/ sx d e \
| d sy f |
| -- |
\ e f sz /

Currently the OptiX implementation in Cycles mistakenly assumes that a = d, b = e and c = f, which is why things go wrong. I think the cleanest way to fix this is to modify the decomposition code to create factors more inline with what OptiX uses, but I'll need to do some testing to make sure this wouldn't break anything.

So, this is an interesting one. The problem here is that there is a mismatch between the motion SRT transform that OptiX uses for traversal and the one Cycles computes for shading. Which causes these artifacts. OptiX essentially expects a SRT with a scaling/shear matrix of the form ``` / sx a b px \ | 0 sy c py | | -- | \ 0 0 sz pz / ``` But the transform decomposition code in Cycles generates a scaling matrix of the form ``` / sx d e \ | d sy f | | -- | \ e f sz / ``` Currently the OptiX implementation in Cycles mistakenly assumes that `a = d`, `b = e` and `c = f`, which is why things go wrong. I think the cleanest way to fix this is to modify the decomposition code to create factors more inline with what OptiX uses, but I'll need to do some testing to make sure this wouldn't break anything.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

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

I am getting the following [which is very likely caused by trying this in a hacked build on a non-RTX 970m...]

Failed to build OptiX acceleration structure
OptiX CUDA error CUDA_ERROR_INVALID_CONTEXT in cuMemAlloc(&motion_transform_gpu, motion_transform_size), line 1450

Leaving that aside, I would assume from the previous comments that this is actually confirmed, @pmoursnv?

I am getting the following [which is very likely caused by trying this in a hacked build on a non-RTX 970m...] ``` Failed to build OptiX acceleration structure OptiX CUDA error CUDA_ERROR_INVALID_CONTEXT in cuMemAlloc(&motion_transform_gpu, motion_transform_size), line 1450 ``` Leaving that aside, I would assume from the previous comments that this is actually confirmed, @pmoursnv?
Member

The invalid context error has been fixed in ff430dea66, but that was just a simple oversight. But yes, this is confirmed.
It is also relevant for D6575, since Embree uses the same decomposition (see RTCQuaternionDecomposition documentation, they call the parameters "skew" and "shift") that OptiX uses.

The invalid context error has been fixed in ff430dea66, but that was just a simple oversight. But yes, this is confirmed. It is also relevant for [D6575](https://archive.blender.org/developer/D6575), since Embree uses the same decomposition (see `RTCQuaternionDecomposition` documentation, they call the parameters "skew" and "shift") that OptiX uses.

This issue was referenced by blender/cycles@82fdb33159

This issue was referenced by blender/cycles@82fdb33159eb0d29a75981f2085205a39fd054e6

This issue was referenced by 26687dda5a

This issue was referenced by 26687dda5ab7de1e2a00cb6252a6eb919c3f570c
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
4 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#71344
No description provided.