You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the conversation in #1209 I've had some thoughts on how we might be able to reconstruct light sources to create shadowmaps for maps that we don't have sources for, so I'm putting them here so they aren't lost.
One possible approach to reconstructing them would be a multi-pass process:
Voxelize all of the geometry (this would probably be best done with some sort of sparse acceleration structure, since most of the map volume would be empty space). Assign values to voxels based on the lightmaps.
Process groups of n×n×n voxels (there's probably a more efficient way to do this since surfaces are flat), convert RGB values into luminance, then infer light angle based on the derivative of voxels "mirrored" over the center.
Convergece phase: go over each of those groups and converge angles of nearby groups. This way, if for example, there was an emissive surface that resulted in angle being deemed as 90° for some of the groups, would have it corrected. This would also mean that groups affected by more than one light source would simply converge to the nearest one. This would, however, still have edge cases, like this (light0 and light2 are at a non-90 angle, while light1 is perpendicular):
Ray tracing phase: light from each group based on those angles would be traced through the map with a specified amount of bounces, places where it hits would have some sort of value changing that represents the amount of light sources and their strength.
The previously acquired values from ray tracing phase would be used to construct light sources, potentially merging multiples of them.
Perhaps a phase that would recreate the lightmap and do some adjustments based on the difference between result and original lightmaps?
The text was updated successfully, but these errors were encountered:
So since the .shader files keep the information on which shaders emit light, this might be easier to do, since we recreate the lightmaps created by these light-emitting shaders and then subtract it from the lightmaps we already have, thus leaving only the light entities parts of lightmaps. We would, however, also need to know what settings the map was built with to produce correct results.
Given the conversation in #1209 I've had some thoughts on how we might be able to reconstruct light sources to create shadowmaps for maps that we don't have sources for, so I'm putting them here so they aren't lost.
One possible approach to reconstructing them would be a multi-pass process:
n×n×n
voxels (there's probably a more efficient way to do this since surfaces are flat), convert RGB values into luminance, then infer light angle based on the derivative of voxels "mirrored" over the center.The text was updated successfully, but these errors were encountered: