Two serious stencil texture bugs #26184

Closed
opened 2011-02-22 15:54:14 +01:00 by Miika Hamalainen · 5 comments

%%%While I was looking through stencil handling code I found two quite serious bugs in stencil system.

  1. Stencil mask affects the texture it is assigned from:

If you set a stencil mask from a texture that affects for example both stencil and color -> color from that texture gets affected by that stencil mask as well.

See attachments: stencil_bug_1.png and stencil_bug_1.blend

  1. Stencil normal effect is multiplied by every texture

If you have a stencil mask, it's effect on normal increases for every texture processed in texture stack. (No matter whether texture does something or not.)

See attachments: stencil_bug_normal.png and stencil_bug_normal.blend

Ton said that these bugs have been in Blender for ages, and thus fixing them would "break" old renders that use stencil masks. However, I don't agree we should wait for material system rewrite with these since these bugs are very easy to fix.

At least we should change "Stencil" checkbox description to define it affects current texture as well. (Which doesn't make any sense. :)
For normal bug: It's very serious, and something should be done about it anyway.%%%

%%%While I was looking through stencil handling code I found two quite serious bugs in stencil system. 1. Stencil mask affects the texture it is assigned from: If you set a stencil mask from a texture that affects for example both stencil and color -> color from that texture gets affected by that stencil mask as well. See attachments: stencil_bug_1.png and stencil_bug_1.blend 2. Stencil normal effect is multiplied by every texture If you have a stencil mask, it's effect on normal increases for every texture processed in texture stack. (No matter whether texture does something or not.) See attachments: stencil_bug_normal.png and stencil_bug_normal.blend Ton said that these bugs have been in Blender for ages, and thus fixing them would "break" old renders that use stencil masks. However, I don't agree we should wait for material system rewrite with these since these bugs are very easy to fix. At least we should change "Stencil" checkbox description to define it affects current texture as well. (Which doesn't make any sense. :) For normal bug: It's very serious, and something should be done about it anyway.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%r35072 @ linux64

attached a screenshot showing the same (mis)behaviour in blender 2.49a
because of Tnor *= stencilTin for every non-stencil texture, the stencil effect multiplies with every slot.

attached a patch with a fix too, but didn't commit.

  • kaito: if it's there > 5 years, it becomes a feature automatically :)
    %%%
%%%r35072 @ linux64 attached a screenshot showing the same (mis)behaviour in blender 2.49a because of Tnor *= stencilTin for every non-stencil texture, the stencil effect multiplies with every slot. attached a patch with a fix too, but didn't commit. - kaito: if it's there > 5 years, it becomes a feature automatically :) %%%
Member

%%%fixed small error in the patch.%%%

%%%fixed small error in the patch.%%%
Member

%%%Tested the current status of texture stencil.
I agree the implementation is messed up here, but the fix isn't worth breaking renders that were created this way. It does work now, even with its limits.

The status of our material/texture/light system is really beyond repair in many ways, I really prefer to move on start a proper design project a.s.a.p.

Added note in wiki, and link to this report here:
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Rendering

Thanks for the efforts to make this patch!%%%

%%%Tested the current status of texture stencil. I agree the implementation is messed up here, but the fix isn't worth breaking renders that were created this way. It does work now, even with its limits. The status of our material/texture/light system is really beyond repair in many ways, I really prefer to move on start a proper design project a.s.a.p. Added note in wiki, and link to this report here: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Rendering Thanks for the efforts to make this patch!%%%
Member

Changed status from 'Open' to: 'Archived'

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