Lambert shading error in blender internal #43789

Closed
opened 2015-02-23 16:14:40 +01:00 by Fabian Emmes · 8 comments

System Information
Windows 8.1, i5, Sandy Bridge

Blender Version
Broken: 2.73a

Short description of error
Lambert shading of face is wrong, changing different part of mesh corrects shading.

Exact steps for others to reproduce the error
Open render_internal_diffuse.blend.
Press F12 to render.
Notice that both large faces are rendered differently.

Setup of scene and explanation why I think this is a bug
The sun is perfect white, and shines with 45 degree on the white object.
The material has no specular intensity and its diffuse color/intensity is perfect white.
By the Lambert model, the model should be shaded with cos(45 deg) = 0.707.
Only one of the faces is shaded with this intensity, the other is too dark (0.6224)

After removing one or both of the small faces right of the large faces, both large faces render with the correct intensity.

**System Information** Windows 8.1, i5, Sandy Bridge **Blender Version** Broken: 2.73a **Short description of error** Lambert shading of face is wrong, changing different part of mesh corrects shading. **Exact steps for others to reproduce the error** Open [render_internal_diffuse.blend](https://archive.blender.org/developer/F145439/render_internal_diffuse.blend). Press F12 to render. Notice that both large faces are rendered differently. **Setup of scene and explanation why I think this is a bug** The sun is perfect white, and shines with 45 degree on the white object. The material has no specular intensity and its diffuse color/intensity is perfect white. By the Lambert model, the model should be shaded with cos(45 deg) = 0.707. Only one of the faces is shaded with this intensity, the other is too dark (0.6224) After removing one or both of the **small** faces right of the large faces, both large faces render with the correct intensity.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @der_fab

Added subscriber: @der_fab
Sergey Sharybin self-assigned this 2015-02-24 08:48:15 +01:00

Will have a look later.

Will have a look later.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Firstly, one of the faces has smooth set, and the other not, this is making the ray-bias treat the faces differently.

It seems to be working as intended, (but agree the final result is odd).

  • Auto-bias will use ob->smoothresh set by set_phong_threshold
  • This is set based on the difference in normals (which is why the small faces at the right make a difference).
  • Then shade_one_light is using smoothresh when MA_RAYBIAS is set.
Firstly, one of the faces has smooth set, and the other not, this is making the ray-bias treat the faces differently. It seems to be working as intended, (but agree the final result is odd). - Auto-bias will use `ob->smoothresh` set by `set_phong_threshold` - This is set based on the difference in normals (which is why the small faces at the right make a difference). - Then `shade_one_light` is using `smoothresh` when `MA_RAYBIAS` is set.
Author

I don't understand how faces, that are not connected to the problematic part, can have influence on its shading. Is this behavior documented somewhere?

We are using blender (internal) for lightmap baking and are getting different shadings on large areas due to this problem. Can this problem be fixed or should we work around it somehow? Is there an easy way to identify faces with different shading modes in the 3D View?

Thanks a lot!

I don't understand how faces, that are not connected to the problematic part, can have influence on its shading. Is this behavior documented somewhere? We are using blender (internal) for lightmap baking and are getting different shadings on large areas due to this problem. Can this problem be fixed or should we work around it somehow? Is there an easy way to identify faces with different shading modes in the 3D View? Thanks a lot!

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Well, @ideasman42 is more or less explained everything already.

Seems there's a bit of confusion here tho -- one of big faces is set to smooth shading. It makes it shaded differently comparing to the one adjacent to it. Setting shading to flat to both big connected faces makes them shaded the same way.

I don't think it's a problem, just how shading works. Workaround and fix would be to set proper smoother flag.

Don't think there's existing way to show smooth faces, but it's easy to do with a python script.

Thanks for the report, but wouldn't consider it a bug.

Well, @ideasman42 is more or less explained everything already. Seems there's a bit of confusion here tho -- one of big faces is set to smooth shading. It makes it shaded differently comparing to the one adjacent to it. Setting shading to flat to both big connected faces makes them shaded the same way. I don't think it's a problem, just how shading works. Workaround and fix would be to set proper smoother flag. Don't think there's existing way to show smooth faces, but it's easy to do with a python script. Thanks for the report, but wouldn't consider it a bug.
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#43789
No description provided.