Convert Figma logo to code with AI

CaffeineMC logophosphor-fabric

A Fabric mod designed to dramatically improve the performance of Minecraft's lighting engine while fixing many bugs

1,111
71
1,111
1

Top Related Projects

5,188

A Minecraft mod designed to improve frame rates and reduce micro-stutter

2,037

A Fabric mod designed to improve the general performance of Minecraft without breaking things

10,924

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies

Rewrites the light engine to fix lighting performance and lighting errors

Quick Overview

Phosphor-fabric is a Minecraft mod that optimizes the lighting engine for improved performance. It's designed to work with the Fabric modloader and aims to enhance game speed without altering vanilla gameplay mechanics.

Pros

  • Significantly improves game performance, especially in areas with complex lighting
  • Compatible with other Fabric mods
  • Maintains vanilla gameplay mechanics
  • Open-source project with active development

Cons

  • Only works with the Fabric modloader, not compatible with Forge
  • May conflict with other mods that modify lighting systems
  • Requires Fabric API to function
  • Performance improvements may vary depending on hardware and game settings

Getting Started

To use Phosphor-fabric in your Minecraft installation:

  1. Install the Fabric modloader for your Minecraft version
  2. Download the Fabric API mod
  3. Download the latest version of Phosphor-fabric compatible with your Minecraft version
  4. Place both the Fabric API and Phosphor-fabric .jar files in your Minecraft mods folder
  5. Launch Minecraft using the Fabric profile

Note: Ensure you're using compatible versions of Minecraft, Fabric modloader, Fabric API, and Phosphor-fabric for the best experience.

Competitor Comparisons

5,188

A Minecraft mod designed to improve frame rates and reduce micro-stutter

Pros of Sodium

  • More comprehensive optimization, targeting rendering, chunk loading, and general performance
  • Significantly higher FPS boost in most scenarios
  • Actively maintained with frequent updates

Cons of Sodium

  • May have compatibility issues with some mods due to its extensive changes
  • Can be more resource-intensive on lower-end systems in certain situations

Code Comparison

Sodium:

public class ChunkRenderRebuildTask implements CancellableTask {
    private final ChunkRenderer renderer;
    private final ChunkRenderContext context;
    private final BlockPos origin;
    private final ChunkSlice slice;
    private final ChunkModelBuilder builder;
}

Phosphor:

public class LightingEngine {
    private final ChunkLightProvider<?, ?> lightProvider;
    private final LightStorage<?> lightStorage;
    private final BlockPos.Mutable scratchPos = new BlockPos.Mutable();
    private final Long2IntOpenHashMap pendingRebuildChunks = new Long2IntOpenHashMap();
}

Summary

Sodium offers more comprehensive optimizations and generally higher performance gains compared to Phosphor. However, Phosphor focuses specifically on lighting optimizations and may have better compatibility with other mods. Both projects aim to improve Minecraft's performance, but Sodium takes a broader approach, while Phosphor specializes in lighting enhancements.

2,037

A Fabric mod designed to improve the general performance of Minecraft without breaking things

Pros of Lithium

  • Broader optimization scope, targeting various game systems beyond lighting
  • Generally provides more significant performance improvements
  • More frequent updates and active development

Cons of Lithium

  • May cause more compatibility issues with other mods due to its extensive optimizations
  • Slightly more complex configuration options

Code Comparison

Phosphor (lighting optimization):

public int getLightLevel(BlockPos pos) {
    return this.getLightEngine().getLight(pos, 0);
}

Lithium (entity collision optimization):

public void moveEntity(Entity entity, double x, double y, double z) {
    this.getEntityLookup().move(entity.getId(), entity.getBlockX(), entity.getBlockZ());
    entity.setPos(entity.getX() + x, entity.getY() + y, entity.getZ() + z);
}

Both Phosphor and Lithium are performance optimization mods for Minecraft, developed by CaffeineMC. Phosphor focuses specifically on improving lighting performance, while Lithium offers a more comprehensive set of optimizations across various game systems. Lithium generally provides more significant performance gains but may have slightly higher compatibility risks. Both mods are valuable for enhancing Minecraft performance, with Lithium being the more feature-rich option at the cost of potentially increased complexity.

10,924

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies

Pros of Paper

  • More comprehensive server optimization, addressing various aspects beyond lighting
  • Larger community and more frequent updates
  • Extensive configuration options for fine-tuning server performance

Cons of Paper

  • Potentially more resource-intensive due to broader optimizations
  • May introduce compatibility issues with some mods or plugins

Code Comparison

Phosphor-fabric (lighting optimization):

public int getLightLevel(BlockPos pos) {
    return this.getChunkProvider().getLightEngine().getLight(pos, 0);
}

Paper (example of chunk loading optimization):

public CompletableFuture<Either<IChunkAccess, ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int x, int z, ChunkStatus requiredStatus, boolean create) {
    return this.getChunkFutureMainThread(x, z, requiredStatus, create);
}

Summary

Phosphor-fabric focuses specifically on lighting optimizations, while Paper offers a more comprehensive suite of server-side improvements. Paper is generally more suitable for larger servers or those requiring extensive customization, while Phosphor-fabric may be preferable for servers primarily concerned with lighting performance or those seeking a lighter-weight solution.

Rewrites the light engine to fix lighting performance and lighting errors

