0
$\begingroup$

EDIT: blend file available at https://pasteall.org/blend/00e3748a22ec43a4825ad76bc6357b85

I am pre-baking textures for a model used in a game, where games art style allows for static lighting. I'm currently facing problem where I don't see any light baked onto my texture, I assume it's due to following


First of all, this is how my scene looks from cameras perspective, note how there are sun reflections on the road

enter image description here


I then proceed to bake my texture by setting up image texture in shader graph and baking

enter image description here


Once bake is finished, I am left with following texture and look, note how there is absolutely no sun on the road and whole model looks like it didn't receive any sunlight at all, shadows are off as well

enter image description here enter image description here


I was trying to play with a renderer and see if I can figure out how to bake these textures from cameras point of view to preserve shadows and lighting, but wasn't able to find a solution, so will appreciate any ideas.

$\endgroup$
4
  • $\begingroup$ Could you perhaps upload your .blend file to make it easier to experiment with your scene? pasteall.org/blend $\endgroup$ May 15 at 22:48
  • 1
    $\begingroup$ Does this answer your question? How can i bake a lightmap and use it in Blender Game engine $\endgroup$
    – Emir
    May 16 at 1:54
  • $\begingroup$ @AlexisKing added to the top of the question $\endgroup$
    – Ilja
    May 16 at 7:57
  • $\begingroup$ @Emir ty for pointing to that question, I don't think it directly solves what I'm trying to achieve, there are few good tips there though. What I'm trying to get to is bake all lights and shadows how they appear from cameras render preview, but at the moment it feels like baking is looking from top of z axis down on the scene when making a bake, not camera $\endgroup$
    – Ilja
    May 16 at 7:59
1
$\begingroup$

Here’s what the Blender documentation on Render Baking says about the Combined bake mode:

Bakes all materials, textures, and lighting except specularity.

Emphasis mine. The disparity you are seeing in your baked textures is the lack of specular reflections.

This should not be surprising, because specular reflections cannot be baked. This is because they are fundamentally dependent on viewing angle, even with completely static lighting. If you were to bake specularity from the perspective of the camera, it would look quite bad whenever the view changes.

The purpose of the Combined bake mode is to bake everything that can be baked in a viewpoint-independent way. It is not, however, a replacement for all further shading. What you should probably do instead is combine the baked texture with a glossy shader to provide viewpoint-dependent specular reflections. For example, you can bake a Combined pass including everything except the Glossy layer, then combine the result with a Glossy BSDF to add specular reflections on top:

You would want to create a similar setup in whatever game engine you are using (making sure to replicate the same lighting!). This is a totally standard workflow, and it’s still relatively cheap to compute.

$\endgroup$
0
$\begingroup$
  1. You're getting lighting. Look at your trees. See how they're darker on one side? I'm presuming that's due to lighting.

  2. Haven't tested Alexis King's answer, but it sounds good to me. (I generally composite manually from non-combined bakes for more control.) If you want a specular lighting pass, you can do an explicit specular pass and add it in (in photoshop, gimp, or even Blender compositing nodes.) Just be aware that it's view dependent-- if your camera moves, it will no longer look right. That's what makes it specular. (For low poly or retro, it's often wise to include a bit of baked specular, not full specular, but that's totally subjective, just my opinion.)

  3. To explicitly answer the title question, because bakes are definitely not from the camera's perspective, and it can easily matter-- to bake from the camera's perspective, you f12 render. If you adopt the camera's perspective and project from view to create a new UV map, you have an appropriate, from-the-camera bake when you use it to look-up a rendered image. This can be remapped to any UV you want with a bake operation. No, it's not right for faces that the camera can't see-- baking those faces from the camera's perspective isn't something that makes any sense, there's no such thing as "right" for those faces.

$\endgroup$

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.