# Procedural galaxy and streaming

**URL:** <https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468>\
**Category:** Demos and projects\
**Created:** [June 19, 2024, 7:16pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468 "2024-06-19T19:16:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 19, 2024, 7:16pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/1 "2024-06-19T19:16:10Z")

</div>

Dear community,

Something I put online a few weeks back… and I have just come around migrating some C code to Rust. The main link:

[https://adlumens.org/](https://adlumens.org/)

What’s it got to do with BabylonJS? Well this part: [Ad Lumens - 3D explorer](https://adlumens.org/3d-explorer/)

Now it’s not advanced or anything (especially around the shader part – or rather lack thereof!), even a bit noobish when compared to some projects showcased here, but I have spent so much time on procederal server-side generation that… heh 🙂

I plan on trying to take this thing as far as I can. I also try to write some stuff…

Anyway hopefully you enjoy it and I do of course welcome feedback.

All the best 🙂

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 6:43am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/2 "2024-06-20T06:43:49Z")

</div>

Cool project!

Maybe you could join @CrashMaster and his project [Cosmos Journeyer](https://barthpaleologue.github.io/CosmosJourneyer/) 😉

You two are clearly in love with procedural things and the Universe itself 👾 ⭐ 🪐

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 20, 2024, 7:49am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/3 "2024-06-20T07:49:41Z")

</div>

I love it! 🤩

Do you have a github repo somewhere by any chance? I wonder how you render the galaxy background when exploring the star map, that’s something I am trying to do as well but I am not sure how to handle it 🙂

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 8:19am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/4 "2024-06-20T08:19:19Z")

</div>

Hey thank you very much for the kind comments. I am not 5% there, to be honest, but progress is made everyday (I hope so at least!).

There is a repo, but not public, However, the galaxy background is not rocket science: you can have a look at this PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#8A8QV3%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

It’s pretty much the code “as is”, save for the density map data, which is generated dynamically server-side.

there’s some stuff here as well, if you are curious: [Ad Lumens - On galactic structure](https://adlumens.org/log/on-galactic-structure/b8d2420c-b137-4c97-ae89-1df8f7a18839)

Cheers!

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 9:47am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/5 "2024-06-20T09:47:52Z")

</div>

> [@plopidou](#):
>
> However, the galaxy background is not rocket science: you can have a look at this PG:

Black screen only ☹

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 9:53am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/6 "2024-06-20T09:53:58Z")

</div>

damn, have you tried moving the mouse around? This uses a FlyCamera

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 10:13am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/7 "2024-06-20T10:13:39Z")

</div>

> [@plopidou](#):
>
> This uses a FlyCamera

Yep, I’ve noticed it and tried every input I could 😃

When I set the `pointSize` to `2` I can see the PCS:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/d/5d8ade71450d6b1dcf120159a768a1dc4d6fc011.jpeg)

I guess it’s because of the retina display.

`const baseSize = 1 // or whatever`  
`pointSize: baseSize * window.devicePixelRatio` should fix it.

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 10:24am UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/8 "2024-06-20T10:24:53Z")

</div>

nice 🙂

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 20, 2024, 12:03pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/9 "2024-06-20T12:03:36Z")

</div>

That was a really interesting read! I will probably take some ideas when I get around to rework the star map in Cosmos Journeyer (if that’s okay of course).

Also do you plan on releasing some kind of API for your server side generation? It is very impressive!

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 12:09pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/10 "2024-06-20T12:09:09Z")

</div>

Thanks!: is it you from Belgium or around? 🙂  
API… err not at the moment… I’m busy enough consuming it internally 😁 But maybe one day… plus it’s ab-so-lu-te-ly not finished, and still very much “en chantier”.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 20, 2024, 12:13pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/11 "2024-06-20T12:13:22Z")

</div>

I am from France! Baguette tout ça tout ça 😂

That makes a lot of sense! Keep us updated on your project anyway, fellow space explorer 😉

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 12:19pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/12 "2024-06-20T12:19:27Z")

</div>

Ah ben dis donc ! 🙂 Francais aussi, mais vivant a Londres … 🙂

And yes I will endeavour to update this thing. Busy client these days, so unable to spend as much time as I’d like on ad lumens 🙂

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 20, 2024, 12:22pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/13 "2024-06-20T12:22:12Z")

</div>

Je suis en Belgique pour un stage ^^

It’s like clients never want to pays us to develop these nice things haha I wish I had more time as well 🙂

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 1:45pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/14 "2024-06-20T13:45:35Z")

</div>

Are you from Belgium?

My son studied at Howest University of Applied Sciences (Cyber Security Professional) in Bruges. Unfortunatelly I didn’t have the oportunity to visit Bruges but I saw this movie:

> **[In Bruges (2008) ⭐ 7.9 | Comedy, Crime, Drama](https://www.imdb.com/title/tt0780536/)**
>
> 1h 47m | R

Wonderful city 😉  
Cool movie! 😃

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 2:07pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/15 "2024-06-20T14:07:05Z")

</div>

No I am from Paris (personne n’est parfait… -\_-)

@CrashMaster is currently in Belgium, though 🙂

and yes, great film. Brings back memories.

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 20, 2024, 2:19pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/16 "2024-06-20T14:19:00Z")

</div>

I went to Bruges the other day, it’s a really beautiful city ❤

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 2:25pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/17 "2024-06-20T14:25:06Z")

</div>

I had communication issues and fun with the Frenchmen here 😃

Read the posts below this one LOL

> [@AzuraGate - MMO RPG/ FPS/Adventure](https://forum.babylonjs.com/t/azuragate-mmo-rpg-fps-adventure/50902/4):
>
> [image] All looks very cool but the font… stuck_out_tongue

EDIT:

The message is already edited so you need see the original message to understand what happened:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/f/6f5c4c810844884dd7215a61dd7209cf26bbaa6b.png)

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 5:19pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/18 "2024-06-20T17:19:27Z")

</div>

I’ve only been to Paris once. The first day we went to visit a place (I can’t recall its name nor the famous American actor who raced up there, it was uphill and there was a church or something). We got off the subway and found ourselves in a middle of a fight between like 50 black bros and the police. Throwing rocks and the police replied with smoke grenades. My wife and me in the middle on the street. F\*ck me dead! 😂😂😂 What a warm welcome to the city 😂

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [June 20, 2024, 5:23pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/19 "2024-06-20T17:23:54Z")

</div>

But the city paid its debts the next day. There was only 5 minutes waiting time at Eiffel Tower and Disneyland was totally empty, the weather was very good, so we enjoyed our stay a lot!

---

<div class="post-metadata">

**Author:** ![plopidou](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@plopidou](https://forum.babylonjs.com/u/plopidou)\
**Post date:** [June 20, 2024, 7:25pm UTC](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468/20 "2024-06-20T19:25:02Z")

</div>

just pushed a few minor changes:  
. stars are now smaller (Question of taste, but I prefer them this way – make the universe feel bigger)  
. LOD range is now 3/7  
. some extra eye candy (hopefully not too expensive in terms of perfs) as galactic background/shape

[Next page](https://forum.babylonjs.com/t/procedural-galaxy-and-streaming/51468.md?page=2)
