Cycles: Optix-OSL sampling issue of window texture coordinate #108372

Open
opened 2023-05-28 13:34:16 +02:00 by Peter · 6 comments

System Information
Operating system: windows 10 Pro
Graphics card: RTX 3090 (game ready driver version 531.79)

Broken:
First noticed: blender 3.6.0 beta (19-05-23)
Encountered again in: 4.0.0 alpha (26-05-23)
Worked: Unknown

Short description of error
In the attached blend, when OptiX is used in conjunction with cycles OSL, window texture coordinates are scaled by the distance of the viewport camera to the shaded position. I confirmed this by scaling window coordinates by 1 / view distance. The scaling also applies to textures sampled using these coordinates.
Texture normals appear to also differ slightly between Optix and CPU, with normals appearing darker with OptiX disabled, no other co-ordinates are affected as far as I know.

Exact steps for others to reproduce the error

  1. open Distance_scaled_window.blend file.
  2. Ensure Cycles is the engine and OptiX OSL is enabled.
  3. Zoom in/out.

Workaround:

  • Use CPU device for rendering
  • Disable OSL when rendering with GPU

Test file: Distance_scaled_window.blend

Video: Video demonstation

**System Information** Operating system: windows 10 Pro Graphics card: RTX 3090 (game ready driver version 531.79) Broken: First noticed: blender 3.6.0 beta (19-05-23) Encountered again in: 4.0.0 alpha (26-05-23) Worked: Unknown **Short description of error** In the attached blend, when OptiX is used in conjunction with cycles OSL, window texture coordinates are scaled by the distance of the viewport camera to the shaded position. I confirmed this by scaling window coordinates by 1 / view distance. The scaling also applies to textures sampled using these coordinates. Texture normals appear to also differ slightly between Optix and CPU, with normals appearing darker with OptiX disabled, no other co-ordinates are affected as far as I know. **Exact steps for others to reproduce the error** 1. open `Distance_scaled_window.blend` file. 2. Ensure Cycles is the engine and OptiX OSL is enabled. 3. Zoom in/out. Workaround: - Use CPU device for rendering - Disable OSL when rendering with GPU Test file: [Distance_scaled_window.blend](https://projects.blender.org/attachments/5910d489-aebf-42a2-9b1f-49c8bbf8c314) Video: [Video demonstation](https://projects.blender.org/attachments/a159737c-9c19-4db7-b96e-1e0a3669904d)
Peter added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-05-28 13:34:17 +02:00

Hey, thank for report. Pleas, <10 nodes in one tree, with packed textures and without story, just steps to see the bug and steps to reproduce it. It really hard to try to confirm/bisect/fix something like that.

Hey, thank for report. Pleas, <10 nodes in one tree, with packed textures and without story, just steps to see the bug and steps to reproduce it. It really hard to try to confirm/bisect/fix something like that.
Author

Updated blend file: removed all nodes that didn't appear in the attached video "blue_viewZ.mp4", textures are now packed.
Updated report: removed first person accounts of how this bug occurred. Added additional context for texture sampling side-effect in OSL.

Updated blend file: removed all nodes that didn't appear in the attached video "blue_viewZ.mp4", textures are now packed. Updated report: removed first person accounts of how this bug occurred. Added additional context for texture sampling side-effect in OSL.
Iliya Katushenock added the
Interest
Nodes & Physics
Interest
Render & Cycles
labels 2023-05-28 21:52:16 +02:00
Member

Hi, thanks for the report.

Displayed textures and texture co-ordinates will still appear blue in the viewport however.

As far as I understand, the blue shading is due to face orientation property from viewport overlays panel.

to view the strange texture sampling (noticeable when moving the viewport camera), switch to cycles rendered viewport with open shading language enabled in GPU compute mode.

I'm observing tiled texture with OptiX+ OSL options. Is this you're reporting here?

Hi, thanks for the report. > Displayed textures and texture co-ordinates will still appear blue in the viewport however. As far as I understand, the blue shading is due to `face orientation` property from `viewport overlays` panel. > to view the strange texture sampling (noticeable when moving the viewport camera), switch to cycles rendered viewport with open shading language enabled in GPU compute mode. I'm observing tiled texture with OptiX+ OSL options. Is this you're reporting here?
Pratik Borhade added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-05-29 07:02:11 +02:00
Author

As far as I understand, the blue shading is due to face orientation property from viewport overlays panel

That's right, a misunderstanding on my part. It isn't related to the issue.

I'm observing tiled texture with OptiX+ OSL options. Is this you're reporting here?

I'm not sure what you mean. To be more specific. In the attached blend, when OptiX is used in conjunction with cycles OSL, window texture coordinates are scaled by the distance of the viewport camera to the shaded position. I confirmed this by scaling window coordinates by 1 / view distance. The scaling also applies to textures sampled using these coordinates.
Texture normals appear to also differ slightly between Optix and CPU, with normals appearing darker with OptiX disabled, no other co-ordinates are affected as far as I know.

Iv'e attached a demonstration of what I see on my end in case this depends on the machine used.

> As far as I understand, the blue shading is due to face orientation property from viewport overlays panel That's right, a misunderstanding on my part. It isn't related to the issue. >I'm observing tiled texture with OptiX+ OSL options. Is this you're reporting here? I'm not sure what you mean. To be more specific. In the attached blend, when OptiX is used in conjunction with cycles OSL, window texture coordinates are _scaled_ by the distance of the viewport camera to the shaded position. I confirmed this by scaling window coordinates by 1 / view distance. The scaling also applies to textures sampled using these coordinates. Texture normals appear to also differ slightly between Optix and CPU, with normals appearing darker with OptiX disabled, no other co-ordinates are affected as far as I know. Iv'e attached a demonstration of what I see on my end in case this depends on the machine used.
Member

when OptiX is used in conjunction with cycles OSL, window texture coordinates are scaled by the distance of the viewport camera to the shaded position

Thanks, I can confirm.
I'll edit the report to make the description more clear.

> when OptiX is used in conjunction with cycles OSL, window texture coordinates are scaled by the distance of the viewport camera to the shaded position Thanks, I can confirm. I'll edit the report to make the description more clear.
Pratik Borhade changed title from Vector transform node: viewport texture projection altered in an unrecoverable way to Cycles: Optix-OSL sampling issue of window texture coordinate 2023-05-30 11:49:16 +02:00
Member
cc @pmoursnv
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
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#108372
No description provided.