Blender baking's margin overlap if multiple meshes are selected #83971

Open
opened 2020-12-20 01:24:41 +01:00 by Alex Faiad · 16 comments

Basically just a duplicate of https://developer.blender.org/T51134 that Aaron Carlisle asked me to send as a new report.

System Information
Operating system: Linux-5.4.0-58-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: AMD RAVEN (DRM 3.35.0, 5.4.0-58-generic, LLVM 10.0.0) X.Org 4.6 (Core Profile) Mesa 20.0.8

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: 3e85bb34d0
Worked: never with Cycles as far as I know.

Short description of error
Cycles overlap the region margin on other islands in the final result.

Exact steps for others to reproduce the error
Cycles will bake an object/island, apply the margin, then proceed to do the same to the next one on top of the previous and they will overlap if the margin is bigger than the distance of the UVs, instead of applying to the finished bake and having the margins having an equal distance between islands, as Blender Internal used to do.

Just press bake on the file. Or any multiple objects with a margin bigger than the UV islands.

As far as I know this has always been a problem with the Cycles baking implementation, besides some other issues of performance and usability. For instance if baked with multiple objects selected it is much, much slower than if I collapse them and merge, as I mentioned in the previous bug report.

I understand it should be slower if they are separated, but I don't imagine it should be that much slower.

Basically just a duplicate of https://developer.blender.org/T51134 that Aaron Carlisle asked me to send as a new report. **System Information** Operating system: Linux-5.4.0-58-generic-x86_64-with-debian-bullseye-sid 64 Bits Graphics card: AMD RAVEN (DRM 3.35.0, 5.4.0-58-generic, LLVM 10.0.0) X.Org 4.6 (Core Profile) Mesa 20.0.8 **Blender Version** Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: `3e85bb34d0` Worked: never with Cycles as far as I know. **Short description of error** Cycles overlap the region margin on other islands in the final result. **Exact steps for others to reproduce the error** Cycles will bake an object/island, apply the margin, then proceed to do the same to the next one on top of the previous and they will overlap if the margin is bigger than the distance of the UVs, instead of applying to the finished bake and having the margins having an equal distance between islands, as Blender Internal used to do. Just press bake on the file. Or any multiple objects with a margin bigger than the UV islands. As far as I know this has always been a problem with the Cycles baking implementation, besides some other issues of performance and usability. For instance if baked with multiple objects selected it is much, much slower than if I collapse them and merge, as I mentioned in the previous bug report. I understand it should be slower if they are separated, but I don't imagine it should be that much slower.
Author

Added subscriber: @alexfaiad

Added subscriber: @alexfaiad
Author

UVoverlap.blend

Screenshot at 2020-12-03 12-43-02.png
I forgot to send the files again.

