View Full Version : static lightmap on large polygons

07-02-2013, 12:48 PM

I'm working on a glow effect that illiuminates lower parts of walls if the floor in my scene has a glowing texture. My problem: I cannot use any texture atlas or uv lightmaps and the wall polygons can be quite large so that the base texture can repeat. Can I do this somehow with a single lightmap texture and multitexturing and GLSL or do I have to render smaller polygons in a second passe?
Since the base texture gets darkened by the ambient vertex color in the first pass I'm afraid that the lighting effect will not be satisfactory when I use multiple passes.

Any ideas in how to make this work?


carsten neumann
07-03-2013, 01:29 PM
Rasterizer are not very good at these kinds of lighting interactions between objects in the scene; pretty much anything that is not direct illumination from a light source is somewhat difficult to capture. If you have a texture that contains the contribution of static light sources in the scene on a surface (aka a lightmap) it is up to you to combine it with other textures on that surface. I'm not sure I understand the part of the question regarding use of multiple textures.
When computing lighting in multiple passes you need to make sure that each factor contributing to lighting is calculated in exactly one pass. For example if your lighting model contains ambient, diffuse and specular components you could do two passes: the first one handles ambient and diffuse and the second one does the specular component (but does not add ambient contribution a second time).