Skip to content

Instantly share code, notes, and snippets.

@d7samurai
d7samurai / .readme.md
Last active October 30, 2025 04:00
Minimal D3D11 bonus material: MSAA

Minimal D3D11 bonus material: MSAA

image

This is essentially just the original Minimal D3D11 codebase with 8x MSAA added. However, since MSAA only smooths triangle edges and does not affect textured surface interiors, texturing is removed to isolate the effect of MSAA and make it clearer.

In short there are two parts to it: 1) Create and render to an MSAA texture rather than your typical rendertarget/framebuffer (note: the depth buffer must match), and 2) [Resolve](https://gist.github.com/d7samurai/d74299f8bcadcb9cb0

@aras-p
aras-p / unity_6_empty_web_build.md
Last active October 24, 2025 07:28
Unity 6 "empty" web build file sizes

This short post by Defold people about "empty project build size" comparison between Defold, Unity and Godot (twitter, mastodon) sparked my interest.

It is curious that Godot builds seem to be larger than Unity? Would not have expected that! Anyway.

A way more extensive Unity "web" build comparison and analysics is over at https://github.com/JohannesDeml/UnityWebGL-LoadingTest but here are just my short notes in trying out Unity 6 (6.0.23 - Oct 2024).

Default (3D, URP) template

@FreyaHolmer
FreyaHolmer / GpuPrinter.cginc
Last active October 28, 2025 17:02
A unity shader .cginc to draw numbers in the fragment shader - see the first comment below for example usage!
///////////////////////////////////////////////////////////////////////////////
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader
// AUTHOR: Freya Holmér
// LICENSE: Use for whatever, commercial or otherwise!
// Don't hold me liable for issues though
// But pls credit me if it works super well <3
// LIMITATIONS: There's some precision loss beyond 3 decimal places
// CONTRIBUTORS: yes please! if you know a more precise way to get
// decimal digits then pls lemme know!
// GetDecimalSymbolAt() could use some more love/precision
@FreyaHolmer
FreyaHolmer / AssetCopyUtils.cs
Last active June 12, 2024 07:25
Adds context menu items to assets: Copy/Paste import settings & Copy GUID. Put this script in any Editor/ folder in your project and recompile!
// written by https://github.com/FreyaHolmer so use at your own risk c:
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/// <summary>Utility functions to copy GUIDs, as well as Copy/Paste import settings</summary>
public static class AssetCopyUtils {
const int CTX_MENU_LOCATION = 70;
@Lerg
Lerg / tasks.json
Last active July 7, 2023 22:29
"Jai: Build & Run" - VS Code task for building and running a Jai program
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Jai: Build & Run",
"command": "jai -quiet ${file} && ${fileDirname}${pathSeparator}${fileBasenameNoExtension}",
"group": "build",
"presentation": {
"revealProblems": "onProblem",
@yasirkula
yasirkula / MultiScreenshotCapture.cs
Last active August 25, 2025 12:09
Capture multiple screenshots with different resolutions simultaneously in Unity 3D
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MultiScreenshotCaptureNamespace
{
internal static class ReflectionExtensions
@dvf
dvf / change-codec.md
Last active November 7, 2025 05:40
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active November 4, 2025 18:11
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;