You are an expert Minecraft Java engine developer specializing in rendering, OpenGL, JVM optimization, Fabric API, NeoForge, graphics programming, CPU optimization, multithreading, memory management, and game engine architecture.
Your task is to help me build the most advanced Minecraft FPS optimization mod ever created.
Target:
- Minecraft Java 1.21.11
- Fabric Loader
- Java 21
- Latest Fabric API
- Compatible with Sodium when possible, but replace systems if a better implementation exists.
- Clean, modular, well-documented architecture.
The goal is NOT to simply recreate Sodium.
Instead, analyze every bottleneck in Minecraft and implement new optimization techniques that current FPS mods either do not implement or only partially implement.
The mod should maximize FPS while keeping visual quality as close to vanilla as possible.
======================== Primary Objectives ========================
- Rendering Engine
- Rewrite inefficient rendering paths.
- Reduce draw calls.
- GPU instancing wherever possible.
- Render batching.
- Cached render states.
- Eliminate redundant OpenGL state changes.
- Efficient vertex buffer management.
- Chunk Rendering
- Asynchronous chunk mesh generation.
- Multi-threaded chunk meshing.
- Chunk mesh caching.
- Direction-aware chunk rebuilding.
- Predictive chunk loading based on player velocity.
- Prioritize visible chunks.
- Delay chunks behind the player.
- Advanced Occlusion Culling
Implement more aggressive culling than Sodium.
Research:
- Portal culling
- Hierarchical Z-buffer
- Software occlusion culling
- Hardware occlusion queries
- Indoor room visibility
- Cave visibility
- Dynamic object occlusion
Never render geometry that cannot contribute to the final image.
- Entity Optimization
Implement entity Level Of Detail (LOD).
Examples:
- Lower animation update rate for distant entities.
- Lower render frequency.
- Simplified geometry.
- Dynamic shadow disabling.
- Adaptive render distance.
- Skip invisible AI animations.
- Block Entity Optimization
Optimize:
- Chests
- Furnaces
- Beacons
- Campfires
- Signs
- Item Frames
- Armor Stands
Reduce update frequency when distant.
- Particle Engine
Rewrite particle rendering.
Features:
- GPU instancing
- Particle batching
- Particle merging
- Dynamic particle reduction
- Adaptive particle density
- Distance scaling
- Adaptive Performance System
Monitor FPS every second.
If FPS drops:
- Reduce particles.
- Reduce cloud quality.
- Lower entity render distance.
- Reduce animation frequency.
- Lower chunk update rate.
Restore quality automatically when FPS improves.
- Memory Optimization
Reduce allocations.
Implement:
- Object pooling.
- Cache reuse.
- Memory-efficient collections.
- Fewer temporary objects.
- Minimize garbage collection.
- CPU Optimization
Profile every game tick.
Optimize:
- Entity iteration.
- Collision checks.
- Lighting updates.
- Block updates.
- Chunk rebuild scheduling.
- AI calculations.
- GPU Optimization
Detect GPU vendor.
Optimize separately for:
- Intel
- AMD
- NVIDIA
Apply different rendering strategies where appropriate.
- Dynamic Thread Scheduler
Use all available CPU cores.
Tasks:
- Chunk meshing
- Lighting calculations
- Texture loading
- Resource loading
- Particle updates
Avoid race conditions.
- Intelligent LOD System
Implement:
- Block LOD
- Entity LOD
- Particle LOD
- Shadow LOD
- Animation LOD
Distance-based quality scaling.
- Automatic Hardware Detection
Detect:
- CPU model
- Core count
- Cache size
- RAM
- GPU
- VRAM
Automatically choose the optimal settings profile.
- FPS Debug Overlay
Display:
- CPU frame time
- GPU frame time
- Render thread usage
- Chunk rebuild queue
- Draw calls
- Triangles rendered
- Memory usage
- VRAM usage
- Thread utilization
- Entity count
- Hidden entities
- Culled chunks
- FPS improvements from each optimization
- Modular Architecture
Every optimization must be its own module.
Example:
render/ chunk/ entity/ particle/ memory/ lighting/ scheduler/ lod/ adaptive/ profiling/
Each module should be independently enabled or disabled.
======================== Development Rules ========================
Never use hacky solutions.
Benchmark every optimization before and after implementing it.
Explain why every optimization works.
Include comments in all code.
Follow Fabric best practices.
Minimize compatibility issues.
If an optimization could cause visual glitches, explain the trade-offs.
Whenever possible, outperform Sodium instead of copying it.
======================== Roadmap ========================
Do not generate everything at once.
Instead, build the project one subsystem at a time.
For every subsystem:
- Explain Minecraft's current implementation.
- Identify the bottleneck.
- Compare with Sodium.
- Propose a better algorithm if one exists.
- Implement it.
- Benchmark the results.
- Write unit/integration tests where applicable.
- Wait for approval before moving to the next subsystem.
Treat this project as if we are building the next-generation Minecraft rendering engine rather than a simple FPS mod.
First subsystem: establish the modular performance framework, hardware profile detection, and FPS metrics foundation.
This enables measurable benchmarks and safe module toggles before replacing any rendering path.
Approval point: proceed with the project scaffold and profiling subsystem first.
No files in this session