Skip to content

Instantly share code, notes, and snippets.

View ouerkakaChango's full-sized avatar

Chango ouerkakaChango

  • Shanghai
View GitHub Profile
@lyuma
lyuma / GodotToUnitySH9.glsl
Created October 30, 2020 23:49
Convert Godot spherical harmonics to Unity SH9 coefficients (e.g. ShadeSH9)
// Global temporary variables in GLSL, and access to ambient/reflection/SH9 in shaders:
// Requires these patches:
// https://github.com/lyuma/godot/tree/shader_improvements_meta (master)
// https://github.com/lyuma/godot/tree/shader_global_arrays_3.2 (3.2)
// https://github.com/lyuma/godot/tree/shader_npr_lighting_3.2 (3.2)
vec4 unity_SHAr = vec4(0.0);
vec4 unity_SHAg = vec4(0.0);
vec4 unity_SHAb = vec4(0.0);
vec4 unity_SHBr = vec4(0.0);
@h3r
h3r / noise.inc
Last active January 7, 2024 14:09
hlsl Noise generator functions
/*
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass (hermann.plass@gmail.com) - 2020
Source:
https://thebookofshaders.com/11/
https://thebookofshaders.com/edit.php#11/lava-lamp.frag
@kasari
kasari / PostProcess-HeightFog.shader
Created November 3, 2019 09:20
[Unity] Post Process Height Fog
Shader "PostProcess/HeightFog"
{
Properties
{
[HideInInspector] _MainTex ("Texture", 2D) = "white" {}
_FogColor ("FogColor", Color) = (1,1,1,1)
_FogDensity ("FogDensity", Range(0,1)) = 0.2
_FogHeight ("FogHeight", float) = 5.0
}
SubShader
@tf1379
tf1379 / MeshVertexInfoVisualizer.cs
Created January 9, 2018 11:05
A script to show normal, tangent, binormal in Unity Scene View
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HEAP
{
[ExecuteInEditMode]
public class MeshVertexInfoVisualizer : MonoBehaviour
{
[System.Flags]
@gunderson
gunderson / FlyCamera.cs
Last active May 10, 2024 12:53
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout