Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Nvidium
This is an unofficial fork of the Nvidium mod, porting it to NeoForge. The original mod's author is cortex.
Links to the author:

[![Modrinth](https://img.shields.io/modrinth/dt/nvidium?logo=modrinth)](https://modrinth.com/mod/nvidium)
https://modrinth.com/user/cortex

Nvidium is an alternate rendering backing for sodium, it uses cutting edge nvidia features to render huge amounts of
terrain geometry at very playable framerates.
https://github.com/MCRcortex

### Requires sodium and an nvidia gtx 1600 series or newer to run (turing+ architecture)
Link to the original mod:

https://modrinth.com/mod/nvidium

# Nvidium [Neoforge] UNOFFICIAL




Nothing from the mod was cut or changed in terms of logic. Everything remains as before, but now on the previously unsupported Neoforge.

### The mod still only supports Nvidia graphics cards, and still only from the 16xx series and above.
131 changes: 82 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,78 +1,111 @@
/*
* Nvidium - High performance rendering engine for Minecraft
* Copyright (C) 2023 cortex
*
* Modified by 1Influence (2025) - Ported to NeoForge build system.
* Licensed under LGPL-3.0-only
*/



plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'java-library'
id 'maven-publish'

id 'net.neoforged.moddev' version '1.0.17'
}

def gitCommitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
tasks.named('wrapper', Wrapper) {
distributionType = Wrapper.DistributionType.BIN
}
def buildtime = System.currentTimeSeconds()

version = project.mod_version
group = project.maven_group
group = project.mod_group_id

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
repositories {
mavenLocal()
mavenCentral()
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}

maven { url "https://maven.irisshaders.net/"}
}


java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}


neoForge {
version = project.neoforge_version

apply plugin: "fabric-loom"

loom {
mixin.defaultRefmapName = "nvidium.refmap.json"
runs {
it.configureEach {
vmArgs("-Xmx8G", "-XX:+UseZGC")
client {
client()

jvmArguments.addAll("-Xmx8G", "-XX:+UseZGC")
}
server {
server()
}
}
}

mods {

processResources {
inputs.properties("version": project.version, "commit": gitCommitHash, "buildtime":buildtime)

archivesBaseName = "nvidium"
filesMatching("fabric.mod.json") {
expand "commit": gitCommitHash, "version": project.version, "buildtime": buildtime
"${project.mod_id}" {
sourceSet(sourceSets.main)
}
}
}

repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"

def gitCommitHash = { ->
def stdout = new ByteArrayOutputStream()
try {
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception e) {
return "unknown"
}
}


processResources {
def buildProps = [
"version": project.version,
"commit": gitCommitHash(),
"minecraft_version": project.minecraft_version,
"mod_id": project.mod_id
]


filesMatching("META-INF/neoforge.mods.toml") {
expand buildProps
}
inputs.properties(buildProps)
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API
modImplementation(fabricApi.module("fabric-api-base", project.fabric_version))
modImplementation(fabricApi.module("fabric-block-view-api-v2", project.fabric_version))
modImplementation(fabricApi.module("fabric-rendering-fluids-v1", project.fabric_version))

modImplementation("net.fabricmc.fabric-api:fabric-rendering-data-attachment-v1:0.3.40+73761d2e3b")
modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_version))
// --- Sodium ---

implementation "maven.modrinth:sodium:mc1.21.1-0.6.13-neoforge"

// --- Iris (Optional) ---
compileOnly "maven.modrinth:iris:${project.iris_version}"

modImplementation "maven.modrinth:sodium:mc1.21-0.5.11"

//modImplementation "maven.modrinth:c2me-fabric:0.2.0+alpha.10.49+1.19.4"
//modImplementation "maven.modrinth:chunks-fade-in:v1.0.3-1.19.4"
//modImplementation "maven.modrinth:immersiveportals:v2.7.3-mc1.19.4"
modCompileOnly "maven.modrinth:iris:1.7.0+1.20.6"
}


tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
30 changes: 16 additions & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
# Nvidium Properties
# Modified by 1Influence for NeoForge port

minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11
org.gradle.jvmargs=-Xmx2G -Dfile.encoding=UTF-8

#Fabric api
fabric_version=0.100.1+1.21

# Mod Properties
mod_version=0.3.0
maven_group=me.cortex
archives_base_name=nvidium
# Dependencies
# check this on https://modmuss50.me/fabric.html
mod_group_id=me.cortex
mod_id=nvidium


minecraft_version=1.21

neoforge_version=21.0.167



sodium_version=mc1.21.1-0.6.13-neoforge

iris_version=1.8.12+1.21.1-neoforge
22 changes: 17 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
/*
* Nvidium - High performance rendering engine for Minecraft
* Copyright (C) 2023 cortex
*
* Modified by 1Influence (2025) - Ported to NeoForge build system.
* Licensed under LGPL-3.0-only
*/

pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
mavenCentral()
maven { url = 'https://maven.neoforged.net/releases' }

}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

