Skip to content

Instantly share code, notes, and snippets.

@ElonGame
ElonGame / StableConstantTextureSize.shader
Created March 6, 2026 04:18 — forked from bgolus/StableConstantTextureSize.shader
Visually stable constant screen space sized texture shader for Unity
Shader "Unlit/Stable Constant Texture Size"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Shader "Pristine Triplanar Grid"
{
Properties
{
[KeywordEnum(World,Object,ObjectAlignedWorld)] _GridSpace ("Grid Space", Float) = 0.0
_GridScale ("Grid Scale", Float) = 1.0
[Toggle(USE_VERTEX_NORMALS)] _UseVertexNormals ("Use Vertex Normals", Float) = 0.0
[Toggle] _ShowOnlyTwo ("Show Only Two Grid Axis", Float) = 0.0
@ElonGame
ElonGame / InfiniteGrid.shader
Created March 6, 2026 03:17 — forked from bgolus/InfiniteGrid.shader
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@ElonGame
ElonGame / Outline.shader
Last active June 23, 2025 02:11 — forked from ScottJDaley/Outline.shader
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more
// by @gravitonpunch for ECS/DOTS/HybridRenderer.
// https://twitter.com/bgolus
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
Shader "Hidden/Outline"
{
Properties
@ElonGame
ElonGame / app.py
Created June 5, 2025 09:15 — forked from anandadake/app.py
Convert .avi video file to .mp4 video file
"""
python -m pip install moviepy
"""
import os
from time import time
import moviepy.editor as moviepy
def convert_avi_to_mp4(avi_file_path):
# function guard
@ElonGame
ElonGame / pip.conf
Created May 15, 2025 02:43 — forked from huynle/pip.conf
pip.ini (Windows) or pip.conf (unix) for proxy
[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
proxy = http://[domain name]%5C[username]:[password]@[proxy address]:[proxy port]
@ElonGame
ElonGame / microproxy.py
Created May 15, 2025 02:40 — forked from dracos/microproxy.py
A very small python HTTP proxy
#!/usr/bin/env python
"""
Microproxy
This code is based on http://pastebin.com/mdsAjhdQ based on code based on microproxy.py written by ubershmekel in 2006.
Microproxy is a very small HTTP proxy. It relays all bytes from the client to the server at a socket send and recv level.
It looks at the Host: header to recognise where to connect to.
"""
@ElonGame
ElonGame / .block
Created May 12, 2025 08:33 — forked from mbostock/.block
Milky Way
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/raster-reprojection
@ElonGame
ElonGame / ShowVertexNumber.cs
Created April 24, 2025 09:46 — forked from newpolaris/ShowVertexNumber.cs
display vertex id in unity
// Editor script that displays the number and UV coordinates of each individual vertex making up a triangle within a mesh
// To install, place in the Assets folder of a Unity project
// Open via Window > Show Vertex Info
// Author: Luke Gane
// Last updated: 2015-02-07
using UnityEditor;
using UnityEngine;
public class ShowVertexNumber : EditorWindow {
@ElonGame
ElonGame / raycastPlanetAtmosphere.glsl
Created March 17, 2025 01:43 — forked from devshgraphicsprogramming/raycastPlanetAtmosphere.glsl
Planet Atmosphere Intersection Shader Function
//!Warning does not model intersection with the Planet itself in the middle of the atmosphere
float calculateHazeFactor(in float fragDepth, in vec3 viewDir)
{
//hazeHeight and camPos are heights above sea level
bool aboveHaze = camPos>hazeHeight;
if (aboveHaze&&viewDir.y>=0.0)
return 1.0;
float planetRadius = 6357.0;
float hazeRadius = planetRadius+hazeHeight;