Hi! I am working on a .gd color outlining script for AnimatedSprite3D and Sprite3D (what the hell is a sHaDeR ?!).
What it does is:
on _ready() checks the Sprite3D texture
then, if necessary, duplicate the texture and resize it with n var outline_size rows of transparent pixels and set this updated texture to the Sprite's texture
on update_outline it convert the texture to a BitMap and duplicates it. Calls on the duplicated BitMap grow_mask method (with an outline_size) argument on it
then substract the original BitMap from the dilated one.
> PROBLEM
The debugger keeps throwing me tons of error (outline_component.gd:70 @ update_outline(): Index p_x = 137 is out of bounds (width = 134).) when the outline_size is set to a positive value. To a negative value it displays an inner contour without any error. I kinda get what is this error about, but I thought the _ready() "add-enough-transparent-pixel-rows-around-image" method would be sufficient to avoid this "out-of-bounds" things.
Does anybody has a solution to this problem ?


(I can paste the whole script here if needed)