[UVoverlap.blend](https://archive.blender.org/developer/F9518520/UVoverlap.blend) ![Screenshot at 2020-12-03 12-43-02.png](https://archive.blender.org/developer/F9518521/Screenshot_at_2020-12-03_12-43-02.png) I forgot to send the files again.

Added subscribers: @Blendify, @rjg

Added subscribers: @Blendify, @rjg

This is how the margin for the bake works in Cycles, I don't think we can consider this a bug. If the margin is too large the resulting bakes will overlap each other.

@Blendify Is there a particular reason why you think this would be a bug?

This is how the margin for the bake works in Cycles, I don't think we can consider this a bug. If the margin is too large the resulting bakes will overlap each other. @Blendify Is there a particular reason why you think this would be a bug?
Member

I dont know if is a bug or not, I just wanted a new report to not involve all the subscribers of the original report.

I dont know if is a bug or not, I just wanted a new report to not involve all the subscribers of the original report.
Author

Why I think it's a bug and reported it (and so did the other guy before me):

1- This has always worked in Blender Internal. The way it works in Cycles makes it essentially a useless feature when you have multiple objects selected since you risk destroying hours of bake for no good reason.

2- It is supposed (or at least I strongly believe so) to be a simple post processing filter applied to the END result (not after each object as is currently the case) to save the user some time since otherwise I have to manually do this in photoshop or something else later on. It saves a lot of time when you have to do multiple tests or multiple bakes.

3-Above all, the objects you see are supposed to have single colored materials with the bake, and now they are all messed up. If cycles is messing up with that, it's a bug, no? In my 20 years working with graphical arts I have never seen a use case where someone would want this to happen. There must be, but it's certainly rare, as opposed to mipmappng bleeding.

Just in case the reason for this feature (or so it was in Blender Internal) was not understood by the original developer, it's so that the margins don't become visible when you see a mipmapped texture in a game engine, specially lower end one. Something absolutely essential to be done, and the main reason to bake multiple objects in a single texture (called an atlas) is to save on draw calls for performance on lower end devices. So I would say that the majority of time someone wants to bake multiple objects in a single texture, they will have to disable margin in Blender and do it manually themselves.

I am just astonished that in all this years only myself and the previous guy were bothered enough by this issue to post about it. Which makes me think that people working in actual production just find work around or give up and change to another software. I know I usually do it as well. I just thought this one could be an easy fix while being a big headache for me.

Why I think it's a bug and reported it (and so did the other guy before me): 1- This has always worked in Blender Internal. The way it works in Cycles makes it essentially a useless feature when you have multiple objects selected since you risk destroying hours of bake for no good reason. 2- It is supposed (or at least I strongly believe so) to be a simple post processing filter applied to the END result (not after each object as is currently the case) to save the user some time since otherwise I have to manually do this in photoshop or something else later on. It saves a lot of time when you have to do multiple tests or multiple bakes. 3-Above all, the objects you see are supposed to have single colored materials with the bake, and now they are all messed up. If cycles is messing up with that, it's a bug, no? In my 20 years working with graphical arts I have never seen a use case where someone would want this to happen. There must be, but it's certainly rare, as opposed to mipmappng bleeding. Just in case the reason for this feature (or so it was in Blender Internal) was not understood by the original developer, it's so that the margins don't become visible when you see a mipmapped texture in a game engine, specially lower end one. Something absolutely essential to be done, and the main reason to bake multiple objects in a single texture (called an atlas) is to save on draw calls for performance on lower end devices. So I would say that the majority of time someone wants to bake multiple objects in a single texture, they will have to disable margin in Blender and do it manually themselves. I am just astonished that in all this years only myself and the previous guy were bothered enough by this issue to post about it. Which makes me think that people working in actual production just find work around or give up and change to another software. I know I usually do it as well. I just thought this one could be an easy fix while being a big headache for me.
Author

Ah yeah, the other reason I never reported is because Cycles bake was new back then, and to me this was clearly a bug that you guys just didn't have enough time to fix and I could just wait.

But after all these years I realize that's not going to happen. And judging by Robert's answer, I guess it's because you guys think this is intentional. Hopefully with my explanation it becomes clear why it can't be intentional, just that probably the original developer didn't fully understand the purpose of the feature. Which is surely not obvious if you don't work with game design.

And if you guys still think this could be a feature (and I can guarantee that the vast majority of users who want margin on the bake would not have that intention), then maybe it could be just an option that you activate saying something like "Per object margin - Applies the margin for each object instead of the final result".

But then this would be a feature, and one that rarely anyone will try to use. But more options are always better for the end user in production anyway, if Blender foundation can afford to add them. For simplicity sake I would recommend to just change it to be done after all objects and see if anyone will ever report missing the previous behaviour.

Ah yeah, the other reason I never reported is because Cycles bake was new back then, and to me this was clearly a bug that you guys just didn't have enough time to fix and I could just wait. But after all these years I realize that's not going to happen. And judging by Robert's answer, I guess it's because you guys think this is intentional. Hopefully with my explanation it becomes clear why it can't be intentional, just that probably the original developer didn't fully understand the purpose of the feature. Which is surely not obvious if you don't work with game design. And if you guys still think this could be a feature (and I can guarantee that the vast majority of users who want margin on the bake would not have that intention), then maybe it could be just an option that you activate saying something like "Per object margin - Applies the margin for each object instead of the final result". But then this would be a feature, and one that rarely anyone will try to use. But more options are always better for the end user in production anyway, if Blender foundation can afford to add them. For simplicity sake I would recommend to just change it to be done after all objects and see if anyone will ever report missing the previous behaviour.

Added subscriber: @brecht

Added subscriber: @brecht

@brecht seems like this might need your input. The core problem appears to be that margin is applied per object instead of for all objects in the end.

@brecht seems like this might need your input. The core problem appears to be that margin is applied per object instead of for all objects in the end.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @ziflin

Added subscriber: @ziflin

I just ran into this issue as well. It can easily result in bad bakes when baking multiple objects into a single texture which we do all the time. I don't think anyone would see the current result as being desirable. Ideally the margin would just be a single/separate step done after the baking of all objects completes.

I just ran into this issue as well. It can *easily* result in bad bakes when baking multiple objects into a single texture which we do all the time. I don't think anyone would see the current result as being desirable. Ideally the margin would just be a single/separate step done after the baking of all objects completes.

Added subscriber: @endike

Added subscriber: @endike

folks, this is a very big bug. now blender is neary unusable for serious baking works...
I dont understand why the developers says it is not bug :-O

folks, this is a very big bug. now blender is neary unusable for serious baking works... I dont understand why the developers says it is not bug :-O

Added subscriber: @leomozoloa

Added subscriber: @leomozoloa

I just ran into this very problem and I agree, I fail to see how this would be desirable, it considerably slows down the baking process...

I just ran into this very problem and I agree, I fail to see how this would be desirable, it considerably slows down the baking process...
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:01:57 +01:00
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
7 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#83971
No description provided.