neoforged / NeoForge

Neo Modding API for Minecraft, based on Forge
https://projects.neoforged.net/neoforged/neoforge
Other
1.13k stars 165 forks source link

Some particles disappear while still in the player's field of vision #187

Closed Lolothepro closed 8 months ago

Lolothepro commented 10 months ago

Minecraft Version: 1.20.1

NeoForge Version: 47.1.79

Neo:

https://github.com/neoforged/NeoForge/assets/68275908/ac971779-b59a-49e7-9f76-dd60182c200b

https://github.com/neoforged/NeoForge/assets/68275908/02901002-52d9-49c0-ae9a-dc5308825fea

https://github.com/neoforged/NeoForge/assets/68275908/da7dfef5-4a5b-49ef-bcd6-3bcc25c294fa

Vanilla:

https://github.com/neoforged/NeoForge/assets/68275908/286f8b4c-73aa-4d28-84a2-b56aba12e71c

embeddedt commented 10 months ago

Apparently older versions of Sodium which included a similar feature expanded the bounding box to work around this.

TelepathicGrunt commented 10 months ago

Won’t expanding bounding box also cause particles to behave differently? Some particles have physics attached to them

ageuxo commented 10 months ago

Won’t expanding bounding box also cause particles to behave differently? Some particles have physics attached to them

looking at the linked code it doesn't actually change the size it just checks a box that is slightly larger than the particle's bounding box

Lolothepro commented 10 months ago

Jellysquid removed this optimization because it caused too many bugs in Sodium, and was useless.

pupnewfster commented 10 months ago

According to the original PR that added this the improvement was quite substantial and not "useless" https://github.com/MinecraftForge/MinecraftForge/pull/6981

Lolothepro commented 10 months ago

According to the original PR that added this the improvement was quite substantial and not "useless" MinecraftForge/MinecraftForge#6981

Useless compared to the other Sodium optimization.

image

XFactHD commented 10 months ago

I looked into this a bit and found that the cause of this is a fundamental design issue (could also call it an outright bug) with particles. The x and z coordinates of a particle are in the center of its bounding box and the y coordinate is at the bottom of said bounding box. This would not necessarily be an issue if the actual rendering (at least of SingleQuadParticles like the campfire smoke) wouldn't then put the y coordinate into the center of the quad being rendered. This causes the significant offset between the bounding box and the actual texture in the screenshot below. The most hilarious part of this is that the campfire smoke particle even explicitly compensates for this issue by shrinking the bounding box after setting the quad scale to prevent the particles hovering weirdly below blocks and also offsets the spawn position slightly to make the point of "appearance" look correct. 2023-10-24_21 35 03

Lolothepro commented 10 months ago

Note: this doesn't just happen with smoke particles

XFactHD commented 10 months ago

Yes, as I said, this is a fundamental design flaw with flat particles like the campfire smoke and not limited to the smoke particle.

Lolothepro commented 9 months ago

Workaround: install OptiFine

TelepathicGrunt commented 9 months ago

@Lolothepro wrong. Optifine is not a solution and is a terrible recommendation

Lolothepro commented 9 months ago

@Lolothepro wrong. Optifine is not a solution and is a terrible recommendation

It's not a solution, it's just a workaround, and even if it's a terrible recommendation, it fixes the issue.

XFactHD commented 8 months ago

Fixed by #458