Skip to content

Instantly share code, notes, and snippets.

@hippocoder
hippocoder / hlsl
Created February 22, 2026 19:40
Pixel Art Antialiasing UVs
// ANTIALIASED PIXEL ART SAMPLING EXAMPLE
//old code by Robert Cummings, thanks to Ben Golus for the original techniques + the internets etc (this isn't copyrighted code!)
//all this code is considered open source - do what you want, just don't bother charging for it, share with people
//each texel is a flat plateau of solid colour.
//blending occurs at transition band at texel borders, sized to cover one screen pixel, no shimmer/blur/crawl etc...
//this effectively turns the bilinear filter into a box filter exactly one screen pixel wide, centered on the texel boundary.
//texture and sampler should use BILINEAR filtering + CLAMP or WRAP as needed, no mipmaps!!!
//point filtering will NOT work
//should work with on UE (custom nodes), Unity, Godot / most engines with a few tweaks
@hippocoder
hippocoder / SetDate.cs
Created June 27, 2022 20:29 — forked from paulhayes/Sun.cs
Rotates a Unity directional light based on location and time. Includes time scale, and frame stepping for continuous use.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Entropedia
{
public class SetDate : MonoBehaviour
{
public Sun sun;
@hippocoder
hippocoder / DoomGlow.cs
Created June 22, 2022 14:41 — forked from TiliSleepStealer/DoomGlow.cs
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
using UnityEngine;
public class TerrainDetector
{
private TerrainData terrainData;
private int alphamapWidth;
private int alphamapHeight;
private float[,,] splatmapData;
private int numTextures;
@hippocoder
hippocoder / GameSettingsProvider.cs
Created December 20, 2018 07:29
Draw the default inspector for your SettingsProvider to save time!
using UnityEditor;
static class GameSettingsProvider
{
[SettingsProvider]
public static SettingsProvider CreateGameSettings()
{
var provider = new SettingsProvider("Game/Settings", SettingsScope.Project)
{
guiHandler = (searchContext) =>
{