Skip to content

Instantly share code, notes, and snippets.

View parzivail's full-sized avatar

Colby Newman parzivail

View GitHub Profile
@Sturmlilie
Sturmlilie / apitrace-tutorial.md
Last active April 4, 2024 17:09
Debugging OpenGL issues in Minecraft mods using apitrace

Apitrace tutorial

Debugging OpenGL issues in Minecraft mods using apitrace

In the transition of Minecraft version 1.14 to 1.15, Mojang introduced some sweeping changes to the way rendering is performed; while the internal code still relies on GL1-era immediate-mode, block and entity renderer classes now provide their vertices to a specific RenderLayer* which are later rendered in ordered batches.

These changes broke a majority of Minecraft mods; in the process of porting a mod to 1.15, I had to frequently rely on a tool called “apitrace”, and I thought a quick how-to might come in handy for others struggling with similar problems. Apitrace allows capturing every OpenGL call an application makes, and later replaying these calls and inspecting the entire GL state machine at each rendering step.

For this tutorial, I am using the MultiMC launcher.

First step: Install apitrace

@AlexIIL
AlexIIL / BCSiliconModels.java
Last active April 20, 2020 18:51
Fabric custom item model loading
// A cut down version. This isn't compilabale as-is!
public class BCSiliconModels {
public static final ModelIdentifier CHIPSET_PART_A = new ModelIdentifier("buildcraftsilicon:redstone_chipset_a#inventory");
public static final ModelIdentifier CHIPSET_PART_B = new ModelIdentifier("buildcraftsilicon:redstone_chipset_b#inventory");
/** Called by the ClientModInitialiser */
public static void load() {
ModelLoadingRegistry.INSTANCE.registerAppender((manager, out) -> {
out.accept(CHIPSET_PART_A);
@Scobalula
Scobalula / DirectXTexUtil.cs
Created January 11, 2019 18:23
A quick class to generate headers, useful when dealing with headerless DDS data or converting game-specific headers to DDS without requiring Microsoft's DirectXTex Library.
// ------------------------------------------------------------------------
// DirectXTex Utility - A simple class for generating DDS Headers
// Copyright(c) 2018 Philip/Scobalula
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@santoshachari
santoshachari / nginx.default.conf
Last active February 22, 2022 22:11 — forked from sumardi/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
use warnings;
use Getopt::Std;
getopt('xytGgwsf',\%opts);
# pcm file = $opts{f}
# samples per pixel x
$xscale = $opts{x} // 1200;