- Fine an image you like
- Open it in Photoshop
- Export it in GIF (16bits better for it)
- Import it in the tool after installing it (ColorPickingTool.air): https://www.dropbox.com/sh/c21kl8x9tj4y23x/JfjzpeUaFE
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
// bezier curve with 2 control points | |
// A is the starting point, B, C are the control points, D is the destination | |
// t from 0 ~ 1 | |
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, float t) { | |
vec3 E = mix(A, B, t); | |
vec3 F = mix(B, C, t); | |
vec3 G = mix(C, D, t); | |
vec3 H = mix(E, F, t); | |
vec3 I = mix(F, G, t); |
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
float levelChannel(float inPixel, float inBlack, float inGamma, float inWhite, float outBlack, float outWhite) { | |
return (pow(((inPixel * 255.0) - inBlack) / (inWhite - inBlack), inGamma) * (outWhite - outBlack) + outBlack) / 255.0; | |
} | |
vec3 levels(vec3 inPixel, float inBlack, float inGamma, float inWhite, float outBlack, float outWhite) { | |
vec3 o = vec3(1.0); | |
o.r = levelChannel(inPixel.r, inBlack, inGamma, inWhite, outBlack, outWhite); | |
o.g = levelChannel(inPixel.g, inBlack, inGamma, inWhite, outBlack, outWhite); | |
o.b = levelChannel(inPixel.b, inBlack, inGamma, inWhite, outBlack, outWhite); | |
return o; |
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
vec2 rotateUV(vec2 uv, float rotation) | |
{ | |
float mid = 0.5; | |
return vec2( | |
cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid, | |
cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid | |
); | |
} | |
vec2 rotateUV(vec2 uv, float rotation, vec2 mid) |
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
// https://stackoverflow.com/questions/31775686/is-there-a-way-to-know-anything-about-hardware-resources-of-platform-accessing/31896597#31896597 | |
// https://stackoverflow.com/questions/15464896/get-cpu-gpu-memory-information | |
var canvas = document.createElement('canvas') | |
var gl = canvas.getContext('experimental-webgl'); | |
var params = [gl.RENDERER, gl.VENDOR, gl.VERSION, gl.SHADING_LANGUAGE_VERSION]; | |
var infos = gl.getExtension('WEBGL_debug_renderer_info'); | |
params.push(infos.UNMASKED_RENDERER_WEBGL, infos.UNMASKED_VENDOR_WEBGL); | |
params.forEach(function(param) { |
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
function screenToWorldAtZ(positionX, positionY, z, camera){ | |
var vector = new THREE.Vector3(); | |
var dX, dY, dZ; | |
if(this.curObject && this.curObject.parent ){ | |
dX = this.curObject.parent.position.x; | |
dY = this.curObject.parent.position.y; | |
dZ = this.curObject.parent.position.z; | |
}else{ | |
dX = 0; dY = 0, dZ = 0; |
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
function screenToWorldAtZ(positionX, positionY, z, camera){ | |
var vector = new THREE.Vector3(); | |
var dX, dY, dZ; | |
if(this.curObject && this.curObject.parent ){ | |
dX = this.curObject.parent.position.x; | |
dY = this.curObject.parent.position.y; | |
dZ = this.curObject.parent.position.z; | |
}else{ | |
dX = 0; dY = 0, dZ = 0; |
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
https://docs.google.com/spreadsheets/d/1H7ITmzPHGjQl_RUrZjJu-uDq37s12YfN3_T8iYo7keU/edit?usp=sharing |
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
uniform sampler2D tInput; | |
uniform vec2 resolution; | |
varying vec2 vUv; | |
uniform float divide3; | |
uniform float divide4; | |
uniform float mirrorX; | |
uniform float mirrorY; | |
void main() { |
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
import vs from "shaders/physicalcustom.vs" | |
import fs from "shaders/physicalcustom.fs" | |
export default class MeshCustomMaterial extends THREE.MeshPhysicalMaterial { | |
constructor(parameters, uniforms={}){ | |
super(parameters) | |
this.defines = { 'PHYSICAL': '' }; |
NewerOlder