Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rendering for starfield #1952

Draft
wants to merge 50 commits into
base: master
Choose a base branch
from
Draft

New rendering for starfield #1952

wants to merge 50 commits into from

Conversation

375gnu
Copy link
Collaborator

@375gnu 375gnu commented Oct 26, 2023

No description provided.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@375gnu 375gnu changed the title wip New rendering for starfield Nov 5, 2023
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

9 New issues
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@Askaniy
Copy link
Contributor

Askaniy commented Jul 7, 2024

Summary:

  • Polishing the new star shader;
  • Complete redesign of the light calculation methods;
  • Automag was removed with the faintest magnitude system;
  • Star styles were removed;
  • Classic/Enhanced/Legacy star colors were removed;
  • Sun white point is default;
  • Astronomical constants updated to the latest standards;
  • Merged limb darkening branch.

@ajtribick
Copy link
Collaborator

I can fix the conflicts with the master branch. Let me know if you prefer me to do this with a merge commit or rebasing this branch onto current master.

@Askaniy
Copy link
Contributor

Askaniy commented Jul 14, 2024

I'd appreciate it. Maybe, rebasing this branch onto current master? But that's more up to you

Copy link

Copy link

sonarqubecloud bot commented Oct 9, 2024

@Askaniy
Copy link
Contributor

Askaniy commented Feb 14, 2025

Let's count current bugs I created and left 🥲
(For rendering box testing, I turned on the red filler at line 47 in star_frag.glsl)

There are two stages of rendering a star, depending on its individual visible brightness: "9 px" mode (3x3 box size) and "glow" mode (variable box size). For simplicity, the separating value is chosen to be 1 Vega brightness at exposure 1. The separation is in star_vert.glsl at line 46.

You can notice that in the glow mode, the glow doesn't completely fill the box. Actually fills, but only in internal Float values. sRGB gamma correction is assumed in the glow design, which will “pull” it to the box edges.

Bug 1

Star field have never been seen using both modes at once, depending on the brightness of a particular star. If you don't change the code (if (all(lessThan(scaled_color, vec3(1.0))))), the glow mode is used. If you change to if (true), the 9 px mode is used.
изображение
That's how 4 px mode looked like. Stars feel square, that's why I moved it to 9 px instead.
изображение

Bug 2

The 9 px mode was broken since my last testing in the summer 2024. When rotating the camera, the 1 pixel stars rarely appear and then disappear again:
изображение

Bug 3

The wrong brightness values are obviously being supplied to the input. The glow mode worked correctly before the exposure transition was made:
Screenshot_20240701_114940

Bug 4

After ruthless code reduction, barycenters began to emit. I'm guessing it was an old optimization whose limits were accidentally removed. I think it's best to find and remove the barycenter glow all the way through.
изображение

Bug 5

Limb darkening was added, but the star surfaces have stopped rendering. It could be a typo or caused by deleting something extra.

Bug 6

There is a small “bug” with exposure setting in the interface: I failed to make integer output when updating a variable, i.e. now Exposure: 16.00 is printed instead of Exposure: 16. I rolled back my experiments

Notes

Based on the Discord discussions, it would be both more realistic and easier to program the overall process of rendering both stars, planets, and spacecraft if they are in point mode. Without special brightness enhancement of planets, for example. For the sake of simplifying visual search, you can set different thresholds for displaying names. Now there are no star styles, which may allow simplifying the logic globally. I also removed the glow and atmosphere of the stars, while adding changes from the limb-darkening branch to optimize the logic of everything planned at once. To keep the Sun looking bright, I suggest increasing the maximum size of the glow to the size of the screen. At typical exposures, only the Sun will be bright, and it will switch to a starry background with no jumps when removed.

Also, maximum glow box size is discussed to be min(min(screen_hight, screen_width), max_point_size), depending on the max point size that openGL supports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants