Refractive Errrors when Camera is far from (0,0,0) #103005

Closed
opened 2022-12-08 03:32:20 +01:00 by Jack Toth · 9 comments

System Information
Operating system: PC
Graphics card: RTX3080Ti

Blender Version
Broken: 3.31, others
Worked: none

Hi, I am recreating the geometry of optical camera lenses to shoot through for photographic effect. I have noticed that the results look great with my current method when the camera is at location (0,0,0) however when moving to greater distances away from zero the effects start to get bizarre and fall apart. The parenting method is sound but for example I am shooting through the glass representation of a vintage lens, six geometries of glass, and when I set the camera to something like y=-200 meters, the image completely falls apart.

Exact steps:

  1. Model 6 pieces of glass (or plain refractive shader) for a lensing system at (0,0,0), and parent an orthographic camera to it.
  2. Doesnt seem to matter, have seen same effects between perspective and my current method (orthographic the size of a 36mm piece of film with DOF turn on to smallest setting).
  3. After parenting correct distances for a sharp image, move camera back something large from zero (like 200 meters for one of my products).

I can send an file if someone would like to take a look at what I am talking about. This happens with both the CPU and the GPU rendering for Cycles. I have a weird hunch a distance value during rendering is limited to a certain bit depth for the floating point value (either with rays or the refractive index material) and cannot compute the fine spacing between the glass elements correctly before bit rounding happens.

I understand this may be pushing the limits of Blender Cycles render but I am hoping to find a fix for the customers who have purchased other lensing systems from me as this limits their performance. This is affecting my anamorphic lens sets as well when at great distances. I have

DistanceZero.png DistanceFarFromZero.png

OpticalIssue.blend

Thank you,

Jack

**System Information** Operating system: PC Graphics card: RTX3080Ti **Blender Version** Broken: 3.31, others Worked: none Hi, I am recreating the geometry of optical camera lenses to shoot through for photographic effect. I have noticed that the results look great with my current method when the camera is at location (0,0,0) however when moving to greater distances away from zero the effects start to get bizarre and fall apart. The parenting method is sound but for example I am shooting through the glass representation of a vintage lens, six geometries of glass, and when I set the camera to something like y=-200 meters, the image completely falls apart. Exact steps: 1. Model 6 pieces of glass (or plain refractive shader) for a lensing system at (0,0,0), and parent an orthographic camera to it. 2. Doesnt seem to matter, have seen same effects between perspective and my current method (orthographic the size of a 36mm piece of film with DOF turn on to smallest setting). 3. After parenting correct distances for a sharp image, move camera back something large from zero (like 200 meters for one of my products). I can send an file if someone would like to take a look at what I am talking about. This happens with both the CPU and the GPU rendering for Cycles. I have a weird hunch a distance value during rendering is limited to a certain bit depth for the floating point value (either with rays or the refractive index material) and cannot compute the fine spacing between the glass elements correctly before bit rounding happens. I understand this may be pushing the limits of Blender Cycles render but I am hoping to find a fix for the customers who have purchased other lensing systems from me as this limits their performance. This is affecting my anamorphic lens sets as well when at great distances. I have ![DistanceZero.png](https://archive.blender.org/developer/F14044126/DistanceZero.png) ![DistanceFarFromZero.png](https://archive.blender.org/developer/F14044128/DistanceFarFromZero.png) [OpticalIssue.blend](https://archive.blender.org/developer/F14044134/OpticalIssue.blend) Thank you, Jack
Author

Added subscriber: @Jack-Toth

Added subscriber: @Jack-Toth

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

I can reproduce this behavior, seems that weird effects starts to happen at position greater than 32767m from 0, so this sounds like integer overflow.

In step 3 you say, to set position at 200m, but in provided file the distance is actually 300000m That is about orbit of the moon, so I would say, that is pushing limits a bit :) Is this correct or a mistake?

I can reproduce this behavior, seems that weird effects starts to happen at position greater than 32767m from 0, so this sounds like integer overflow. In step 3 you say, to set position at 200m, but in provided file the distance is actually 300000m That is about orbit of the moon, so I would say, that is pushing limits a bit :) Is this correct or a mistake?
Author

Thank you for taking a look. I had originally uploaded a file that showed it at 200m but changed to the single suzzanne model for simplicity where the effect happened at 300000m. I can prove this happens at even 6m with one of my lens stacks (where the effect is magnified because of the 6 lens elements) but I did not want to upload the actual product to a public forum, I can send privately if needed. My point was that this happens globally, being that the tearing is small but still effectful to a project like mine at even small distances from zero. The 300,000m just showcased the effect well to a normal viewing size. Is there a way to increase the resolution of position or is this constrained to 64-bit and can’t be fixed?

Therefore does mesh tearing, even at macro levels, always happen?

Thank you for taking a look. I had originally uploaded a file that showed it at 200m but changed to the single suzzanne model for simplicity where the effect happened at 300000m. I can prove this happens at even 6m with one of my lens stacks (where the effect is magnified because of the 6 lens elements) but I did not want to upload the actual product to a public forum, I can send privately if needed. My point was that this happens globally, being that the tearing is small but still effectful to a project like mine at even small distances from zero. The 300,000m just showcased the effect well to a normal viewing size. Is there a way to increase the resolution of position or is this constrained to 64-bit and can’t be fixed? Therefore does mesh tearing, even at macro levels, always happen?

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscriber: @brecht

Added subscriber: @brecht

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

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

While ideally we could support such cases without precision issues, this is considered a known limitation.

The values here are below what we can reasonably do with single precision floating point values. A better solution would be some kind of camera shader or baked lens mapping to be used by Cycles for sampling rather than modelling it with geometry, but adding features like that is outside the scope of the bug tracker.

While ideally we could support such cases without precision issues, this is considered a known limitation. The values here are below what we can reasonably do with single precision floating point values. A better solution would be some kind of camera shader or baked lens mapping to be used by Cycles for sampling rather than modelling it with geometry, but adding features like that is outside the scope of the bug tracker.
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#103005
No description provided.