Skip to content

Instantly share code, notes, and snippets.

@meshula
meshula / radiometric-vs-photometric.md
Last active June 5, 2025 19:05
radiometric-vs-photometric.md

Measuring Light

Light is measured in two ways. Radiometry measures the energy impinging on a sensor, and photometry attempts to qualitatively measure light to represent how a human observer experiences light. Radiometry is important when physical metrics must be preserved, such as in simulation tasks, and photometry is important in subjective tasks, such as selecting lights to illuminate a street.


Radiometric Units

Radiometric units measure the physical properties of light, independent of human perception. These units are based on the total energy or power of light across all wavelengths.

To better understand how these radiometric units are related, imagine a conceptual "cube" where each axis represents a dimension of measurement integration:

import startServer from "verdaccio";
const PORT = 4873
const STORAGE = "./storage";
const CONFIG = {
storage: STORAGE,
uplinks: {
"npmjs": {
"url": "https://registry.npmjs.org/"
}
@pbhogan
pbhogan / AspectRatioPanel.cs
Last active November 15, 2024 20:02
Unity UI-Toolkit Aspect Ratio Preserving Panel
/*
This is free and unencumbered software released into the public
domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
/// <summary>
/// A hash combiner that is implemented with the Fowler/Noll/Vo algorithm (FNV-1a). This is a mutable struct for performance reasons.
/// Taken from https://gist.github.com/StephenCleary/4f6568e5ab5bee7845943fdaef8426d2
/// </summary>
public struct FnvHash
{
/// <summary>
/// The starting point of the FNV hash.
/// </summary>
public const ulong Offset = 14695981039346656037;
@binaryfoundry
binaryfoundry / wavelets.js
Last active April 25, 2020 17:45
Haar Wavelets
// http://bearcave.com/misl/misl_tech/wavelets/index.html
class WaveletBase {
constructor() {
this.forward = 1;
this.inverse = 2;
}
split(vec, N) {
var half = N >> 1;
var vc = vec.slice();
@roguesleipnir
roguesleipnir / SearchForProperties.cs
Last active April 7, 2021 11:20
Quick search for components and serialized properties in prefabs.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class SearchForProperties : EditorWindow {
MonoScript targetComponent;
string propertyString;
bool hideVariants;
@yassineaboukir
yassineaboukir / Electron app decompiling
Created June 12, 2019 01:10
Obtain the source code of Electron applications
# Open terminal and install asar node module globally
$ npm install -g asar
# Go into the app’s directory, in our case it’s Slack
$ cd /Applications/Slack.app/Contents/Resources
# Create a directory to paste the content of app
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active May 29, 2025 06:08
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
namespace Cluster {
public class CollisionCall : MonoBehaviour {
public LayerMask layerMask = -1;