Rendering with OSL seems to cap "weird" numbers in certain places in the nodes #35591
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#35591
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%--- Operating System, Graphics card ---
WinXP 32bits
Nvidia GeForce 250 GTS
From what i can remember, ever since OSL was avaiable it had this issue.
If you manually (or simply feeding from another node) input values outside the range you can get just by dragging on the sliders, on certain things like RGB values and as the mixing factor, with plain Cycles you can get some interesting effects, but if you enable OSL rendering those "unusual" values seem to get capped to the 0.0...1.0 range.
Render with OSL disabled, then render with OSL enabled and compare the results (the two smaller cubes have materials with manually entered values for a couple of things).
ps: clearly this scene is not a masterpiece, just somthing i threw together to show some of the differences%%%
Changed status to: 'Open'
%%%I can't see any issues with RGB nodes, if I add a color RGB node with values -5, 5, 5, it renders the same in OSL and SVM.
The issue is in the mix shader. /negative values).
Anyway, we should not "unlock" this in OSL, but clamp the Mix factor in SVM. %%%
%%%Brecht, I propose the following fix for SVM:
Index: D:/blender_dev/code/trunk/intern/cycles/kernel/svm/svm_closure.h
+++ D:/blender_dev/code/trunk/intern/cycles/kernel/svm/svm_closure.h (working copy)
@@ -599,6 +599,8 @@
decode_node_uchar4(node.y, &weight_offset, &in_weight_offset, &weight1_offset, &weight2_offset);
weight = clamp(weight, 0.0f, 1.0f);
float in_weight = (stack_valid(in_weight_offset))? stack_load_float(stack, in_weight_offset): 1.0f;
if(stack_valid(weight1_offset))
%%%
%%%That fix looks ok, please commit.%%%
%%%Is it really need to clamp the Mix factor?
I thought that the ability to use negative values with Mix shader - this is a feature, not a bug.
Not sure if I ever need this, but I can subtract shaders with negative Mix factor, e.g.
http://i.imgur.com/NNWVf6t.png%%%
%%%Mix closures outside of the 0-1 ranges are not really predictable, and can cause strange artefacts, better to limit this, instead of have nasty surprises, when entering a strange value by accident.
Changed status from 'Open' to: 'Resolved'
%%%Isn't out of range values used for fake caustics (by making the transparent shader actually emit more light than if it was 100% transparent in some parts, to emulate focusing the light) ?%%%
%%%Indeed. I forgot about fake caustics. Now it will be impossible with clamped Mix factor.%%%
%%%Although, no. I was wrong. This is not that cheat for fake caustic, about which I thought.%%%
%%%The color inputs to shader nodes are unclamped, and can be used with the add/mix shader for negative or > 1 values.%%%