Is it possible to bake ALL lighting detail (based on camera position / angle)??

Hi,

I am new to the forum here and have searched for a solution to this problem but haven’t been able to find a definite answer…

Basically, I am creating an isometric game with a stationary camera. I have certain geometry within the game that never changes and I want to bake as much detail as possible into the model, including the specular reflection as seen by the stationary camera.

I know that baking the specular detail into the textures is not normally done as it flattens the image and when viewed from a different angle the texture looks strange. However, in my case, the camera never moves, neither do these particular models - so baking them makes perfect sense.

I’ve attached an image that shows the difference (loss in detail) that baking makes, and also two blend files - one pre-bake, and the other post-bake for ease (not sure if these will actually appear, upload doesn’t seem to work).

I’m using BlenderRender and am not really familiar with Cycles and Nodes at this point in time.


So, basically I want the specular information based on the cameras position baked into the textures along with shadows etc…

I’ve been told it is possible, but haven’t found a working example. Any help would be greatly appreciated :slight_smile:

Attachments


Okay, so the blend files didn’t upload and I accidentally uploaded the baked uv image by mistake (thought I got rid of that…).

Well, you can see in the baked image that the specular lighting is missing. If I disable the Normal Map texture for each surface (walls/floors) in Blender, I get a similar outcome to the image on the right (the baked image). So as far as I can tell, the normal map information isn’t being parsed in the baking process and subsequently the specular info is lost as a result.

Is there a way to bake this information seperatly onto a texture then combine this with the original baked texture and bake again to get the desired result?? I can’t seem to find a baking option that will do this based on the camera’s rotation.

Okay, for any one who is interested I managed to solve this problem.

Here is how to do it step by step in Blender…

First of all, setup your camera exactly how you want it in the scene (mine is Ortho, angled for ISO view and can view the entire room in one frame).

Set the render resolution high (mine was 4096 x 4096) and preferably a power of 2 for texturing / mapping purposes.

Once your camera is position you can then disable the diffuse checkbox for every light in the scene leaving only specular lighting visible.

Once this is done, render your camera image. Mine came out like this… (note, I have reduced size by 75% for web)


This will be used as an overlay later on.

Next step is no different from the normal texturing baking process.

Turn the diffuse checkboxes back on for each light in the scene, create a new UV channel for baking, unwrap the model onto a new texture and bake the texture.

Mine looked like this (notice there is no specular reflection)…


Now create a new material for the model and assign every plane to the new material. Make it shadeless and create a new texture for it using the baked texture and the baked UV map.

It should look like it did before, minus the specular reflection…


Now comes the tricky part…

Create a new UV for the specular reflection. Unwrap the model onto the Specular reflection image (from the beginning) using the Project From View option. This will ensure that all the planes are skewed and rotated exactly as our reflection image (scaling may be needed but shouldn’t be too hard).

Once the UV’s are lined up you can then create a second texture to ADD to the first one. Set it to the Specular Reflection image and the Specular UV Channel, and don’t forget to change the MIX blend option to ADD instead.

You should then have something that looks exactly like it did in the viewport before the baking process began.

Only one step remains and that is to bake these two textures into one final texture bake using the UV’s from the original bake.

I will upload the final images in my next post so you can see the end result…

…and here is the final baked texture (with the specular reflections baked in) and the final rendered result containing only one single texture and zero lights.



And just to be clear this method is only suitable for game scenes where the camera and models are stationary and framerate is an issue.

I intend to use these models in Unity and I will be making use of light probes which only light certain objects within the scene (meaning this model would be lit by a universal ambient light source and everything else would be lit separately).

Anyway, for anyone who is interested, that’s how it can be done using blender…

2 Likes