I don’t know if there is a better solution but StaticSprite2D’s are also using the normal material system and you could use a shader parameter to draw only a part of the texture: urho3d.wikia.com/wiki/Custom_shader_parameters
You could pass the value for one axis where to fade the material out.
I just tested making all pixel colors above a certain world position transparent:
In the shader (HLSL in this case but GLSL is practically identical):
...
void PS(...)
{
...
// at the end:
if(iWorldPos.y>1)
oColor.a=0;
}
Normal scene: i.imgur.com/I2xIh4n.jpg (don’t mind the black stripes on the terrain, some weird unrelated issue)
Cut model: i.imgur.com/hmMkYtt.jpg
The material has to support transparency for this to work. Also the shadow is here still completely there, that could be fixed though but shouldn’t matter for your case.
One can also fade the color out:
oColor.a=oColor.a*clamp(1.0-(iWorldPos.y-1)/0.5,0.0,1.0); // fades out from Y world pos 1.0 (visible) to 1.5 (completely transparent)
This results in this: i.imgur.com/ExY7yWh.jpg
Also an interesting thing I had by having the clamp parameter in the wrong order: i.imgur.com/Slhct4r.jpg