I’m not a computer graphics guy, but I wanna math. Theoretically, if I wanted to make the smallest possible 3d model, I would define it as four interconnected points. Each point has x, y, and z coordinates, so each model takes a theoretical minimum of 12 bytes of storage. Someone who knows computers can correct me if I’m off by a bunch.
The lower estimate is around 100,000,000,000 stars in the Milky Way. That’s only 1.2 terabytes worth of my theoretical minimum 3d model. Doable! But you said all stars. The lower estimate is around 10^22 stars in the universe. That would be 120 zettabytes. That’s only a few orders of magnitude off from the total available worldwide datadata storage!
Edit: I might have thought of a way to define a 3D model in just 2 bytes. You need four points that each have values for x, y, and z. They don’t need 256 possible values for those, they can get by with two each. One bit can store two possible positions, so we can use as little as two bytes to define every point’s position with 4 bits to spare. Behold, a tetrahedron: 0000 0100 1010 1110
Each set of four digits defines the x, y, and z coordinates for each point, as well as one extra dimension. You could use those extra four bits however you want. An extra spatial dimension, defining a color, etc. The theoretically smallest possible 3D model. Take the numbers I said up there and divide them by 6. A model for every star in the universe, and it would only take 20 zettabytes.
As an amateur computer graphics person, the best way to draw accurate stars is to just pre render it onto a cubemap. But if you really need that subpixel worth of parallax to be completely accurate for every star, there are a couple ways I can think of off of the top of my head. With any you’d want to make sure you only store position, size, and color, since stars are all spheres anyways. With effort, you can be very flexible with how these are stored. (4 bits color temperature, 4 bits size, 3*32 bits coordinates maybe)
splat each star into the screen texture with atomics
some sort of tiled software rasterization thing, like in Gaussian Splatting
Worse ideas:
instanced hardware rasterization
ray tracing
This is not that well suited to most usual rendering techniques, because most stars are probably going to be much smaller than a pixel. Ray tracing would mean you need to just hit every star by chance (or artificially increase star size and then deal with having tons of transparency), hardware rasterization is basically the same and additionally is inefficient with small triangles. I guess you could just live with only hitting stars by chance and throw TAA at it, there’s enough stars that it doesn’t matter if you miss some. That would react badly to parallax though and defeats the purpose of rendering every star in the first place.
It’s much more efficient to do a manual splatting thing, where for each star you look at what pixel(s) it will be in. You can also group stars together to cull out of view stars more efficiently. Subpixel occlusion will be wrong, but it probably doesn’t matter.
This is all just for the viewport, though. Presumably there are other objects in the game besides stars, which need to have reflections on them of the stars. Then that becomes an entirely different problem.
The real answer though is that you wouldn’t try to render all of the stars, even if you want parallax. Maybe some of the closer and larger ones as actual geometry, simplify a ton of stuff in the background, render things as volumes or 2d billboards, have a cubemap for the far distance, etc
Edit: also ofc this presumes you know the position, scale, temperature of every star
I also like the idea of baking all of the stars into a volume in spherical coordinates, centered around the origin
“…The Elite universe contains eight galaxies, each with 256 planets to explore. Due to the limited capabilities of 8-bit computers, these worlds are procedurally generated. A single seed number is run through a fixed algorithm the appropriate number of times and creates a sequence of numbers determining each planet’s complete composition (position in the galaxy, prices of commodities, and name and local details; text strings are chosen numerically from a lookup table and assembled to produce unique descriptions, such as a planet with “carnivorous arts graduates”). This means that no extra memory is needed to store the characteristics of each planet, yet each is unique and has fixed properties. Each galaxy is also procedurally generated from the first. Braben and Bell at first intended to have 248 galaxies, but Acornsoft insisted on a smaller universe to hide the galaxies’ mathematical origins.[36]”
"Of course, David Braben and his team didn’t dot their virtual galaxy manually with all those star systems, they used procedural generation. But there’s absolutely more to it, Braben explained when we recently sat down with him in San Francisco.
“I think it is a distraction when you start describing it as ‘we generated our galaxy procedurally’. It belittles the fact that we actually put a lot of artistic work in it and gathered real data.
We have a one-to-one scale model of the milky way in our game, with all the 400 billion star systems. What we’ve done is we got real data from 160,000 star systems. That’s every single star in the night sky. About 7,000 are visible to the human eye and a lot more with a telescope. These are all in the game. And all the nebulae and things like that.
Now, beyond 30 or 40 light-years from Earth, even Hubble can’t resolve the smallest stars. So, the most common star we know about is a Class M Red-star, and beyond those 30 to 40 light-years, Hubble can’t see them. But you CAN see them as a sort of smoke, you just can’t see individual stars.
And I’m sure in our lifetime, we’ll see further and further with better telescopes. But the point is, we can populate that smoke with stars –with the right sort of mix of stars as well as the density. Because we know how much radiation is coming out of that smoke. And that’s the sort of approach we have taken.
Using procedural generation to create that smoke, in much the same way an artist uses an air brush or computer. The artists doesn’t mind where the individual dots come, what he’s doing, is getting the pattern of the smoke right, or whatever it is he’s drawing with the air brush."
Remarkable that you can copypaste all that and still can’t comprehend what was done in 1984 and what was done in 2014.
If you find a way to represent our existing Milky Way galaxy with a procedural algorithm and a seed that can be run in a reasonable time on any current computer or even a cluster (say, running for a few dozen years), you’re welcome to claim the Nobel prize.
Champ, re-read the thread. The comment was a joke - “in a cave, with a box of scraps” is a meme. The point was that Braben demonstrated procedural generation compresses galaxy-scale data into almost nothing, which is directly relevant to starman’s napkin math about storage per star. Nobody claimed a seed perfectly reproduces the real Milky Way. You invented that claim and then dunked on it.
Also, you confidently told me Elite Dangerous was from 2014 when I was clearly citing Elite (1984) and Elite Dangerous (2014).
How about you reread the thread instead, see that it’s about accurately reproducing existing stars, and realize that you indeed have a comprehension problem.
This code was first published 10 years ago, but I haven’t seen any such game yet.
They’ll get round to it. They’re doing the graphics first. They’re currently making individual 3D models of “all the stars”.
“If you want to make a historically accurate moon landing sim, you must first model the universe.” -Carl Sagan
Don’t we have the Universe Simulator already?
Yeah, that’s how they filmed the first moon landing.
I’m not a computer graphics guy, but I wanna math. Theoretically, if I wanted to make the smallest possible 3d model, I would define it as four interconnected points. Each point has x, y, and z coordinates, so each model takes a theoretical minimum of 12 bytes of storage. Someone who knows computers can correct me if I’m off by a bunch.
The lower estimate is around 100,000,000,000 stars in the Milky Way. That’s only 1.2 terabytes worth of my theoretical minimum 3d model. Doable! But you said all stars. The lower estimate is around 10^22 stars in the universe. That would be 120 zettabytes. That’s only a few orders of magnitude off from the total available worldwide datadata storage!
Edit: I might have thought of a way to define a 3D model in just 2 bytes. You need four points that each have values for x, y, and z. They don’t need 256 possible values for those, they can get by with two each. One bit can store two possible positions, so we can use as little as two bytes to define every point’s position with 4 bits to spare. Behold, a tetrahedron:
0000 0100 1010 1110Each set of four digits defines the x, y, and z coordinates for each point, as well as one extra dimension. You could use those extra four bits however you want. An extra spatial dimension, defining a color, etc. The theoretically smallest possible 3D model. Take the numbers I said up there and divide them by 6. A model for every star in the universe, and it would only take 20 zettabytes.
As an amateur computer graphics person, the best way to draw accurate stars is to just pre render it onto a cubemap. But if you really need that subpixel worth of parallax to be completely accurate for every star, there are a couple ways I can think of off of the top of my head. With any you’d want to make sure you only store position, size, and color, since stars are all spheres anyways. With effort, you can be very flexible with how these are stored. (4 bits color temperature, 4 bits size, 3*32 bits coordinates maybe)
Worse ideas:
This is not that well suited to most usual rendering techniques, because most stars are probably going to be much smaller than a pixel. Ray tracing would mean you need to just hit every star by chance (or artificially increase star size and then deal with having tons of transparency), hardware rasterization is basically the same and additionally is inefficient with small triangles. I guess you could just live with only hitting stars by chance and throw TAA at it, there’s enough stars that it doesn’t matter if you miss some. That would react badly to parallax though and defeats the purpose of rendering every star in the first place.
It’s much more efficient to do a manual splatting thing, where for each star you look at what pixel(s) it will be in. You can also group stars together to cull out of view stars more efficiently. Subpixel occlusion will be wrong, but it probably doesn’t matter.
This is all just for the viewport, though. Presumably there are other objects in the game besides stars, which need to have reflections on them of the stars. Then that becomes an entirely different problem.
The real answer though is that you wouldn’t try to render all of the stars, even if you want parallax. Maybe some of the closer and larger ones as actual geometry, simplify a ton of stuff in the background, render things as volumes or 2d billboards, have a cubemap for the far distance, etc
Edit: also ofc this presumes you know the position, scale, temperature of every star
I also like the idea of baking all of the stars into a volume in spherical coordinates, centered around the origin
David Braben did it 1984, in a cave, with a box of scraps
https://ctrl500.com/tech/how-frontier-managed-to-re-create-our-entire-galaxy-in-elite-dangerous/
https://en.wikipedia.org/wiki/Elite_(video_game)
‘Elite Dangerous’ is from 2014.
Elite is from 1984. Per the wiki I cited
“…The Elite universe contains eight galaxies, each with 256 planets to explore. Due to the limited capabilities of 8-bit computers, these worlds are procedurally generated. A single seed number is run through a fixed algorithm the appropriate number of times and creates a sequence of numbers determining each planet’s complete composition (position in the galaxy, prices of commodities, and name and local details; text strings are chosen numerically from a lookup table and assembled to produce unique descriptions, such as a planet with “carnivorous arts graduates”). This means that no extra memory is needed to store the characteristics of each planet, yet each is unique and has fixed properties. Each galaxy is also procedurally generated from the first. Braben and Bell at first intended to have 248 galaxies, but Acornsoft insisted on a smaller universe to hide the galaxies’ mathematical origins.[36]”
Elite Dangerous expands on this mechanic, per cited article.
"Of course, David Braben and his team didn’t dot their virtual galaxy manually with all those star systems, they used procedural generation. But there’s absolutely more to it, Braben explained when we recently sat down with him in San Francisco.
“I think it is a distraction when you start describing it as ‘we generated our galaxy procedurally’. It belittles the fact that we actually put a lot of artistic work in it and gathered real data.
We have a one-to-one scale model of the milky way in our game, with all the 400 billion star systems. What we’ve done is we got real data from 160,000 star systems. That’s every single star in the night sky. About 7,000 are visible to the human eye and a lot more with a telescope. These are all in the game. And all the nebulae and things like that.
Now, beyond 30 or 40 light-years from Earth, even Hubble can’t resolve the smallest stars. So, the most common star we know about is a Class M Red-star, and beyond those 30 to 40 light-years, Hubble can’t see them. But you CAN see them as a sort of smoke, you just can’t see individual stars.
And I’m sure in our lifetime, we’ll see further and further with better telescopes. But the point is, we can populate that smoke with stars –with the right sort of mix of stars as well as the density. Because we know how much radiation is coming out of that smoke. And that’s the sort of approach we have taken.
Using procedural generation to create that smoke, in much the same way an artist uses an air brush or computer. The artists doesn’t mind where the individual dots come, what he’s doing, is getting the pattern of the smoke right, or whatever it is he’s drawing with the air brush."
Remarkable that you can copypaste all that and still can’t comprehend what was done in 1984 and what was done in 2014.
If you find a way to represent our existing Milky Way galaxy with a procedural algorithm and a seed that can be run in a reasonable time on any current computer or even a cluster (say, running for a few dozen years), you’re welcome to claim the Nobel prize.
Champ, re-read the thread. The comment was a joke - “in a cave, with a box of scraps” is a meme. The point was that Braben demonstrated procedural generation compresses galaxy-scale data into almost nothing, which is directly relevant to starman’s napkin math about storage per star. Nobody claimed a seed perfectly reproduces the real Milky Way. You invented that claim and then dunked on it.
Also, you confidently told me Elite Dangerous was from 2014 when I was clearly citing Elite (1984) and Elite Dangerous (2014).
Maybe ease off the “can’t comprehend” akshually.
How about you reread the thread instead, see that it’s about accurately reproducing existing stars, and realize that you indeed have a comprehension problem.
That’s some damn fine maths, thank you :)