Skip to content

Instantly share code, notes, and snippets.

View smkplus's full-sized avatar
😍
Curios

Seyed Morteza Kamali smkplus

😍
Curios
View GitHub Profile
@hizzlekizzle
hizzlekizzle / moire-resolve.glsl
Last active August 2, 2019 04:06
Moire mitigation shader code
#define moire_mitigation_factor 64.0
#define warpX 0.031
#define warpY 0.041
// Convert from linear to sRGB.
//float Srgb(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);}
vec4 Srgb(vec4 c){return pow(c, vec4(1.0 / 2.2));}
// Convert from sRGB to linear.
//float Linear(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);}
@tin2tin
tin2tin / Run_Script_in_PyConsole.py
Last active May 11, 2021 18:06
Run Script in the Python Console
bl_info = {
"name": "Run Script in PyConsole",
"author": "CoDEmanX",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "Python Console &gt; Console &gt; Run Script",
"description": "Execute the code of a textblock within the python console.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
@MagistrAVSH
MagistrAVSH / URP-VertexLit.shader
Last active October 12, 2024 02:00
UniversalRenderingPipeline VertexLit Shader
Shader "Universal Render Pipeline/Custom/VertexLit"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Gain ("Gain", Float) = 1.5
_Color ("Color", Color) = (1,1,1,1)
_EdgeColor ("Edge Color", Color) = (0,0,0,1)
[Toggle] _RemoveDiag("Remove diagonals", Float) = 0.
@mattyellen
mattyellen / UnityAsyncOperationAwaiter.cs
Created July 26, 2020 19:36
Allows the use of async/await (instead of yield) with any Unity AsyncOperation
public static class ExtensionMethods
{
public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOp)
{
var tcs = new TaskCompletionSource<object>();
asyncOp.completed += obj => { tcs.SetResult(null); };
return ((Task)tcs.Task).GetAwaiter();
}
}