Cycles: Light sampling threshold inadvertently clamps negative lamps #50975

Closed
opened 2017-03-17 05:41:41 +01:00 by Jason Clarke · 10 comments

System Information
Windows 10, Nvidia GTX 980

Blender Version
Broken: 2.78b

Short description of error

Not sure this is truly a bug, but: It's possible to make a negative lamp in Cycles by giving a light a negative value for strength. However, when using light sampling threshold, the negative power will fall below the threshold and sampling will constantly get canceled for the negative light

Exact steps for others to reproduce the error
Add a lamp with a negative strength, note the difference in effect between light sampling threshold of 0 (disabled), vs any larger value (enabled).

A test blend with a negative lamp is located here: negative_light.blend

**System Information** Windows 10, Nvidia GTX 980 **Blender Version** Broken: 2.78b **Short description of error** Not sure this is truly a bug, but: It's possible to make a negative lamp in Cycles by giving a light a negative value for strength. However, when using light sampling threshold, the negative power will fall below the threshold and sampling will constantly get canceled for the negative light **Exact steps for others to reproduce the error** Add a lamp with a negative strength, note the difference in effect between light sampling threshold of 0 (disabled), vs any larger value (enabled). A test blend with a negative lamp is located here: [negative_light.blend](https://archive.blender.org/developer/F511479/negative_light.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JasonClarke

Added subscriber: @JasonClarke

Added subscribers: @LukasStockner, @brecht, @Sergey

Added subscribers: @LukasStockner, @brecht, @Sergey
Sergey Sharybin self-assigned this 2017-03-20 12:12:15 +01:00

Don't really think it's a bug. Negative colors and strength is going to be always problematic. What is the reason you use negative strength on lamps?

@brecht, @LukasStockner, shouldn't we disable possibility of setting negative light strength?

Don't really think it's a bug. Negative colors and strength is going to be always problematic. What is the reason you use negative strength on lamps? @brecht, @LukasStockner, shouldn't we disable possibility of setting negative light strength?
Member

I don't think that we should explicitly disable negative lights - after all, they don't really cause any problems for regular use and there's no real chance of using them by accident, so I don't see the harm in keeping them as an "undocumented feature" as long as we don't officially support them.

As for the light threshold - I guess adding a fabsf() wouldn't noticably change performance, but of course some benchmarks are needed to check that.

I don't think that we should explicitly disable negative lights - after all, they don't really cause any problems for regular use and there's no real chance of using them by accident, so I don't see the harm in keeping them as an "undocumented feature" as long as we don't officially support them. As for the light threshold - I guess adding a fabsf() wouldn't noticably change performance, but of course some benchmarks are needed to check that.

So far we've supported negative light strengths, though in practice I would suggest to never use it. So if we want remove it at some point that's fine with me, but maybe better for 2.8.

Adding the fabsf() here should be fine, I wouldn't even bother to benchmark it, clearing the sign bit is super fast.

So far we've supported negative light strengths, though in practice I would suggest to never use it. So if we want remove it at some point that's fine with me, but maybe better for 2.8. Adding the `fabsf()` here should be fine, I wouldn't even bother to benchmark it, clearing the sign bit is super fast.

@brecht, this is just weird to forbid negative color but allow negative light.. Would be better if both are allowed or both are disallowed. But i'm fine keeping things as-is and just use fabs() for now.

@brecht, this is just weird to forbid negative color but allow negative light.. Would be better if both are allowed or both are disallowed. But i'm fine keeping things as-is and just use fabs() for now.

This issue was referenced by blender/cycles@6aade41f46

This issue was referenced by blender/cycles@6aade41f4693d6b1b35143a59955d355f4865de7

This issue was referenced by a201b99c5a

This issue was referenced by a201b99c5aaa7945bd0702c42987a60e3d70ee46

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
5 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#50975
No description provided.