For computer software, the easiest way to take a sphere (and/or hemisphere) and flatten it into a flat shape (usually a rectangle) is the equi-rectangular projection (also known as the plate carrée), because it has the simplest formula relating pixels and coordinates:
$$x = w \times \frac\lambda{360} + \frac w2$$
$$y = -h \times \frac\phi{180} + \frac h2$$
where $x$ and $y$ is the pixel point, $w$ and $h$ are the width and height (in pixels) of your map's rectangle, $\lambda$ is the longitude in degrees and $\phi$ is the latitude in degrees
This all assumes that your map puts the 0 longitude, 0 latitude point in the center. In other words, the prime meridian runs down the map's middle vertically and the equator runs down the map's middle horizontally. It also assumes that north and east are positive, while west and south are negative.
Notice that you don't even have to take the sine or cosine of anything. That's why the equi-rectangular projection is so simple. It basically just takes longitude and latitude and makes them $x$/$y$ coordinate with only an offset. The offset comes because, usually in computer programming, the origin is at the top left instead of the center of the screen.
Notice also that I negated the latitude in the $y$ formula, because most computer systems in 2D coordinates have the positive $\bf y$ direction pointing down. This is opposite of a standard graph in math, where positive $y$ goes up.
In your case, longitude and latitude will actually be right ascension and declination respectively. They are basically stellar coordinates for the celestial sphere as opposed to ground coordinates for the geode.
There are many, many other map projections possible, but equi-rectangular is the simplest.
However, your question is a little vague because you mentioned a "virtual 3D world", yet also asked how much you need to flatten it. If you already have a 3D model of a sphere in your computer graphics, you don't have to flatten it at all. You just draw the 3D model (sphere) with a texture on it. If you want to represent it as a map, then of course you have to flatten it, and equi-rectangular projection is the simplest way.