informa
/
DISCIPLINES
Blogs

Refining Smooth Lightmaps

A few weeks ago we added consideration of smooth groups in the lightmap calculations. You may recall the case of luxels (lightmap pixels) that fall outside a face were problematic, and I used a bit of a hack to resolve them...

A few weeks ago we added consideration of smooth groups in the lightmap calculations. (Explanation for new people: we use a forward renderer with static lighting as a fallback that runs across-the-board, and are working on a deferred OpenGL 4 renderer for the next major update.  I've been working with deferred rendering since 2006, so this is relatively easy to add.)

You may recall the case of luxels (lightmap pixels) that fall outside a face were problematic, and I used a bit of a hack to resolve them.  It turns out my hack was fine in situations where the face was interpolated in a single direction, but failed when the face was curved on two axes.  You can see the ugly artifacts that appear across the edges on this sphere:
Attached Image

I wanted to resolve this today, and it was quite difficult.  I tried increasing the size of the polygon edges mathematically,  I tried moving the test point inside the polygon.  For some reason these both failed, and I couldn't tell exactly why.

The solution was very simple.  I just found the closest edge the test point lies along, and then did a linear interpolation between the two corners making that edge.  It works perfectly, and gives the exact same value moving the point inside the polygon would yield:
Attached Image

So you can look forward to improved static lighting on all surfaces in the next patch.  The images below are texture-based lightmaps, not dynamic shading:
Attached Image

CSG modeling is very easy to use, but in the past has been limited to faceted and chunky shapes.  Smooth groups let you model complex curved architecture with our CSG modeling tools. 

Latest Jobs

Sucker Punch Productions

Bellevue, Washington
08.27.21
Combat Designer

Xbox Graphics

Redmond, Washington
08.27.21
Senior Software Engineer: GPU Compilers

Insomniac Games

Burbank, California
08.27.21
Systems Designer

Deep Silver Volition

Champaign, Illinois
08.27.21
Senior Environment Artist
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more