Texture Baking #37681

Closed
opened 2013-12-02 19:25:57 +01:00 by Ludos1978 · 12 comments
Ludos1978 commented 2013-12-02 19:25:57 +01:00 (Migrated from localhost:3001)

System Information
OSX 10.8.5 and NVIDIA GeForce GT 650M 1024 MB

Blender Version
Broken: Blender 2.68a, possibly all versions

Short description of error
When baking (tried only with ambien occlusion) a texture, it does not render the pixels under the edges of a vertex.

Exact steps for others to reproduce the error
see attached blend file and image. when baking ambient occlusion the pixels of the image under a edge of a vertex will be black. This causes errors in the endresult, increasing the margin does not fix the problem in a most cases. for uv-unwraps of very long (and thin) vertices it will allways fail.

Bildschirmfoto_2013-12-02_um_18.57.25.pdf
problem-sample.blend

**System Information** OSX 10.8.5 and NVIDIA GeForce GT 650M 1024 MB **Blender Version** Broken: Blender 2.68a, possibly all versions **Short description of error** When baking (tried only with ambien occlusion) a texture, it does not render the pixels under the edges of a vertex. **Exact steps for others to reproduce the error** see attached blend file and image. when baking ambient occlusion the pixels of the image under a edge of a vertex will be black. This causes errors in the endresult, increasing the margin does not fix the problem in a most cases. for uv-unwraps of very long (and thin) vertices it will allways fail. [Bildschirmfoto_2013-12-02_um_18.57.25.pdf](https://archive.blender.org/developer/F36088/Bildschirmfoto_2013-12-02_um_18.57.25.pdf) [problem-sample.blend](https://archive.blender.org/developer/F36089/problem-sample.blend)
Ludos1978 commented 2013-12-02 19:25:57 +01:00 (Migrated from localhost:3001)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Ludos1978 commented 2013-12-02 19:25:57 +01:00 (Migrated from localhost:3001)
Author

Added subscriber: @Ludos1978

Added subscriber: @Ludos1978

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Added subscriber: @ja12

Added subscriber: @ja12

I don't see a problem here. Bake margin of 0 tries to keep the bake inside the UV islands and with a low resolution image it's far from corner vertices. Increasing the margin to 3 is enough to cover all UV islands -> problem solved.
problem-sample.blend.png

I don't see a problem here. Bake margin of 0 tries to keep the bake inside the UV islands and with a low resolution image it's far from corner vertices. Increasing the margin to 3 is enough to cover all UV islands -> problem solved. ![problem-sample.blend.png](https://archive.blender.org/developer/F36132/problem-sample.blend.png)
Ludos1978 commented 2013-12-03 11:00:18 +01:00 (Migrated from localhost:3001)
Author

If you have very streched vertices it is impossible to have the thin part of it correctly calculated by using the margin option. see the attached picture as example. the example blend file may not describe the problem, but it does illustrate what must be fixed, so the real problem is fixed. the problem will arise when you have complex objects and you want to use texture baking on a production level.

the functionality of the margin is solely to fix problems that may arise from texture filtering, a process that is used in realtime texture calculation that uses pixels outside the uv-unwrapped area. however a correct texture must have all pixels drawn within or under the edges. there is no logical explanation why a margin of 0 gives me black pixels on the object (it is just how it's been all the time, but no correct).

like allways, by manually fixing every uv-map - splitting triangles so there are no long-streched vertices - it is possible to circumvent (but not solve) this problem.

i have seen serveral problems that make baking of blender unusable for real game production in my own projects and giving classes about blender. i identified this problem by luck and i would be really pleased to have it fixed because i dont want to use another tool for baking (which i am currently fored to)...

If you have very streched vertices it is impossible to have the thin part of it correctly calculated by using the margin option. see the attached picture as example. the example blend file may not describe the problem, but it does illustrate what must be fixed, so the real problem is fixed. the problem will arise when you have complex objects and you want to use texture baking on a production level. the functionality of the margin is solely to fix problems that may arise from texture filtering, a process that is used in realtime texture calculation that uses pixels outside the uv-unwrapped area. however a correct texture must have all pixels drawn within or under the edges. there is no logical explanation why a margin of 0 gives me black pixels on the object (it is just how it's been all the time, but no correct). like allways, by manually fixing every uv-map - splitting triangles so there are no long-streched vertices - it is possible to circumvent (but not solve) this problem. i have seen serveral problems that make baking of blender unusable for real game production in my own projects and giving classes about blender. i identified this problem by luck and i would be really pleased to have it fixed because i dont want to use another tool for baking (which i am currently fored to)...
Ludos1978 commented 2013-12-03 13:36:08 +01:00 (Migrated from localhost:3001)
Author

here is another - more specific - problem example (watch for the scene-camera facing triangle). using lightmap pack i uv-unwrapped the object. in some of the sharp edges there are non-rendered texture parts produced by the described problem. increasing the margin will only conceal the underlying problem. manually fixing the parts is possible of course. but it takes a lot of time and for a huge amout of objects is a very disturbing process. i am unsure wether it will be possible to fix, if it introduces other problems with seams, but i think it's worth checking.

problem-sample.blend

here is another - more specific - problem example (watch for the scene-camera facing triangle). using lightmap pack i uv-unwrapped the object. in some of the sharp edges there are non-rendered texture parts produced by the described problem. increasing the margin will only conceal the underlying problem. manually fixing the parts is possible of course. but it takes a lot of time and for a huge amout of objects is a very disturbing process. i am unsure wether it will be possible to fix, if it introduces other problems with seams, but i think it's worth checking. [problem-sample.blend](https://archive.blender.org/developer/F36187/problem-sample.blend)
Sergey Sharybin self-assigned this 2013-12-05 14:17:55 +01:00

The issue is caused by UV face being thinner than a pixel which makes rasterizer believe it run out from the mesh and should stop doing the business.

Not sure whether there's a simple solution for this, only one way to find out!

The issue is caused by UV face being thinner than a pixel which makes rasterizer believe it run out from the mesh and should stop doing the business. Not sure whether there's a simple solution for this, only one way to find out!
Ludos1978 commented 2013-12-10 13:59:19 +01:00 (Migrated from localhost:3001)
Author

i have another point that should be considered when trying to fix this problem. detached triangles that are above the baked mesh will cause the texture to be dark, even in areas that are not completely covered. i think that this may not be completely fixed in a way that it's good for every purpose. however when working on the problem this may be another sample to look into.

Bildschirmfoto_2013-12-10_um_13.56.04.png

counter-sample.blend

i have another point that should be considered when trying to fix this problem. detached triangles that are above the baked mesh will cause the texture to be dark, even in areas that are not completely covered. i think that this may not be completely fixed in a way that it's good for every purpose. however when working on the problem this may be another sample to look into. ![Bildschirmfoto_2013-12-10_um_13.56.04.png](https://archive.blender.org/developer/F38212/Bildschirmfoto_2013-12-10_um_13.56.04.png) [counter-sample.blend](https://archive.blender.org/developer/F38211/counter-sample.blend)

Added subscriber: @Swyter

Added subscriber: @Swyter

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

This is actually rather tricky issue, which isn't so easy to resolve to make it working reliably in all the cases. Will move to the TODO for now (since current match is correct, it's approach to be changed in general to solve the issue) and solve it later.

Here's the link http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Render#Baking

Thanks for the report and stay tuned.

This is actually rather tricky issue, which isn't so easy to resolve to make it working reliably in all the cases. Will move to the TODO for now (since current match is correct, it's approach to be changed in general to solve the issue) and solve it later. Here's the link http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Render#Baking Thanks for the report and stay tuned.
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#37681
No description provided.