Giter Club home page Giter Club logo

godot-star-cluster's Introduction

This is part of an experiment I did in 2023 with using semi-realistic cosmic data in Godot Engine.

stars rendered in Godot Engine

It features an extension written in Rust with gdext, random star placement in a cluster using a normal distribution, a Kroupa-like IMF for mass values, and blackbody-like colors.

It also features an attempt at emulated double precision in the shader that renders the stars. The experiment was partially successful: as the sky/starfield camera gets very, very close to a star (rendered as point mesh in a multimesh), the star visibly wiggles just before vanishing due to near clipping. The POV must get much closer before the sphere mesh of the star is large enough to be seen.

To improve the effect, I think an additional layer should be responsible for intermediate distances. It would functionally overlap with the far plane of the primary camera and the near plane of the starfield camera. Practically, it could be another render layer like the starfield. It could also be system of scaling, billboarded sprites that render just inside of the primary camera's far plane (which is similar to how stars currently work in this demo).

Building

This will only work on Windows. Add more platforms in rust.gdextension. Build the Rust library first before opening the project in Godot.

Controls

Press 0 to move at 3 million times the speed of light (default), and press 1-5 to fly to a random star.

Screenshots

4K stars rendered in Godot Engine

Approaching a red star, still rendered by the starfield only:

4K far red star rendered in Godot Engine

Getting close to a red star and the sphere mesh is visible:

4K close red star rendered in Godot Engine

godot-star-cluster's People

Contributors

astra137 avatar

Stargazers

m0x avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.