Skip to content

Instantly share code, notes, and snippets.

View loic35's full-sized avatar

Loïc LE GAL loic35

  • France
View GitHub Profile
@Cyanilux
Cyanilux / FogOfWarHandler.cs
Created November 17, 2021 16:46
Fog of war example using Graphics.Blit. But probably not very optimised.
using UnityEngine;
public class FogOfWarHandler : MonoBehaviour {
public RenderTexture rt_units; // Render Texture asset, stores circles around units
public RenderTexture rt; // Render Texture asset, combines rt_units with rt from previous frame
public Material material_cloudBrush; // shader : max(_MainTex, brush), where brush is a circle drawn at _Pos with _Radius and _Edge (softness)
public Material material_combine; // shader : max(_MainTex, _OtherTex)
public FogOfWarUnit[] units; // MonoBehaviour with public float properties : radius and softness
@totallyRonja
totallyRonja / MaterialGradientDrawer.cs
Last active November 13, 2024 11:51
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private int resolution;
@ropnop
ropnop / docker_aliases.sh
Created July 18, 2019 02:16
Docker aliases
function dockershell() {
docker run --rm -i -t --entrypoint=/bin/bash "$@"
}
function dockershellsh() {
docker run --rm -i -t --entrypoint=/bin/sh "$@"
}
function dockershellhere() {
dirname=${PWD##*/}
@rngtm
rngtm / HexagonNode.cs
Last active February 8, 2024 03:19
六角形タイルを作るShaderGraphカスタムノード
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
[Title("Distance", "Hexagon")]
public class HexagonNode : CodeFunctionNode
{
public HexagonNode()
@idbrii
idbrii / botw-cedec2017.md
Last active November 6, 2024 04:57
An inline image version of Matt Walker's translation of CEDEC 2017 talks by Nintendo
@gafferongames
gafferongames / delta_compression.cpp
Last active July 31, 2024 22:29
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>