createShaderWithTexture method
Create a shader with the star texture bound Returns a new shader instance each time to ensure fresh state
Implementation
ui.FragmentShader? createShaderWithTexture({required ui.Image starTexture}) {
if (_program == null) return null;
try {
final shader = _program!.fragmentShader();
// Bind the star texture sampler (index 0 after float uniforms)
shader.setImageSampler(0, starTexture);
return shader;
} catch (e) {
debugPrint('Failed to create background shader with texture: $e');
return null;
}
}