Author Topic: Lightmap baking confusion  (Read 2154 times)

2017-08-21, 19:22:07

Monkeybrother

  • Active Users
  • **
  • Posts: 225
    • View Profile
I'm using Flatiron to unwrap and bake textures for exporting to Unity, but I can't find a way to get just light/shadows or indirect lighting (without textures etc). I've searched the forums, and I see people talking about baking lightmaps, so I assume it's possible. How can I bake lightmaps using Corona? I thought about using an override material on the scene and use the diffuse map, but then I won't get the color bleeding/bounce.

2017-08-22, 10:17:52
Reply #1

Monkeybrother

  • Active Users
  • **
  • Posts: 225
    • View Profile
Nobody? Is it not possible to get lightmaps for use in Unity/Unreal in Corona?

2017-08-22, 10:55:22
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 8612
  • Marcin
    • View Profile
Hi, can you explain what exactly would be needed? I am simply not familiar with this workflow, and not sure about the word "lightmap". How is it used, how does the process look in other renderers?

2017-08-22, 11:46:03
Reply #3

Monkeybrother

  • Active Users
  • **
  • Posts: 225
    • View Profile
Ok. I found a good summary in the V-Ray docs: "[a lightmap] is the sum of all raw lighting (both direct and indirect) in the scene, without any diffuse details." https://docs.chaosgroup.com/display/VRAY3MAX/Raw+Total+Lighting+%7C+VRayRawTotalLighting. But if you are going to update the baking, why not add as many elements as possible? It would, for example, be useful to be able to have direct and indirect lighting as separate textures in some instances.

Why?: in unity I import a model, apply textures (diffuse, normal, etc), then superimpose the lightmap on top of that. That way I can change the parameters of the baked light independent of the other texturing = a lot more flexibility and texture sizes are a lot more optimized (since a lightmap can be relatively low res and still work). If I just bake out a diffuse pass, it would have to be enormous to get enough detail in the diffuse textures and it would be very hard and cumbersome to make any changes.

Here's a tutorial for a lightmap shader in unity where you can see it in action:
. The weird thing is that he says he rendered the lightmaps in Corona, maybe he used the override material "trick".

2017-08-22, 12:30:47
Reply #4

Monkeybrother

  • Active Users
  • **
  • Posts: 225
    • View Profile
I found a workaround: I contacted the developer of the lightmapping shader and got this response:

"First of all, thank you so much for buying Standard Plus.

I'm making a video tutorial on how to get only the lighting information from Corona, since out of the box they still don't support that, as opposed to V-Ray.

But it's not difficult. The way you achieve that is by creating a Corona material called Corona RaySwitch Material.

In the Rayswitch material you'll have four material slots: one for global illumination, one for reflection, another for refraction, and another one for the visual material for the camera.

So, in the first three slots, you plug the material you created for your object.

But in the last slot, the visual material, you put a 100% white material, with no reflection or refraction.

Now, you assign this Rayswitch material to your object and in the Render to Texture you simply choose Corona Beauty, just like that.

What will happen is, since for the camera the material is 100% white, the render will behave like it is rendering only the lighting coming to the object, but thanks to the rayswitching, your material will spill the GI colors to other materials, and all the reflective properties wil be preserved to every other object that come in contact to it."

For anyone doing a search for lightmapping. It's not ideal if you have many materials, but it's a lot better than nothing.

2017-08-22, 12:47:01
Reply #5

Monkeybrother

  • Active Users
  • **
  • Posts: 225
    • View Profile
Hi, can you explain what exactly would be needed? I am simply not familiar with this workflow, and not sure about the word "lightmap". How is it used, how does the process look in other renderers?

Do you think there's a possibility that more render elements will be added to a daily in the near future?

2017-09-01, 11:13:15
Reply #6

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 8612
  • Marcin
    • View Profile
Sorry for the delay. I have just added this thread to a list of RTT feature requests here: https://corona-renderer.com/forum/index.php?topic=13088.0
Improving RTT is a high priority for us, as it seems that some important options are lacking in Corona now, however there is a lot of work for our developers already. Projection modifier support is scheduled for 1.8 version (https://trello.com/b/EfPE4kPx/corona-road-map-3ds-max), so I think this is the time we can also expect new render elements.

2018-01-08, 19:23:04
Reply #7

mike_kennedy

  • Active Users
  • **
  • Posts: 98
    • View Profile
I can't see projection on the main trello , but i can in the menu, it's it likely to hit with V2?