Static Lighting Tricks in Halo

download Static Lighting Tricks in Halo

of 17

description

Slides from Mike Boulton's GDC 2013 talk.

Transcript of Static Lighting Tricks in Halo

Static Lighting in Halo 4

Static Lighting Tricks In Halo 4Mike BoultonPrincipal Engineer, MicrosoftGDC 2013OverviewToday Ill give a brief summary of the pros and cons of our GPU-based light mapper.

Ill also give an overview of two techniques we used to improve static lighting fidelity1. GPU light mapper takeawaysOur in-house light mapper was written in DirectX11 on the PCRan on DX10.0+ hardwareUsed standard rasterization techniques for direct lightingUsed hemi-cube rendering for indirectRan pretty fastTypically less than a minute for draft direct, less than five minutes for draft indirect1. GPU light mapper takeawaysPROSRan fast allowed artists to iterate on static lighting in a reasonable timeGenerated high quality resultsDraft mode was an honest representation of final results

CONSYou quickly find that fast is never fast enoughNon-workstation graphics cards melt frequentlyNightmare to debug problems with drivers

2. High-efficiency texture packerOne way to improve fidelity is to focus on efficiency

A better texture packer helps a lot here2. High-efficiency texture packerGood resultsVery fast< 30 seconds typicallyVery efficient> 85% pixel utilization typically

10,000 charts>85% efficiencyPacked in 15sCorrect for bilinear

32,000 charts>90% efficiencyPacked in 25sCorrect for bilinear

2. High-efficiency texture packerCollapses UVs of narrow charts

2. High-efficiency texture packerUses greedy transactional multi-threaded modelSupports constraintsE.g. Constraining number of charts per 4x4 aligned block to help with DXT compression artefactsAlso used by character artists for packing UVsFew seconds automated vs. hours manualTypically gave 10%+ space efficiency improvements over hand-packing

Proceeds from top left to bottom rightLike a typewriterIf two CPUs collide we pack one and restart the otherNumber of collisions actually rather low3. Sparse refinement of lighting intensity

3. Sparse refinement of lighting intensityThe direct intensity at each light map texel could be refined down to a 4x4 sub-blockSo a 1024x1024 light map could be 4096x4096, in placesOverlay texture used to point to optional refinement block for each pixelShadow boundaries much sharper

3. Sparse refinement of lighting intensityAn algorithm automatically shared out pre-defined amount of memoryRefinement blocks were actually 5x5 so we could handle filteringAnd were packed into a DXT3A texture

[email protected]