KatsBits Community

Game Editing => idTech Editing Hints & Tips => Topic started by: kat on July 07, 2015, 06:13:46 PM

Title: What are 'Sparklies' and why do they happen
Post by: kat on July 07, 2015, 06:13:46 PM
Problem
When running through a level various spots seems to 'sparkle' or 'twinkle' as the camera moves past or around them. Often there are no obvious reasons for their appearance as the area looks perfectly fine.

Solution
The white lines that can sometimes appear are commonly called "sparklies" by level designers. They are caused by almost imperceptible tiny gaps or cracks in surfaces, typically where polygons touch. The 'sparkle' aspect of the problem is essentially just the 'Void' outside the structure shining through; because the Void is often a lighter colour, and due to the way rendering shuffles pixels around as the camera moves, the net effect is a faux 'twinkle' - the effect is not specifically related to 'illumination' (although it does happen if the hairlines cracks expose lights or other effects).

There are number of reasons why 'sparklies' happen;
How to determine what's causing sparklies

Simple Gaps
Generally speaking because the error tends to be of a fixed location - sparklies always tend to appear in the same place - it should be possible to fix the problem by opening the level in Radiant or other editor and thoroughly inspecting the offending area to see if an actual gaps exists. If they do delete the offending volumes and reconstruct before re-compiling the level.



Duplicate Planes/Bad Brush
If there are no gaps then it's likely the result of a rounding off error, a bad or corrupt brush volume, in which case run bobToolz "Brush Cleanup" ("Plugins » bobToolz » Brush Cleanup") to remove the malformed volume or data (this may remove the actual brush from the level). In some instances this won't fix the problem so the area will need to be deleted and rebuilt.



Patch Mesh Sparklies (T-Junctions)
If the appearance of 'sparklies' are near a curve or other patch mesh structure it means the point where brush and patch meet[1] needs to be better optimised to prevent errant splits (or T-Junctions). In Radiant inspect the area and cut the brush so its the same size and angle relative to the patch mesh and move or cut brush structures to match edge-for-edge or more typically edge-to-corner[2].



Graphics Card Drivers
If none of the above fixes the problem then it means the appearance of sparklies could be down to a graphics card rendering error. Although this is rare for modern cards, some older models for which drivers are no longer available can still exhibit the problem. Sparklies can also occur as a result of over-clocking or over-heating hardware.