Jump to content

Sign in to follow this  

Baking lights for VR purposes

Recommended Posts

I just finished a 3D model of an apartment that I need for a virtual reality tour (I use A-Frame to do that). For a better performance in the VR tour, I want to avoid rendering the light in real time and rather bake the light information onto the model in C4D, including global illumination, color mapping, ambient occlusion, shadows, etc. My model has many different objects (floors, walls, doors, etc.) and different lights to illuminate the interior (sky, area lights, spot lights, etc.). The goal is to have the model as a single .obj file with the .mtl file referencing the baked texture. 


I searched the internet but but I’m still unsure of the best way to achieve this. These are the steps that I wrote down after watching a few tutorials and that have worked for me using a few cubes just for testing purposes:


  1. UV unwrap each object
  2. Select all objects and click on 'bake objects'
  3. Set up the bake objects option (check ambient occlusion, illuminate, single texture, etc.)
  4. Click on bake


However, the tutorials that I have watched and my test only contain a few cubes. Is this process even possible with a more complex model?


I feel like I’m in way over my head. There are other tutorials that follow different steps, such as using 'bake texture' instead of 'bake object' and connecting all objects into a single object. Would you recommend the steps that I have outlined above or is there a better way to achieve what I want?


As a visual aid, I have attached below a picture of the model in VR (without any lights) and a picture of the render view in C4D (what I would more or less like it to look like in the VR tour).


Thank you for your help!



Share this post

Link to post

Alright @Moumines, so basically you're talking about light mapping, the efficient Game Engine technique, inside of C4D.

So after UVing your surfaces, have you already tried to bake just with the Surface Color option? (separate AO and illuminate will give you more control when compositing your textures)

Did you apply the texture on the color channel and turn off all other channels along with GI and AO in render settings?

Was the result of the floor for example dissimilar to your render?


By the way if it's a game engine that's turning your scene into an interactive  VR executable, then the host is suitable to generating your light maps.

I'm not familiar with A-Frame though, and ...quite frankly it seems impossible to catch up with everything that's going on these days.!


PS. (Should you decide to go with C4D on this one get your mp3s and your sudokus ready, cause as far as baking times goes our beloved package is partying like it's 1999)



Share this post

Link to post
  • Topic Author
  • Thank you for your answer Vertex Helix!


    I have attached a picture of what the render view looks like after baking without GI and AO applied in the render settings (I chose a small file for testing purposes, this is why it looks so pixelated). It looks alright I think, there’s a few UV mistakes that I need to sort out, but otherwise it’s ok for what I want to use it for. 


    Oddly enough, the lights are blown out and the color changes when I use the 3D model in A-Frame (see second image below). This is after exporting it as an obj and then converting it to a gltf object. This is probably some kind of conversion error that I need to figure out…


    I’m not sure though what you mean by baking the light 'just with the surface Color' option? I have attached an image below, there is no surface color option as far as I can tell. Are you maybe referring to the bake texture option?


    Would you recommend using a game engine rather than C4D for lightmapping the model? I have some experience in Unity and access to the software. I thought about exporting the 3D model from C4D without any lighting as an fbx file, import the file in Unity and do all the lighting and lightmapping inside Unity. Is this a better workflow than doing it inside C4D?




    Share this post

    Link to post

    Plus one on Unity for light mapping. You may have a bit of a hard time when you first do it in Unity, but I think it will pay dividends in the future to get comfortable in that workflow if VR is your game. Light mapping there, is fairly automated and definitely quick. I'm by no means an expert in light mapping and to be honest I can avoid it any chance I get, but there are a couple of tips and tricks when you're creating your UV's for light mapping, and you may want to check them out before you get started (for the life of me I can't seem to be able to track my notes in my HDs)


    (*indeed I was referring to the bake texture menu)


    Regarding the blown colors:

    I am not familiar with the A-Frame environment at all I'm afraid, but more often than not there are incompatibilities on the gamma settings between a number of packages when it comes to color interpreting. If the host allows for some tweaking perhaps look first there. Otherwise see  what the color space of the host is (in case is advanced enough to have the VR working on linear, then maybe exposure discrepancy lies there)

    Share this post

    Link to post

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    Latest Topics

    Latest Comments

    • Create New...