Create a circle with say 2 triangular arms pointing straight outward. Say this sits exactly inside a 256x256 texture (i.e. outer radius 128, and inner radius - i.e. radius of the solid disc - of 64). This you can do in code very easily so I will not go into it, here.
Now to create a spiral effect. If you google images of a water vortex, you will note that the area of least transformation is at the outer edge, because the force applied is lowest there. As you get in toward the centre, there is more torsion and thus more deformation.
texDimensions = (256, 256)
centre = texDimensions / 2
rMax = outer radius //128 to start, for a 256x256 image as noted above
rMin = disc radius //the radius of your galactic disc without arms, say 64
for each pixel
dist = maxRadius - currentPixelRadius
apply a 2D [rotation transform][1] dist * k radians.
So, depending on the exact radial distance of current pixel from centre, we rotate by some amount; this is more toward the centre, less toward the outer edge.
You can adapt the arm count, amount of rotation (via k
) etc. How much torsion you want may be influenced by the number of arms, from a "looks good" perspective.
P.S. As this is a once-off process and you likely cache the result for all future use, don't worry over cost, just do it in the loading phase. Else use a pixel or compute shader to do it on the fly / in realtime.