ands / lightmapper

A C/C++ single-file library for drop-in lightmap baking. Just use your existing OpenGL renderer to bounce light!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shadow baking

lm165678 opened this issue · comments

Hello, I am studying your code, I tried to modify the shader to add bakeScene, but it seems that the shadow cannot be baked properly. Can you tell me an idea? Or provide some reference code? Sorry, I am a novice. Thank you!

commented

Hey @lm165678!
You can find reference code in the example.c file.
From your description it is not clear which part is not working. Can you provide more information please (e.g. screenshots)?
What are you trying to achieve and what does your setup look like? Would you mind sharing your code maybe?

Sorry to reply you so late, I think I may know the reason. Radiosity does not seem to be used to bake shadows, but to simulate global illumination. Therefore, I used direct ray tracing to mark shadows and illuminate the part, and then used radiosity to bounce multiple times to simulate global illumination.

commented

You could use this library to bake shadows from area light sources (see example images on the front page). But since you seem to have a solution now, I'll close this ticket then :).