Pros of Starlight

  • Significantly faster light propagation algorithm
  • Better performance in complex lighting scenarios
  • More frequent updates and active development

Cons of Starlight

  • Less compatibility with other mods compared to Phosphor
  • May introduce occasional lighting glitches in certain situations
  • Requires more server resources for initial chunk loading

Code Comparison

Starlight:

private int[] getEmptySkyLightSection() {
    int[] section = new int[2048];
    Arrays.fill(section, 0xFFFF);
    return section;
}

Phosphor:

private static ChunkNibbleArray createEmptySkyLightSection() {
    ChunkNibbleArray array = new ChunkNibbleArray();
    array.fill((byte) 15);
    return array;
}

Both projects aim to optimize Minecraft's lighting engine, but Starlight takes a more aggressive approach, completely rewriting the lighting system. This results in better performance but potentially less compatibility. Phosphor, on the other hand, focuses on optimizing the vanilla lighting system, offering better mod compatibility at the cost of some performance gains. The code comparison shows different approaches to creating empty skylight sections, with Starlight using a more efficient array-based method.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Phosphor (for Fabric)

GitHub license GitHub issues GitHub tag

Phosphor is a free and open-source Minecraft mod (under GNU GPLv3) aiming to save your CPU cycles and improve performance by optimizing one of Minecraft's most inefficient areas-- the lighting engine. It works on both the client and server, and can be installed on servers without requiring clients to also have the mod.

The mod is designed to be as minimal as possible in the changes it makes, and as such, does not modify the light model or interfaces of vanilla Minecraft. Because of this, Phosphor should be compatible with many Minecraft mods (so long as they do not make drastic changes to how the lighting engine works.) If you've ran into a compatibility problem, please open an issue!


Installation

Manual installation (recommended)

You will need Fabric Loader 0.10.x or newer installed in your game in order to load Phosphor. If you haven't installed Fabric mods before, you can find a variety of community guides for doing so here.

Stable releases

GitHub release

The latest releases of Phosphor are published to our Modrinth and GitHub release pages. Releases are considered by our team to be suitable for general use, but they are not guaranteed to be free of bugs and other issues.

Usually, releases will be made available on GitHub slightly sooner than other locations.

Bleeding-edge builds (unstable)

GitHub build status

If you are a player who is looking to get your hands on the latest bleeding-edge changes for testing, consider taking a look at the automated builds produced through our GitHub Actions workflow. This workflow automatically runs every time a change is pushed to the repository, and as such, the builds it produces will generally reflect the latest snapshot of development.

Bleeding edge builds will often include unfinished code that hasn't been extensively tested. That code may introduce incomplete features, bugs, crashes, and all other kinds of weird issues. You should not use these bleeding edge builds unless you know what you are doing and are comfortable with software debugging. If you report issues using these builds, we will expect that this is the case. Caveat emptor.

CurseForge

CurseForge downloads

If you are using the CurseForge client, you can continue to find downloads through our CurseForge page. Unless you are using the CurseForge client, you should prefer the downloads linked on our Modrinth or GitHub release pages above.


Reporting Issues

You can report bugs and crashes by opening an issue on our issue tracker. Before opening a new issue, use the search tool to make sure that your issue has not already been reported and ensure that you have completely filled out the issue template. Issues which are duplicates or do not contain the necessary information to triage and debug may be closed.

Please note that while the issue tracker is open to feature requests, development is primarily focused on improving hardware compatibility, performance, and finishing any unimplemented features necessary for parity with the vanilla renderer.

Community

Discord chat

We have an official Discord community for all of our projects. By joining, you can:

  • Get installation help and technical support with all of our mods
  • Be notified of the latest developments as they happen
  • Get involved and collaborate with the rest of our team
  • ... and just hang out with the rest of our community.

Building from sources

Support is not provided for setting up build environments or compiling the mod. We ask that users who are looking to get their hands dirty with the code have a basic understanding of compiling Java/Gradle projects. The basic overview is provided here for those familiar.

Requirements

  • JDK 8 or newer
    • You will need JDK 8 in order to build Phosphor, which can be installed through a supported package manager such as Chocolatey on Windows or SDKMAN! on other platforms. If you'd prefer to not use a package manager, you can always grab the installers or packages directly from Adoptium.
  • Gradle 6.7 or newer (optional)
    • The Gradle wrapper is provided in this repository can be used instead of installing a suitable version of Gradle yourself. However, if you are building many projects, you may prefer to install it yourself through a suitable package manager as to save disk space and to avoid many different Gradle daemons sitting around in memory.

Building with Gradle

Phosphor uses a typical Gradle project structure and can be built by simply running the default build task. After Gradle finishes building the project, you can find the build artifacts (typical mod binaries, and their sources) in build/libs.

Tip: If this is a one-off build, and you would prefer the Gradle daemon does not stick around in memory afterwards, try adding the --no-daemon flag to ensure that the daemon is torn down after the build is complete. However, subsequent builds of the project will start more slowly if the Gradle daemon is not available to be re-used.

Build artifacts ending in dev are outputs containing the sources and compiled classes before they are remapped into stable intermediary names. If you are working in a developer environment and would like to add the mod to your game, you should prefer to use the modRuntime or modImplementation configurations provided by Loom instead of these outputs.


License

Phosphor is licensed under GNU LGPLv3, a free and open-source license. For more information, please see the license file.