Author Topic: Corona Light bakes Black Textures (Texture Baking)  (Read 6804 times)

2019-05-30, 20:35:38

Vegeta

  • Users
  • *
  • Posts: 2
    • View Profile
Hello everyone. I am new to this forum. Tried searching for this problem but couldn't find proper response. So making this thread.

I have a Corona Scene in 3Ds Max which I need to export to Unity. I wanted to bake the Light maps using "Corona Light". When I tried baking, the Light map turns out to be a Black Texture. Can anyone explain me what I am doing wrong ?

I did find some people facing the same problem but couldn't find the correct solution. Would be grateful if anyone can help me out.

Thank You :)

2019-05-30, 22:11:20
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8848
  • Let's move this topic, shall we?
    • View Profile
    • My Models
It's hard to tell what's wrong without knowing your setup.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2019-05-30, 22:29:43
Reply #2

Maros

  • Active Users
  • **
  • Posts: 20
    • View Profile
I never had success in light/texture baking with Corona and also in other topic you will find that Corona is not for baking.

2019-05-30, 23:35:11
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8848
  • Let's move this topic, shall we?
    • View Profile
    • My Models
That's not entirely correct. Yes, Corona can't bake with projection, but it does fine job when there's no projection involved.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2019-05-31, 16:52:37
Reply #4

Vegeta

  • Users
  • *
  • Posts: 2
    • View Profile
It's hard to tell what's wrong without knowing your setup.

It was a simple setup. I made a small room. Placed a cube. Textured the room and cube with Corona Materials. Setup lighting with Corona Light material. Every other setting at default. (File is in my Office workstation so couldn't upload screenshots :()

When I rendered, the quality was good. I wanted to export the lighting to Unity which is what I have trouble with. I made UV maps and unwrapped the models. But when I bake, Corona_light produces a Black Texture.

2019-08-03, 23:28:22
Reply #5

confy247

  • Users
  • *
  • Posts: 2
    • View Profile
Can someone from Corona staff confirm that the Corona_Light RTT is REALLY a working lightmap baking solution? It seems it's broken or just left incomplete, due to particular complexity of generating proper lightmap texture output. It should contain only indirect color information but NO initial diffuse, which seems the main difficulty of realization.

Please guys, don't ignore this thread.

2019-08-06, 15:14:40
Reply #6

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12758
  • Marcin
    • View Profile
Corona staff here.

Sorry for the delay. Can you guys explain what exactly you are doing? What I mean is not just "baking a light map", but also an explanation what this "light map" exactly is, and how exactly it will be used.

The Corona_Light element currently works ONLY with a Corona Light Material.
So if you:
- create a box
- apply a Corona Light Material to that box
- Optionally: plug some texture as the texmap of the Corona Light Material
- Set up RTT
- Render to texture
Then the Corona_Light element will show the texture used as the texmap of the Corona Light Material you applied to the box.

In all other cases, it will render black.
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2019-08-06, 15:57:00
Reply #7

confy247

  • Users
  • *
  • Posts: 2
    • View Profile
Thanks for the clarification. It all makes sense now, no lightmap baking supported in Corona currently.
« Last Edit: 2019-08-06, 16:25:07 by confy247 »

2021-01-14, 09:33:58
Reply #8

leitecunha

  • Users
  • *
  • Posts: 4
    • View Profile
Hi there, I know this is an old thread, but in case anyone tries to use Corona to bake a lightmap, it is possible.
You have to render both these 2 render elements:

Diffuse
Diffuse Color.

The lightmap is just one divided by the other. What you gotta do is put both renders in photoshop, the one with just the Diffuse Color on top of the other. Then, on that top layer (Diffuse Color), change the blending mode to Divide. And that's it. Just merge both, and you have the lightmap, black and white, and even the color spills from other objects.

Note that in any lightmap rendering, you can render them as an HDR or a PNG (or other 8bit format). When rendering in HDR, you can set the intensity of light super high and everything will be correct, no clipping etc. But of course, on the game engine side, rendering HDR maps in realtime is overhead, specially for mobile or VR standalone (Quest).
So it's best to render the elements and save them as PNG, but in this case, first check if the light is not clipping the white values... or the final lightmix in the game engine won't be exactly correct.
One way to check if you're not clipping is to just temporarily remove the diffuse texture and render it with the white color (or lower the white to ~235, because no physical material is capable of reflecting 255, the full white).

And that's it!
« Last Edit: 2021-01-14, 09:39:13 by leitecunha »

2021-01-14, 09:59:15
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8848
  • Let's move this topic, shall we?
    • View Profile
    • My Models
@leitecunha, thanks for the useful information. Would you mind if i'd ask you to also post it in this topic, so it could easily be find in the future: https://forum.corona-renderer.com/index.php?topic=9728.0
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2021-01-14, 12:26:13
Reply #10

leitecunha

  • Users
  • *
  • Posts: 4
    • View Profile
Of course! I'll do it. Thanks.

2021-01-14, 12:32:02
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8848
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Thank you!
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures