Looking for examples of luminous/glowing/energy/etc. stars

Hello everyone!

As the title says, I am looking for examples of nicely looking space stars(BTW I’ve searched forum and playgrounds high and low, closest I got is - https://playground.babylonjs.com/#46MPSD), something along these lines:

https://www.osr.org/oms/Castor/
https://www.osr.org/oms/Polaris/
https://www.osr.org/oms/Vega/
https://stars.chromeexperiments.com/

P.S.
How would you proceed with creating something similar? Getting back to the playground example above(https://playground.babylonjs.com/#46MPSD), removing the sun, but leaving the glare and flare particle systems looks like a good starting point…or maybe not :thinking:?

Hi there! :smiley:

I found this PG too: Best way to recreate the star from the image - Questions - Babylon.js (babylonjs.com), but it’s more for point stars, not a big sphere stars.

I agree that the sun helper looks like a good starting point, maybe you can also play with the Glow Layer Making Meshes Glow | Babylon.js Documentation (babylonjs.com).

Anyways, I think @PatrickRyan will have more useful ideas than me :sweat_smile:

Hi Carol!

Thanks for the reply. Yes, I am aware of that example, actually it was me who posted the question :upside_down_face:

I think I found something that may work - https://playground.babylonjs.com/?webgpu#GXJ3FZ#51, but the problem for me is that the examples from this PG aren’t let’s say static, they evolve/dissolve over period of time.

For example, demo nr.3 from the PG, I think that it would work as a base star sphere. Only if I could somehow stop it after a few seconds in, but the code is hard to digest for me.

@fluxus, if you are looking for a way to do the star surface like in the osr.org examples, this is just layered noise with some noisy seeding. Here is a node material that will create the noise you can use as a mask to drive a color gradient or lerp. You also have some fresnel driving the color in the star. Getting the color the way you want it is not particularly hard but will take some experimentation on your end. This will get you started with the motion mask done for you.

In terms of the rest of the effect, it’s simply particle systems emitting from the surface of the mesh along the mesh normal with 0 emission speed. This will make the particles stand up and short lives with color and alpha gradients in and out on the lifetime will make the rays dance. This is very similar to the sun example you listed above. The plasma eruptions are the only challenge then, but those are quad strips placed around the sphere mesh which also have an animated noise. I would make these additive so that you don’t need to worry about alpha masking and they will blend with the other additive particles.

I hope this unblocks you somewhat, but feel free to ping back with more questions.

3 Likes

@PatrickRyan Appreciate the nod in the right direction, that is exactly what I needed. Understanding what goes into creating something(a star in this case) is something I have the most trouble with.

Thx again!

1 Like

https://playground.babylonjs.com/#H8QN40#57 - not the final star but starting to look good

I was playing a bit with NME.

Also try the PG with Node material 0M5SE7#10
It uses the cells output of the Voronoi noise. I wanted to add these celss on the star’s surface but didn’t have time yet.

4 Likes

Thanks for the tips. The second material(Voronoi) is interesting.

I am not sure which term to use because I am going by trial and error with NME(I understand how things work, but actually knowing what will be the result of some action is way beyond my level), let’s say that I played with it and got a few promising results.

For some reason, the playgrounds are not saving for me. Tried in both Chrome and Safari, but no luck.
I made one screenshot with modified Voronoi example you posted, there is potential but only after augmenting it with particles, ring flares, maybe some post-processing etc :sweat_smile:

If I come up with something nice, I’ll post it here for sure.

1 Like

Got any error message on the console?

1 Like

Sorry, my bad. They are saving(no console errors), but the changes made on node material via inspector aren’t picked up upon saving. But that is how it is supposed to work, right?

BTW, I think that in the past I was presented with a modal dialog when saving over existing playground, now I only get it when creating/saving new playground.

I am prolly wrong on this one too, but asking anyways :upside_down_face:

@fluxus, do you mean that when you make a change to the node material and then save your playground the node material changes aren’t saved? If so, this is correct because the node material editor is a child window of the playground but needs its own save to retain changes. If you are saving to snippet server in NME, you will notice that the hash will increment, and that new ID is copied into the monaco editor in the PG. But then the PG will also need to be saved to retain the new NME ID. The reason there are two places to save is that there are two snippet servers, one for the PGs and one for NMEs. This is so that you can reference an NME outside of a PG rather than embedding it into the PG snippet which would make the node materials harder to manage as you would need a copy of a node material in every PG that uses it.

@PatrickRyan Yes, that is exactly what I meant. Makes total sense.

Thanks for the explanation.

2 Likes