Skip to content

Instantly share code, notes, and snippets.

@takumifukasawa
takumifukasawa / CustomLitShader.cs
Last active May 7, 2025 20:55
Examples of Custom URP Lit Shader and Custom Shader GUI Script: Unity2019.4.21f, URP7.8.3
using System;
using UnityEngine;
using UnityEditor;
using UnityEditor.Rendering.Universal.ShaderGUI;
class CustomLitShader : BaseShaderGUI
{
// Properties
private LitGUI.LitProperties litProperties;
@laundmo
laundmo / lerp.py
Last active July 7, 2025 13:30
lerp, inverse lerp and remap in python
def lerp(a: float, b: float, t: float) -> float:
"""Linear interpolate on the scale given by a to b, using t as the point on that scale.
Examples
--------
50 == lerp(0, 100, 0.5)
4.2 == lerp(1, 5, 0.8)
"""
return (1 - t) * a + t * b