Lightmapping triangles

Started by
18 comments, last by raydog 20 years, 2 months ago

Well, that sounds easy to do.
Advertisement
An interpolated normal per lumel seems to help somewhat, but it''s still not good enough for low poly models.

I''m trying to lightmap a low poly sphere (32 faces or so), but the lit faces are very faceted. The lighting
abruptly stops at the edges. So the visible faces are lit, but the adjacent faces are completely black.

Is there anyway to fix this, other than the obvious (increasing the poly count)?
quote:Original post by raydog
An interpolated normal per lumel seems to help somewhat, but it's still not good enough for low poly models.

I'm trying to lightmap a low poly sphere (32 faces or so), but the lit faces are very faceted. The lighting
abruptly stops at the edges. So the visible faces are lit, but the adjacent faces are completely black.

Is there anyway to fix this, other than the obvious (increasing the poly count)?

Sounds like you still have face normals to me. What you need to interpolate are the vertex normals (the average of all the face normals in the faces a vertex belongs to.) Per pixel falloff, using the lumel's distance from the light position for example, could also improve the quality. Now... if your lighting doesn't look like standard per face lighting and is just either black or white faces there could be something wrong with your chart, your lighting equation, etc.

[edited by - impossible on February 10, 2004 7:45:19 PM]
Do lighting on all faces, even those facing away from the light, that way you can correctly get the light to wrap around.

Another idea is to take the ''least backfacing'' vertex normal, and if that one is > 90 degrees from the light, then you can cull the whole face from lighting.
I think I''m using the correct interpolated vertex normals.

Take a look here at my problem:

lightmapping problem

And I won''t know if I''m using a sphere or not, so it has to work for any kind of model.
How are you deciding which faces get lit? Are you culling them out somehow? Perhaps via the face normal?

It looks like the top of the ''sphere'' should be partially lit.
just using dot(L.N), where L is the light position/lumel vector,
and N is the face or lumel normal.

From that angle, the top sphere faces are actually not visible. It may be hard to see from that camera position.






[edited by - raydog on February 11, 2004 9:57:12 PM]
"Face or Lumel Normal"? These two are different. Which is it?

You want to always do the lumel normal - which is an interpolated version of the shared and smoothed vertex normal.

Is your ''sphere'' so low-poly that you''re not getting smoothed vertex normals?
For the first pic, I use the same face normal for each lumel, and for the second pic, I use an interpolated vertex normal for each lumel. The sphere is 48 triangles.

I added more pics to show face and vertex normals:

lightmap problem

[edited by - raydog on February 12, 2004 4:52:20 AM]
OK, you''re using a point light. You just need to tessellate more. The top face vertex normals are > 90 degrees from the light position.

This topic is closed to new replies.

Advertisement