Edit of asset "Starlight" Accepted
Old/Current | New/Edit | |
---|---|---|
Title | Starlight | Starlight |
Description |
An that renders 100 000 stars in realtime, with low performance cost. It's an alternative to using a skybox, and also may be relevant to anyone making a space game. Features: - Stars are rendered positionally in 3D, allowing you to fly around and see stars go by. - Exact position, luminosity, and temperature of each star can be configured by you. - Physically based light model: Using a Point Spread Function (PSF), rather than a texture that grows or shrinks with distance/brightness. - Based on MultiMeshInstance3D for performance. - Uses a trick to avoid being clipped by the far plane, to let stars be very far away. - Works with Forward+, Mobile, and Compatibility renderers. - Comes with a random star generator based on main sequence stars (classes M through O). |
Starlight is a Godot addon that renders 100,000 stars in realtime, with low performance cost. It's an alternative to using a skybox, and also may be relevant to anyone making a space game. # Features - Stars are rendered positionally in 3D, allowing you to fly around and see stars go by. - Exact position, luminosity, and temperature of each star can be configured by you. - Default star generator is based on real main sequence stars (classes M through O). - Physically based light model: Using a [Point Spread Function (PSF)][1], rather than a texture that grows or shrinks with distance/brightness. - Based on [MultiMeshInstance3D][2] for performance. - Designed for Forward+ renderer, works as expected in the Mobile renderer, may have issues in the Compatibility renderer. [1]: https://en.wikipedia.org/wiki/Point_spread_function [2]: https://docs.godotengine.org/en/stable/classes/class_multimeshinstance3d.html # Usage Guide To get started, insert `Stars.tscn` into your scene. This will automatically spawn 100,000 randomly generated stars. On the instance itself there are some properties you can configure that affect the star spawning. These are: - `size`: Stars are spawned inside of a sphere of this radius. - `star_count`: The number of stars to create. - `rng_seed`: The random seed to use when generating stars. Incrementing this will give you a different sky. - `generate_at_origin`: If checked, one extra G-type star will be generated exactly at `0, 0, 0`. This can be useful for representing the Sun in your scene. For further customization of the star generator, I recommend editing the script directly. To make changes to the visual appearance you will need to edit the Material. You can do this either by opening Stars.tscn, or by clicking the dropdown arrow on the MultiMesh resource and click "Make unique". You'll then need to do this again on the Mesh resource inside it. Expand the Mesh, expand the Material, expand the Shader Parameters section. Inside here you will find more properties to configure. - `emission_energy` - Multiplier for how bright stars should be. Generally this is some extremely large number like `50000000000` - you'll need to add or remove zeros until it looks right. - `billboard_size` - This controls how much of the screen the PSF texture takes up, in pixels. For the default JWST PSF I recommend a value of 2048. - `min_size` - There is a performance optimization where the PSF texture is cropped for stars that are dim. This will be 99.999% of stars. Generally set this to some low value like 16. - `max_luminosity` - This is the point at which the cropping stops and the full PSF texture is used. If your PSF looks cut off, you may need to lower this. - `meters_per_lightyear` - This is a scaling setting, you'll need to set it depending on how far away you want your stars to be. - `distance_limit` - This acts as an upper bound on how bright stars can be. Once you get closer to a star than this distance, it stops getting any brighter. This setting can be used to prevent blowing out the PSF texture. - `texture_emission` - This is the actual PSF texture. The default one is the PSF from the James Webb Space Telescope, because it looks cool. There are a few others in the `psf-textures` folder which can be used instead. |
Category | Shaders | Shaders |
License | MIT | MIT |
Repository Provider | GitHub | GitHub |
Repository Url | https://github.com/tiffany352/godot-starlight | https://github.com/tiffany352/godot-starlight |
Issues Url | https://github.com/tiffany352/godot-starlight/issues | https://github.com/tiffany352/godot-starlight/issues |
Godot version | Godot 4.1 | Godot 4.1 |
Version String | 1.2 | 1.0 |
Download Commit | 1930d87b089031be031ab0e29b40dc6d3d0bf6c2 | d5435b060e92556fb0df3da249b1030baf8c9d19 |
Download Url (Computed) | https://github.com/tiffany352/godot-starlight/archive/1930d87b089031be031ab0e29b40dc6d3d0bf6c2.zip | https://github.com/tiffany352/godot-starlight/archive/d5435b060e92556fb0df3da249b1030baf8c9d19.zip |
Icon Url |
https://raw.githubusercontent.com/tiffany352/godot-starlight/main/icon.png
|
https://raw.githubusercontent.com/tiffany352/godot-starlight/main/icon.png
|
Preview Insert | ||
---|---|---|
Type | image | |
Image/Video URL |
https://github.com/tiffany352/godot-starlight/blob/main/docs/screenshot.jpg?raw=true
|
|
Thumbnail |
|