Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jarlowrey |
If I add a shader to my Sprite, it will only extend to the limits of the Sprite. How can I ensure it won’t be cut off?
Example:
Edit:
I have tried adding the shader to a parent node, and setting the shader texture to the Sprite’s texture. Like this:
GDScript
self.material.set_shader_param("tex",$Sprite.texture)
Shader
uniform sampler2D tex;
void fragment()
{
vec4 tcol = texture(tex, UV);
if (tcol.a == 0.0)
{
if (texture(tex, UV + vec2(0.0, outLineSize)).a != 0.0 ||
...
But then nothing appears. It doesn’t look like the texture is being passed in correctly.