![]() Vertex coloring of an arbitrary graph is NP complete.When projecting lights, each light would sample the light attenuation buffer and do a dot product with a shadow channel mask to attain its appropriate shadowing value. Dynamic shadows from toggleable lights would be projected into this buffer using a MIN blend (since this is just storing obscurance, you want the more obscured value). The global shadow channels were rendered during the G-Buffer pass into a light attenuation buffer. Storing in linear resulted in banding in the shadows.ĭuring rendering we would un-pack the data into the proper global channels, either using texture remap hardware on the consoles or a matrix multiply on the PC. Baked shadows were stored in gamma space, as we found this to produce much better results. The shadow data was packed into either a DXT1 or DXT5 texture depending on how many shadow channels were allocated for a primitive, and packed into an atlas. Packing non-overlapping lights into the same channel is useful for large surfaces such as floors or hallways. I explained this to artists as "any light can not overlap with more than three other lights". This allowed us to pack a theoretically infinite number of lights in a single baked shadow texture as long as the graph was 4-colorable. Overlapping lights would be placed in different channels, but lights which did not overlap could reuse the same channel. We could then use this graph to do a vertex coloring to assign one of four shadow channels (R,G,B,A) to each light. Lights were the vertices in the graph and the edges were present if two lights' falloff shapes overlapped in 3D space. We made a graph of lights and their overlaps. ![]() The key observation was that if two lights do not overlap in 3D space, they will never overlap in texture space. ![]() We came up with a system that supported baked shadows but put a fixed upper bound on the storage required for baked shadows. The more primitive-light interactions you had, the more the memory used by these textures would grow. Each primitive-light combination required a unique texture in an atlas. The system could bake the occlusion information to a texture for a given light by projecting the shadow into texture space using a unique UV mapping for each primitive. "Toggleable" lights can't move but they can change brightness and color. UE3 had a built in baked shadow system, but it had some limitations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |