Index of refraction < 1 renders wrong in cycles #38439

Closed
opened 2014-02-01 23:31:51 +01:00 by Anna Celarek · 14 comments

System Information
Windows 7, Nvidia gtx550Ti

Blender Version
Broken: Cycles Render, 2.69 fd0b104
Worked: Internal Render, 2.69 fd0b104

Short description of error
In cycles, the glass shader with IOR < 1 does not render correctly. It behaves like IOR = 1. It should behave according to Snell's law http://en.wikipedia.org/wiki/Snell's_law and bend the at surfaces, no matter from which direction the light is coming.
In Blender Internal renderer, the behaviour is correct.
IOR < 1 is necessary for example to render underwater air bubbles. Then the IOR of the air bubble is 0.75 (the inverse of the water IOR).

Exact steps for others to reproduce the error
See attached file and screenshots.

Note: The drag and drop thing in the new bug tracker does not work for me, it asks me how I want to open it. Opera 12.10. I'm uploading it elsewhere. Would be nice if the old standard attach and browse button would come back (optionally).
http:///www.ania.xibo.at/tmp/ior.jpg
http://www.ania.xibo.at/tmp/cycles_ior.blend
http://www.ania.xibo.at/tmp/internal_ior.blend

**System Information** Windows 7, Nvidia gtx550Ti **Blender Version** Broken: Cycles Render, 2.69 fd0b104 Worked: Internal Render, 2.69 fd0b104 **Short description of error** In cycles, the glass shader with IOR < 1 does not render correctly. It behaves like IOR = 1. It should behave according to Snell's law http://en.wikipedia.org/wiki/Snell's_law and bend the at surfaces, no matter from which direction the light is coming. In Blender Internal renderer, the behaviour is correct. IOR < 1 is necessary for example to render underwater air bubbles. Then the IOR of the air bubble is 0.75 (the inverse of the water IOR). **Exact steps for others to reproduce the error** See attached file and screenshots. Note: The drag and drop thing in the new bug tracker does not work for me, it asks me how I want to open it. Opera 12.10. I'm uploading it elsewhere. Would be nice if the old standard attach and browse button would come back (optionally). http:///www.ania.xibo.at/tmp/ior.jpg http://www.ania.xibo.at/tmp/cycles_ior.blend http://www.ania.xibo.at/tmp/internal_ior.blend
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AnnaCelarek

Added subscriber: @AnnaCelarek
Author
http://www.ania.xibo.at/tmp/ior.jpg

Added subscribers: @brecht, @ThomasDinges

Added subscribers: @brecht, @ThomasDinges

Ania: You can submit the report without files, and then upload them in the first comment (Choose "Upload File" in the Action menu.

Developer Note:
@brecht: We clamp the IOR to "1.0f + 1e-5f" in svm_closure.h. We could change it to "0.0f + 1e-5f"? This way we would still avoid a division by zero later. The rendered result then looks similar to BI.

Ania: You can submit the report without files, and then upload them in the first comment (Choose "Upload File" in the Action menu. Developer Note: @brecht: We clamp the IOR to "1.0f + 1e-5f" in svm_closure.h. We could change it to "0.0f + 1e-5f"? This way we would still avoid a division by zero later. The rendered result then looks similar to BI.

Added subscriber: @DriesvanOosten

Added subscriber: @DriesvanOosten

Would it be an idea to just avoid zero? A negative IOR is interesting to render metamaterials.

Would it be an idea to just avoid zero? A negative IOR is interesting to render metamaterials.
Brecht Van Lommel was assigned by Sergey Sharybin 2014-02-03 13:42:00 +01:00

Added subscriber: @Sergey

Added subscriber: @Sergey

You can just flip the normals on the object to get the same result.

I'm fine with changing the limit to 0.0 + 1e-5f though. Negative IOR I'm not sure about, I don't think our fresnel formulas work with that.

You can just flip the normals on the object to get the same result. I'm fine with changing the limit to 0.0 + 1e-5f though. Negative IOR I'm not sure about, I don't think our fresnel formulas work with that.

This issue was referenced by blender/blender-addons-contrib@eff3bd4e98

This issue was referenced by blender/blender-addons-contrib@eff3bd4e9880efc0c767e3098baa86ab23d77bc7

This issue was referenced by eff3bd4e98

This issue was referenced by eff3bd4e9880efc0c767e3098baa86ab23d77bc7

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit eff3bd4e98.

Closed by commit eff3bd4e98.
Author

Flipping the normals could cause other unexpected results (normal maps, backfaces etc.).
Thanks for changing!

Flipping the normals could cause other unexpected results (normal maps, backfaces etc.). Thanks for changing!
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
6 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#38439
No description provided.