This file contains 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
/* | |
"The colors are not evenly interpreted by our eyes." | |
source: https://cs.stackexchange.com/questions/11876/how-do-i-compute-the-luminance-of-a-pixel | |
*/ | |
float luminance(float r, float g, float b){ | |
return (r * 0.3) + (g * 0.59) + (b * 0.11); | |
} |
This file contains 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
// Unity Shader Doc https://docs.unity3d.com/Manual/SL-ShaderPrograms.html | |
// Unity Shader Doc https://docs.unity3d.com/Manual/SL-Reference.html | |
Shader "Custom/Test/foo shader" { | |
//Variables | |
Properties{ | |
// float, 2D (Texture), color etc. | |
_MainTexture("Main Color (RGB)", 2D) = "white" {} | |
_Color("Color", Color) = (1,1,1,1) |