Page 1 of 1

Sprite Clipping Adjustment

Posted: Mon Jul 23, 2012 20:18
by NeuralStunner
So I have a few questions about this feature:
  • What's the difference between "Smart" and "Smarter"?
  • How do GL_SClipFactor and GL_SClipThreshold work?
  • When sprites are aligned to the floor (Y offset == height), "Always" still adjusts them upward by one "virtual pixel". Is this a simple inaccuracy that could be fixed?
  • Would it be possible/acceptable to turn off adjustment on a per-mod basis through MapInfo? When I work with sprites I typically offset them above-floor. In a few cases (such as explosions) I can still see the sprites get "jumpy" when near the floor. Much like lighting mode, it would be nice if I could choose the best-looking method without requiring the user to change their settings.

Re: Sprite Clipping Adjustment

Posted: Mon Jul 23, 2012 22:51
by Gez
The "smart" setting only affects players, monsters, and pickups.

The "smarter" setting potentially affects everything, but that depends on how much of the sprite's height is clipped without adjustment. For example, very small decorations like pools of blood are only visible with "always" or "smarter", with "never" or "smart" they get hidden by the floor. Smarter clipping doesn't necessarily offset by the amount of pixels that are lost, either: the taller the object is, the lesser the adjustment. This is to avoid the "torches hovering above the ground" effect you get with "always" adjustment. Finally, "smarter" clipping is the only one that will adjust for sprites that are clipped by the ceiling, such as Strife's water drip.

gl_sclipthreshold is used as a "safety value" above which clipping adjustment is nulled, because it is deemed too large to possibly be correct. The default value is 10 texels.

gl_sclipfactor is the value used by smarter clip to adjust the adjustment. It only really matters for small sprites that clip a lot.