rootProject.name = 'nvidium'
42 changes: 29 additions & 13 deletions src/main/java/me/cortex/nvidium/Nvidium.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/*
* Nvidium - High performance rendering engine for Minecraft
* Copyright (C) 2023 cortex
*
* Modified by 1Influence (2025) - Ported to NeoForge.
* Licensed under LGPL-3.0-only
*/

package me.cortex.nvidium;

import me.cortex.nvidium.config.NvidiumConfig;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.util.Util;
import net.minecraft.Util;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.ModList;
import net.neoforged.fml.loading.FMLLoader;
import net.neoforged.neoforge.common.NeoForge;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GLCapabilities;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -13,41 +24,46 @@ public class Nvidium {
public static final Logger LOGGER = LoggerFactory.getLogger("Nvidium");
public static boolean IS_COMPATIBLE = false;
public static boolean IS_ENABLED = false;
public static boolean IS_DEBUG = System.getProperty("nvidium.isDebug", "false").equals("TRUE");
public static boolean IS_DEBUG = Boolean.parseBoolean(System.getProperty("nvidium.isDebug", "false"));
public static boolean SUPPORTS_PERSISTENT_SPARSE_ADDRESSABLE_BUFFER = true;
public static boolean FORCE_DISABLE = false;

public static NvidiumConfig config = NvidiumConfig.loadOrCreate();

static {
ModContainer mod = (ModContainer) FabricLoader.getInstance().getModContainer("nvidium").orElseThrow(NullPointerException::new);
var version = mod.getMetadata().getVersion().getFriendlyString();
var commit = mod.getMetadata().getCustomValue("commit").getAsString();
MOD_VERSION = version+"-"+commit;
ModContainer mod = ModList.get().getModContainerById("nvidium")
.orElseThrow(() -> new NullPointerException("Nvidium mod container not found"));
var version = mod.getModInfo().getVersion().toString();
var commit = "unknown";
MOD_VERSION = version + "-" + commit;
}

public static void checkSystemIsCapable() {
var cap = GL.getCapabilities();
GLCapabilities cap = GL.getCapabilities();
boolean supported = cap.GL_NV_mesh_shader &&
cap.GL_NV_uniform_buffer_unified_memory &&
cap.GL_NV_vertex_buffer_unified_memory &&
cap.GL_NV_representative_fragment_test &&
cap.GL_ARB_sparse_buffer &&
cap.GL_NV_bindless_multi_draw_indirect;

IS_COMPATIBLE = supported;

if (IS_COMPATIBLE) {
LOGGER.info("All capabilities met");
} else {
LOGGER.warn("Not all requirements met, disabling nvidium");
LOGGER.warn("Not all requirements met, disabling Nvidium");
}
if (IS_COMPATIBLE && Util.getOperatingSystem() == Util.OperatingSystem.LINUX) {
LOGGER.warn("Linux currently uses fallback terrain buffer due to driver inconsistencies, expect increase vram usage");

if (IS_COMPATIBLE && Util.getPlatform() == Util.OS.LINUX) {
LOGGER.warn("Linux currently uses fallback terrain buffer due to driver inconsistencies, expect increased VRAM usage");
SUPPORTS_PERSISTENT_SPARSE_ADDRESSABLE_BUFFER = false;
}

if (IS_COMPATIBLE) {
LOGGER.info("Enabling Nvidium");
}

IS_ENABLED = IS_COMPATIBLE;
}
}
}
Loading