Baking overlapping geometry into a texture does not work with back-facing polygons #49393

Closed
opened 2016-09-19 01:43:32 +02:00 by Anselm · 9 comments

System Information
Windows 7 Pro (64 bit) and Windows 10 Pro (64 bit), Nvidia Geforce GTX 560 Ti

Blender Version
Broken: 2.77a and at least 2.76

Short description of error
I tried to bake a bunch of more or less randomly oriented polygons into a texture (diffuse color and normals). The resulting texture was "incomplete": polygons that were backfacing from the camera's point of view (correctly) occluded other polygons that were further away. But those occluding polygons did not create color output, the texture just contained the (transparent) background.
I simplified the problem to this scene setup:
baking_test_scene_setup.jpg
The blue, green and red (only outline visible because of enabled backface culling) polygons are one object that I want to bake onto the white polygon.
This is my baking result:
baking_result.png
The red polygon clearly blocks visibility to the green one, but actually does not show up in the baked texture.

I would expect one of the two following results:

  1. the red backfacing polygon being completely ignored by the baking, hence the green polygon should be fully visible
  2. the red backfacing polygon is not ignored by the baking, hence it should be visible in the upper part of the baking result

The second case is what I actually want and it would be consistent with what the cycles renderer does (at least from what I noticed so far): ignoring the backfacing property and render the polygons from any direction.

Separating the three polygons, selecting them all and baking them does actually work as "expectation 1". The green polygon fills the entire inner part of the blue polygon, the red one is not visible at all.

Exact steps for others to reproduce the error

  1. Open this blend file: baking_test.blend
  2. In the Render settings, hit the "Bake" button.

The objects should already be selected in the correct order for baking (red/green/blue polygons as "selected", the white polygon as "active").
In the UV/Image Editor at the top you should see the result I posted above.

**System Information** Windows 7 Pro (64 bit) and Windows 10 Pro (64 bit), Nvidia Geforce GTX 560 Ti **Blender Version** Broken: 2.77a and at least 2.76 **Short description of error** I tried to bake a bunch of more or less randomly oriented polygons into a texture (diffuse color and normals). The resulting texture was "incomplete": polygons that were backfacing from the camera's point of view (correctly) occluded other polygons that were further away. But those occluding polygons did not create color output, the texture just contained the (transparent) background. I simplified the problem to this scene setup: ![baking_test_scene_setup.jpg](https://archive.blender.org/developer/F362843/baking_test_scene_setup.jpg) The blue, green and red (only outline visible because of enabled backface culling) polygons are one object that I want to bake onto the white polygon. This is my baking result: ![baking_result.png](https://archive.blender.org/developer/F362846/baking_result.png) The red polygon clearly blocks visibility to the green one, but actually does not show up in the baked texture. I would expect one of the two following results: 1. the red backfacing polygon being completely ignored by the baking, hence the green polygon should be fully visible 2. the red backfacing polygon is not ignored by the baking, hence it should be visible in the upper part of the baking result The second case is what I actually want and it would be consistent with what the cycles renderer does (at least from what I noticed so far): ignoring the backfacing property and render the polygons from any direction. Separating the three polygons, selecting them all and baking them does actually work as "expectation 1". The green polygon fills the entire inner part of the blue polygon, the red one is not visible at all. **Exact steps for others to reproduce the error** 1. Open this blend file: [baking_test.blend](https://archive.blender.org/developer/F362848/baking_test.blend) 2. In the Render settings, hit the "Bake" button. The objects should already be selected in the correct order for baking (red/green/blue polygons as "selected", the white polygon as "active"). In the UV/Image Editor at the top you should see the result I posted above.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @tirbelain

Added subscriber: @tirbelain
Anselm changed title from Baking overlapping geometry into a texture does not work with back-facing poligons to Baking overlapping geometry into a texture does not work with back-facing polygons 2016-09-19 01:43:49 +02:00

Added subscribers: @dfelinto, @Sergey

Added subscribers: @dfelinto, @Sergey
Dalai Felinto was assigned by Sergey Sharybin 2016-09-20 11:22:09 +02:00

@dfelinto, can you have a look here? Thanks! :)

@dfelinto, can you have a look here? Thanks! :)

I can confirm it, and I'm surprised about it. @tirbelain do you know if Blender Internal follows the same behaviour?

I can confirm it, and I'm surprised about it. @tirbelain do you know if Blender Internal follows the same behaviour?
Author

Just tested it and Blender Render does this correctly. The lower part is green, the upper part is red. Just as you would expect. Here's the result:
blender_render_bake.png

But actually the alpha channel is broken when performing a "Texture" baking. In the "Full Render", alpha is correct. But maybe there's something wrong with my setup...?

Just tested it and Blender Render does this correctly. The lower part is green, the upper part is red. Just as you would expect. Here's the result: ![blender_render_bake.png](https://archive.blender.org/developer/F365299/blender_render_bake.png) But actually the alpha channel is broken when performing a "Texture" baking. In the "Full Render", alpha is correct. But maybe there's something wrong with my setup...?

Under initial investigation the problem is before the baking itself. If I fill all the non -1 pixels I still get the "alpha" block in RE_bake_pixels_populate_from_objects.

Under initial investigation the problem is before the baking itself. If I fill all the non -1 pixels I still get the "alpha" block in ``RE_bake_pixels_populate_from_objects``.

This issue was referenced by 8ced4417f9

This issue was referenced by 8ced4417f97ecdafefe8a64104a131cc924633f3

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
4 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#49393
No description provided.