This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import curses | |
from time import sleep | |
from os import get_terminal_size | |
from functools import partial | |
from itertools import cycle | |
from random import random | |
def display_rows(stdscr, getter, interval=10, timeout=0.1, pad=2, **kwargs): | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from io import StringIO | |
from math import ceil | |
from tqdm import tqdm | |
from colorama import Fore, Style, init | |
# Replace the {bar} placeholder in the bar format with the given string | |
def replace_bar(bar_format=None, bar=''): | |
return '{l_bar}' + bar + '{r_bar}' \ | |
if bar_format is None \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using RTF = UnityEngine.RenderTextureFormat; | |
using TF = UnityEngine.TextureFormat; | |
public static class RenderingExtensions | |
{ | |
public static TextureFormat ToTextureFormat(this RenderTextureFormat format) | |
=> format switch | |
{ | |
RTF.ARGB32 => TF.ARGB32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/ShadowCatcher" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 | |
[MainColor] _BaseColor("Color", Color) = (0.5,0.5,0.5,1) | |
[MainTexture] _BaseMap("Albedo", 2D) = "white" {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
/// <summary> | |
/// Clamps its local rotation to a view cone. Think of the view cone of a | |
/// spot light. | |
/// </summary> | |
[ExecuteAlways] | |
public class ClampRotationToCone : MonoBehaviour | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using MathNet.Numerics.LinearAlgebra; | |
/// <summary> | |
/// Apply transformation matrix reconstructed from four points to a material. | |
/// The matrix describes the transformation of the screen rectangle to the | |
/// quadrilateral spanned by the points after being projected in the screen | |
/// space of the connected camera. | |
/// </summary> | |
/// <author>David Kutschke</author> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> | |
/// This component serves no functional purpose. | |
/// Use it to document objects in the scene. | |
/// </summary> | |
public class Comment : MonoBehaviour | |
{ | |
[TextArea] | |
[Tooltip("Actual content of the comment.")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from | |
// https://forum.unity.com/threads/editor-compile-in-background.627952/#post-6989918 | |
using System.IO; | |
using System.Threading; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// Refreshes Asset Database as soon as file change was detected in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/Lit Retroreflective" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 | |
[MainColor] _BaseColor("Color", Color) = (0.5,0.5,0.5,1) | |
[MainTexture] _BaseMap("Albedo", 2D) = "white" {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/MatCapImproved" | |
{ | |
Properties | |
{ | |
[NoScaleOffset] _MainTex("MatCap", 2D) = "black" {} | |
_ViewDirBlend("View direction blend", Range(0,1)) = 0 | |
} | |
SubShader | |
{ |