ID:2373001
 
Resolved
Some filter combos could cause an image to appear out of place the first time certain filters were used, which would self-correct in a future frame of the screen.
BYOND Version:512.1426
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 66.0.3359.181
Applies to:Dream Seeker
Status: Resolved (512.1427)

This issue has been resolved.
Descriptive Problem Summary:
If you put both an outline and a drop shadow on an object, it gets really messed up. The drop shadow ends up getting shifted by (x+1, y-1). drop_shadow plays nice with every other effect like blur. Since drop_shadow uses the outline effect internally for the border variable, there's probably something wrong there.

Numbered Steps to Reproduce Problem: Add both an outline and a drop shadow to a object.

Code Snippet (if applicable) to Reproduce Problem:
src.filters += filter(type="drop_shadow", x=2, y=-2, color=rgb(0, 0, 0), size=6, border=8)

src.filters += filter(type="outline", size = 6, color=rgb(0,0,0))


Expected Results: drop_shadow and outline to coexist

Actual Results: The drop shadow ends up getting shifted by (x+1, y-1). It also messes with any alpha your dropshadow's color might've had I think.

Does the problem occur:
Every time <--
In other games? Haven't tested.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur? When it's not done.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? N/A, 512

Workarounds: None, you just have to basically give up on using outline.

Thanks for the report. I fixed something similar to this for drop shadow filters all on their own, so there's probably something else much like it in play here.

Mind you it's VERY weird to be doing the outline after the drop shadow instead of before, but I suppose you have your reasons.
Okay, I'm looking at this and what wasn't clear from the original report was that this shift happens on the very next tick after the first time the filters are applied. Clearing the filters and then redoing the effect doesn't cause a problem at all. Very weird! (Futhermore, the issue reappears after a reboot, so it's not DS-session-specific. If I turn hardware mode off and back on, it happens again.)

Also the += operator isn't relate to the problem, since setting the filters all at once with a list doesn't make a difference.

I did notice you're using border instead of offset as an argument in your shadow filter, and that's to be expected because I screwed that up in the documentation. Currently that argument is being ignored.

The alpha problem appears to be a trickier business. I can't explain that one, but I'll look into that as well.
I haven't had a chance to get back to this yet and likely won't get to it before 1427 is out, but it's still on my radar. What I've noticed about this is that it isn't so much the next tick when the shift happens, but the next animation tick. If you don't have any animated icons on the screen, I think the shift may well wait indefinitely until something else changes.

I have no explanation whatsoever for that.

[edit]
Well shucks, my fiddling with the filters for an unrelated purpose appears to have fixed the position part. I did see an issue with the vertex shader that I dealt with, but I didn't think it was having any effect. Apparently it does.

The alpha part is trickier. The thing is the outline filter was only ever intended for solid objects, and it's handling alpha badly; I see why that is now. I'm not sure it's necessarily worth it to fix, but I think at least it would be a separate issue from the positioning problem.
Lummox JR resolved issue with message:
Some filter combos could cause an image to appear out of place the first time certain filters were used, which would self-correct in a future frame of the screen.