OSL bug? (interior shader) #56804

Closed
opened 2018-09-14 17:30:40 +02:00 by Phil Stopford · 7 comments

System Information
Win 10 Pro, 6 GB GTX 1060

Blender Version
Broken: 2.79b and master
Worked: (optional)

Short description of error
For the attached OSL script (interiorMapping_tex_v007.osl), the behavior is inconsistent with V-ray and others. Compare cycles_osl.png and vray_osl.png. These are from the attached .blend file; V-ray is offered as a reference.

Exact steps for others to reproduce the error
Files are included in the archive. Maintain the hierarchy - the textures folder needs to exist for the OSL shader to find the file it needs there.

  1. Load attached interior_vray.blend file. This contains Cycles and V-ray shader networks. We'll focus on the Cycles network, but V-ray is there in case it is useful. We'll refer to V-ray render images for comparison.
  2. Press F12 to render a frame with Cycles. You will get something like cycles_osl.png
  3. Compare to the V-ray reference image for the exact same OSL and camera setup (vray_osl.png). The negative-direction facing walls seem to give trouble for the shader in Cycles, but V-ray works fine to create these virtual rooms.

Let's check the positive direction faces :

  1. Switch the active camera to Camera.001 (or load interior_vray2.blend).

  2. Render with F12. Compare the Cycles render with vray_osl_camera001.png. The rooms are created, but the interiors are all mangled compared to the V-ray reference.

  3. Load interior_vray3.blend. This uses a revised OSL (interiorMapping_tex_v007_phil.osl) where the values from (point p_PLocal = transform("object", P);) are negated. Render using Cycles with F12. This looks much closer, but the ceiling and floor images are swapped over (cycles_osl_phil_camera001.png). The negative directions faces are still not rendered correctly with this shader (cycles_osl_phil.png)

interior.zip.

In principle, OSL should be portable and this looks like a bug in the OSL code in blender. It feels like these differences are coming from a single cause, so I put them as a single ticket. If you prefer, I can break them out.

**System Information** Win 10 Pro, 6 GB GTX 1060 **Blender Version** Broken: 2.79b and master Worked: (optional) **Short description of error** For the attached OSL script (interiorMapping_tex_v007.osl), the behavior is inconsistent with V-ray and others. Compare cycles_osl.png and vray_osl.png. These are from the attached .blend file; V-ray is offered as a reference. **Exact steps for others to reproduce the error** Files are included in the archive. Maintain the hierarchy - the textures folder needs to exist for the OSL shader to find the file it needs there. 1) Load attached interior_vray.blend file. This contains Cycles and V-ray shader networks. We'll focus on the Cycles network, but V-ray is there in case it is useful. We'll refer to V-ray render images for comparison. 2) Press F12 to render a frame with Cycles. You will get something like cycles_osl.png 3) Compare to the V-ray reference image for the exact same OSL and camera setup (vray_osl.png). The negative-direction facing walls seem to give trouble for the shader in Cycles, but V-ray works fine to create these virtual rooms. Let's check the positive direction faces : 4) Switch the active camera to Camera.001 (or load interior_vray2.blend). 5) Render with F12. Compare the Cycles render with vray_osl_camera001.png. The rooms are created, but the interiors are all mangled compared to the V-ray reference. 4) Load interior_vray3.blend. This uses a revised OSL (interiorMapping_tex_v007_phil.osl) where the values from (point p_PLocal = transform("object", P);) are negated. Render using Cycles with F12. This looks much closer, but the ceiling and floor images are swapped over (cycles_osl_phil_camera001.png). The negative directions faces are still not rendered correctly with this shader (cycles_osl_phil.png) [interior.zip](https://archive.blender.org/developer/F4699420/interior.zip). In principle, OSL should be portable and this looks like a bug in the OSL code in blender. It feels like these differences are coming from a single cause, so I put them as a single ticket. If you prefer, I can break them out.
Author

Added subscriber: @phil.stopford

Added subscriber: @phil.stopford

Added subscriber: @brecht

Added subscriber: @brecht

I don't really have the time to debug a complex shader like this, and it's not obvious that the bug is in Cycles. You really need to narrow it down more.

It seems this was adapted from a Blender shader originally, and there's this comment which might be relevant to things being flipped:

- Changed -I into I, as the rooms were inverted, front corner was back.
I don't really have the time to debug a complex shader like this, and it's not obvious that the bug is in Cycles. You really need to narrow it down more. It seems this was adapted from a Blender shader originally, and there's this comment which might be relevant to things being flipped: ``` - Changed -I into I, as the rooms were inverted, front corner was back. ```
Author

OK. So here's a simpler example, which demonstrates the same problem. The only difference is, again, the negation of the values from the transform("object", P) call. This fixes the texture projection (for the most part). I think this is as simple as it can get.

simpler_interior.zip

OK. So here's a simpler example, which demonstrates the same problem. The only difference is, again, the negation of the values from the transform("object", P) call. This fixes the texture projection (for the most part). I think this is as simple as it can get. [simpler_interior.zip](https://archive.blender.org/developer/F4699911/simpler_interior.zip)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Germano Cavalcante self-assigned this 2020-02-05 19:34:31 +01:00

Thanks for the report. Unfortunately the scenario described is too time consuming for us to track down, we require the bug reporter to narrow down the problem.
If you are sure that this is a problem in blender, please open a new report clearly identifying the problem.

Thanks for the report. Unfortunately the scenario described is too time consuming for us to track down, we require the bug reporter to narrow down the problem. If you are sure that this is a problem in blender, please open a new report clearly identifying the problem.
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
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#56804
No description provided.