This is iPHONE model I've made in Blender: https://www.youtube.com/watch?v=8gfES8_tEF0

While I tried to bake the diffuse map of the model I'm getting an unexpected result. Only the Apple logo and camera is baked into the image. Rest is simply black.Anybody have any idea?Is it a bug? Can somebody check the file and help me?. You can download the file here: https://drive.google.com/open?id=19FNL6wrKAa7LueqQux0XCyJLFUm_q2Aw


(a)Maybe things have changed over the past couple of years but so far as I know transparency isn't bakeable yet so the screen area will need special handling.

(b)At the back of the model, the part with the material named "Frame(Backside).001" and the part with material "Back Cover.001" are nearly overlapping. That overlap is bad for any type of rendering because the floating point precision limit makes it difficult for the renderer to know exactly where both parts are in relation to one another because both parts are essentially in exactly the same place once numerical imprecision is considered.

You can get away way with using close flat polys for a camera render if the model and camera are close to the grid center and to each other but still; super close, parts flat parts should be avoided.
This type of error is called z-fighting.

And I believe it's why the those parts are coming out black when baked. They overlap and so both are being baked as if they are each inside the model and hidden from the light. The baker can't tell which one is outside and which one is inside where it's dark.

I think the overlapping geometry also causes BVH(bounding volume hierarchy) build issues since Blender froze on me when I tried to bake the model. BVH is a spatial partitioning optimization technique. I forced Blender to shutdown and then my OS crashed. Bluescreen of death. The freezing of Blender took place right at the beginning which is when the BVH build takes place.

Anyways, once I separated all the parts and moved them to their own layers and baked them one at a time to look for issues, the BVH freezing no longer happened and everything baked with lighting applied properly. There were no black parts showing up in the bake. There were some errors on one of the pieces but that looked like a UV-mapping error and I didn't try to track it down. That's a separate topic and this is all long enough already.

(i)You can either baked all the parts to their own textures as in Diffuse_0.png, Diffuse_1.png, Diffuse_2.png, etc, and then combine them all in a 2D photo editor like Krita, GIMP, or PS. using part masks or...

(ii)You can also UV-Unwrap models with complex pieces as separate parts right from the beginning of the process so they can easily isolated and baked. Once all the pieces are baked, you can then join them and and create a second UVMap. Now set all the materials to be Emission shaders which acts as a simple image color passthrough and then bake the pieces all to one final UVMap set like what you have in your model now.

enter image description here

You made things too complicated by trying to bake nine materials, a model with hidden parts, multiple types of shaders(Diffuse, Glossy, Emission, Transparency) all at the same time. And since you can't bake transparency(so far as I know) you have to handle the screen manually after everything is baked.

(a)You can either bake an alpha mask(transparency mask) or use the rectangle tool in a 2D editor to select the screen portion of the image and make that area transparent.

(b)To bake an alpha mask, use a temporary Emission shader that can mix between black and white and apply that material to the entire model. Set anything opaque to be white and the screen to be black.
Now in a 2D editor, this baked transparency mask can be pasted into the alpha channel.

On a side note, that large back piece that is hidden inside is just a waste of uv-map space, it should be deleted.

  • $\begingroup$ Thank you very much for spending your time for me and I'm extremely sorry for the OS crash and BOD happened in your system. That didn't really happened in my system. I didn't know why that happened in your pc. Any way, I'm extremely sorry for that.I really didn't cared much about back cover and frame back side separation distance since they didn't show any bad outputs in the rendered image or video output. I will fix that. $\endgroup$ – Finisoft Dec 23 '18 at 7:24
  • $\begingroup$ But I have a doubt, I was trying to bake the diffuse map with direct and indirect lighting unchecked. You said that baking diffuse output for a model which is having multiple types of shaders(Diffuse, Glossy, Emission, Transparency) all at the same time is not preferable. Why is that so? Even if there are multiple types of shaders, it will bake only the diffuse shader right. I've already done those and haven't experience any issues. Could you please tell me more about those or direct me to a link that can help me that? $\endgroup$ – Finisoft Dec 23 '18 at 7:24
  • $\begingroup$ One last thing. In the end you said that the large back piece that is hidden inside UV map space is a wastage and must be removed. Was that about the back cover? $\endgroup$ – Finisoft Dec 23 '18 at 7:27
  • $\begingroup$ The reason I said to avoid baking lots of pass types all at once is because you're new to baking textures and you're having problems. It's best to start with simple pieces and work your way up to complexity. I have no links to prove this to you, just 10+years of experience tells me so. sketchfab.com/models/6ddbdeba6e154b2abb1103650032f20c $\endgroup$ – MarcClintDion Dec 24 '18 at 9:08
  • 1
    $\begingroup$ Yeah that worked $\endgroup$ – Finisoft Dec 26 '18 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.