Angelica

Angelica

9.7k Downloads

Space station (Jupiter) + player are invisible

OmdaCZ opened this issue · 7 comments

commented

Your GTNH Discord Username

ondrejmenzel

Mod Version

alpha 34

Java Version

Java 19

Graphics Card Vendor

NVidia

Bug Report

As the title suggests, when I enter my space station around Jupiter, I cant see any block nor myself when viewed from back etc via f5. Tried with alpha33 and 34. First picture is with angelica, second without.
2024-03-13_17 28 21
2024-03-13_17 33 53

Mod List or GTNH Pack Version

2.6.0 nightly #377

Final Checklist

  • I have searched the issues and haven't found a similar issue.
  • I have read the known incompatibilities and this is not related to one of those.
  • I am running an officially released version. (Or, if I've compiled it myself I plan to fix the issue)
  • This issue is not related to a feature that is disabed by default - Shaders, MCPF, etc. [They'll be enabled when they're ready for testing]
commented

ame in alpha35, not if angelica removed

commented

@D-Cysteine were there any other problems caused be removing that? If not, can we just remove that to fix this?

if that does fix it, this could be something we want to fix via ASM/Mixin if it effects non GTNH galacticraft as well, because GTNH’s galacticraft can’t be used in other packs.

commented

I completely missed this, thanks for tracking this down!

commented

@D-Cysteine were there any other problems caused be removing that? If not, can we just remove that to fix this?

if that does fix it, this could be something we want to fix via ASM/Mixin if it effects non GTNH galacticraft as well, because GTNH’s galacticraft can’t be used in other packs.

Sorry, I don't really know much about GalactiCraft space stations, so I don't think I can test it thoroughly. But I looked around on an overworld space station, and could not notice any differences with that line enabled or disabled, with or without Angelica, aside from the block rendering issue when both the line and Angelica are present.

In particular, I would assume that that line is intended to affect either the planet / skybox rendering, or the rendering of something else added by GalactiCraft (i.e. not regular blocks), but I didn't notice any differences in the appearance or placement of Earth or the background stars, with or without that line. I don't know what else it could be intended to affect, so not sure how to test further.

commented

Looks like the variables in that line are only modified in this method, which appears to have zero callers within GalactiCraft:

Might be worth double-checking that I didn't miss a caller somewhere, or whether some other mod calls it. If there really are no callers, though, then it looks like the values passed into that glRotatef call never change, so I think it's safe to delete it. Here's a quick search for other callers (didn't find any):

My guess is that it has been incorrect for a long time now, resulting in the camera state being technically incorrect, but blocks kept rendering anyway until Angelica did some optimization that made them no longer render.

I also did some code archeology and additional testing, but I think it's irrelevant now with the above. I've preserved my original comment for posterity, below:


I did some code archeology, and I think I found the original commit that added that line (almost 10 years ago!):

Based on the commit name and the surrounding code, it looks like this was originally intended to simulate artificial gravity, probably by rotating the camera to simulate a rotating station. Looks like you can indeed rotate your space station, using this:

I tested with the spin thruster, and couldn't tell any difference aside from the block rendering issue with that line enabled or disabled, with or without Angelica.

commented

The issue seems to be with the GL State Caching. Turning it off will allow you to render space stations and other non-rendering blocks without a game restart/mod removal.

commented

I don't have much rendering or GalactiCraft experience, but I tried debugging this a little, and it looks like commenting out this one line will get blocks to render again:
https://github.com/GTNewHorizons/Galacticraft/blob/fe034cd7ca95ecf9e10286c6d432962fa0e88135/src/main/java/micdoodle8/mods/galacticraft/core/mixins/minecraft/EntityRendererMixin.java#L29

I have no idea what other consequences commenting that line out has, but everything appeared to be rendering fine with a cursory look in my test world. Here's a quick link to the definition of orientCamera:
https://github.com/GTNewHorizons/Galacticraft/blob/fe034cd7ca95ecf9e10286c6d432962fa0e88135/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java#L949

I only looked very briefly at that method, but I guess maybe GalactiCraft is playing some tricks with the camera location / angle, possibly to get planet rotation to work? And that may be confusing Angelica, causing the blocks to not be rendered because Angelica thinks the camera is pointing in some entirely different direction.


Edit: I further narrowed it down to this one line. Commenting out this line fixes the block rendering:
https://github.com/GTNewHorizons/Galacticraft/blob/fe034cd7ca95ecf9e10286c6d432962fa0e88135/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java#L1008-L1013