Baking ray distance do not work. #62422
Labels
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#62422
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: win7x64
Blender Version
Broken: 2.80 (sub 47),
a0f2923fd8
, 2019-03-08 21:522.79 main too
Short description of error
Baking emissive from object causes strange additional lines.
With cage it becomes even worse
Exact steps for others to reproduce the error
Here the file. Try to bake Emissive from Donor to Recipient with Cage or without
111blend.blend
Added subscriber: @Vyach
Ok. It seems, that ray distance do not work for backface and inside of mesh. So cap and border baked on the bottom. And side was baked on the top:
Here the file with success baking
success.blend
And i forced to put cage inside recipient.
Should it work this way?
Why ray distance do not work at all?
Baking artefacts object to objectto Baking ray distance do not work.As I found it works now back way: rays shooting from selected to active and hits inner cage.
Ray distance is not working at all.
Ofcourse cage extrusion is not working with backray: it extrudes only outside as it should.
Added subscriber: @ZedDB
I can confirm that ray distance doesn't seem to work.
No matter what distance the bottom face of the active object will hit the top of the bake object even though the rays should be able to reach.
At least that is what I think should happen by reading the manual: https://docs.blender.org/manual/en/dev/render/cycles/baking.html?highlight=ray%20distance
@ZedDB, I felt that is something wrong before manual. Then I read it. And it is still not working as in manual or as expected(intuitive way).
Added subscriber: @IngmarFranz
There should be a rewriting of the manual concerning "ray distance", because it's not clear what the difference is between** "ray distance"**("cage" not checked) and "cage extrusion" ("cage" checked):
https://blenderartists.org/t/baking-with-cage-ray-distance-vs-extrusion/681424
Could it have to do with split vertex normals as explained generally here (left image):
http://wiki.polycount.com/wiki/Texture_Baking#Cages
This could be the case since the blender manual (https://docs.blender.org/manual/en/latest/render/cycles/baking.html)
writes for "cage extrusion":
"The inward rays are casted from a version of the active object with disabled Edge Split Modifiers."
Then, "ray distance"would automatically create a cage object butwithout removing any Edge Split Modifier like "cage extrusion" does?
NOTE: I've tested it and didn't find the Edge Split Modifier beeing removed with Cage Extrusion active (Blender 2.8 Beta). Marking edges as sharp always affects Cage extrusion (even without Edge Split Modifier)
According to Blender's source code in ui.py (blender-git\blender\intern\cycles\blender\addon), lines 1866 to 1871,
"ray distance"also issome kind of cage extrusion:
If I understand it right, the manually created cage object replaces the cage object created automatically "extrusion", since the Blender manual writes:
"Object to use as cageinsteadof calculating the cage from the active object with the Cage Extrusion."
Member cgCody on blenderartist (link above) sees "extrusion" as on offset to the manually created cage object.
If "ray distance" and cage "extrusion" aren't the same, is there an example to illustrate this?
Thanks for explanation, but in this specific case only cage/extrusion fail, because there is no ray-limit.
As I can understand, it should work like this:
Purple is size of manual cage or extrusion. Black is object with semitransparent parts (baking source) and length of cyan ray will prevent backside baking.
Also there should be such image in the manual. It will work much better than hundred words. And I can do nice scheme, if you need.
any changes?
I hope, it will be fixed for release at least :(
Added subscriber: @EllJNidan
Bear with me: I promise, this is relevant.
TL,DR: The "Ray Distance" setting in Cycles for texture baking, that seems to have replaced the "Distance" setting in Blender Internal, does not do the same thing. If it's supposed to do the same thing, it's broken and should be fixed; if it's supposed to do something different, then the old "Distance" setting should be brought back in some form.
There are two ways to bake textures onto an object. The usual way, the default way in Blender, is to ignore the other objects in the scene and just render, for example, the lighting, shadows, and/or textures that are visible on the active object. This method is best for capturing detailed, expensive lighting and effects by rendering them once as a texture, instead of every frame; baking a full render of an object's shading to save time rendering animations or game assets, or isolating certain effects to tweak them without affecting all of the others.
The alternative way, enabled by clicking the "Selected to Active" checkbox (Render settings -> Bake panel), renders all other selected objects onto the active object's surface. This method is best for transferring textures from one object to another; baking high-poly detail onto a low-poly mesh, or baking decals or stencils onto a model. That last application is the one that makes this bug most obvious.
Using Blender 2.79b and Blender Internal, if I set up a model to receive a baked texture, along with one or more "decal" objects to generate textures from, I will get the following results by default:
Obviously no good, but I can easily clean these results up by changing the "Distance" setting (also in Render settings -> Bake panel). By default it's 0.0, which is treated as infinity. If I make it a much smaller number (0.01 for the airplane, 0.02 for the head), I get this instead:
Much better. The stars and stripes appear (mostly) where they're supposed to on the airplane, and the eyes, brows and lips no longer show on the back of the head model. However, when I bake the same objects in Cycles:
Somehow the airplane actually looks worse than it did in Blender Internal. The head model looks okay at first*, as long as you don't look too closely at the hairline, which shows some improper baking. But if I pull the hair portion of the mesh away from the main head:
the face that was on the back of the head is still there, it's just hiding on the inside now!
When I look for the "Distance" setting in the bake panel, all I see is a "Ray Distance" setting. I'm not sure whether that's supposed to be the same thing or not, but it doesn't seem to do anything in this case. I get exactly the same baked result whether "Ray Distance" is set to 0.0, 0.01, 0.02, or anything else I've tried. And it doesn't matter whether I use Blender 2.79b or the 2.80 release candidate, I get the same result in Cycles regardless.
It looks like I may need to report a separate bug, too. I noticed it when I was looking at the way the eyes differ on the head model when baked from Cycles vs. Blender Internal: See how the Internal version, the iris butts up right against the top of the sclera, but in the Cycles version, there's a little line of brown where the iris is almost hanging off of the top of the sclera like a pendulum? When I mess with the margin:
...it becomes obvious that Cycles is actually rendering a margin around my source decal objects, instead of around the UV islands in the target object, the way Blender Internal does:
...but that's a separate bug, probably related to the way that Cycles omits the active object from the bake when "Selected to Active" is enabled. If no one else beats me to it, I'll report that one too, when I have some time. But anyway...
I'm attaching six versions of my .blend file, but you probably won't need them all to confirm the bug; there are files with "Distance" or "Ray Distance" set to 0.0, and set to 0.01 or 0.02 ("No Distance" or "Small Distance"); there are files for Blender Internal or Cycles; and there are files for 2.7x and for 2.8x.
*I do realize that the harsh shadows on the head model in these images is a result of my UV map, not necessarily a Cycles render bug. I used "Smart UV Project" to quickly get a map for baking. If this were a production model, I'd unwrap it by hand, which would probably eliminate those artifacts.
.blend files:
Bug Report Texture Bake Decals - 2_80 Cycles, Small Distance.blend
Bug Report Texture Bake Decals - 2_80 Cycles, No Distance.blend
Bug Report Texture Bake Decals - 2_79 Cycles, Small Distance.blend
Bug Report Texture Bake Decals - 2_79 Cycles, No Distance.blend
Bug Report Texture Bake Decals - 2_79 Internal, Small Distance.blend
Bug Report Texture Bake Decals - 2_79 Internal, No Distance.blend
EDIT: Someone else did beat me to the other bug report: https://developer.blender.org/T62429
Any news?
poke
poke №2
Added subscriber: @dfelinto
Closed as duplicate of #66438
Added subscriber: @mano-wii
@mano-wii
Can`t understand why its merged. Here the problem with ray distance logic (total length not limited, only cage height/distance)
There — problem with margins. Are they have same root?
Changed status from 'Duplicate' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Confirmed'
Also the reason of such result, is that baking ray go throuh transparent shader and bake line from other side of mesh, because «baking ray length» describes only H, but not L.
Baking goes from initial mesh to target mesh, and baking ray starts from H:
Ray do not stop after passing H distance, if it not intersect with donor pixel.
It goes through mesh, collides with pixel on the other side and get this pixel.
poke
Any news?
Added subscriber: @AndyDavies-3
Hi @AndyDavies-3 could you lend me a hand here? I think baking is working as expected in this case, but I could hear your 2 cents on it.
@Vyach can you include an image with the expected "correct" baked result from the reported sample file. Be aware that Blender doesn't have support for "blocker" geometry, which is fundamentally what you need for a model like yours.
@dfelinto I'll try to bake it properly or imitate proper bake.
if it works as intended, the algorytm is not full by design.
It have only elevation of ray-start above surface, but do not have ray length from elevation point to surface, that shouldn` be infinite anyway.
This comment was removed by @Vyach
In my opinion baking ray should be terminated not only by impact with Donor, but by impact with Recipient too or after passing ray-length.
Here scheme in 3d.
Any objections, that it shouldn`t?
rays.blend
And here is expected result (finally got it.)
bake2.blend
What you are suggesting (ray-length limit) could be implemented as a new feature. I wouldn't mind accepting such a patch.
To limit baking ray by collision with the low poly object (what you call the recipient) is too arbitrary, and not what you want need a lot of the time. Again, the proper solution for this would be to support "blockers" which was never considered a priority, but again, it would be an welcomed patch to receive as well.
Ok, I think I can simply add a "max ray distance" variable.
I already looked at the code and it should be hard at all.
Added subscriber: @sebastian-4
@ZedDB Is it necessary to add a new "max ray distance" variable? There's already a "Ray Distance" variable in the Bake panel; isn't this what that's supposed to be for?
Edit: Sorry, @sebastian-4, didn't mean to tag you.
@EllJNidan that setting does not limit the ray distance of the rays. It simply seems to offset the starting location of the ray in question.
Posted a potential fix here: https://developer.blender.org/D7733
Ah, I see. Thanks!
@ZedDB okay, thank you very much for understanding.
Such option will make this kind of baking easier and can reduce artifacts in other cases.
As you can see, I`ve got proper result by adding lot of new geometry and making Donor clozed.
@dfelinto baking isn`t always from hipoly to lowpoly. Sometimes it is just transfer from one model to another.
So I prefer Donor → Recipient or Source → Target.
This issue was referenced by blender/cycles@fa0b991b46
This issue was referenced by
27cac4a102
Changed status from 'Confirmed' to: 'Resolved'
@ZedDB Thanks again. Just tested it. All works fine.