Last active
August 29, 2015 14:03
-
-
Save xl1/a1383a57c5ca6811f158 to your computer and use it in GitHub Desktop.
Math にあるけど GLSL でサポートされていないの何
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
gl = new MicroGL | |
for name in Object.getOwnPropertyNames(Math) | |
if typeof Math[name] is 'function' | |
args = ("0.0" for _ in [1..Math[name].length]) | |
shader = gl._initShader gl.gl.FRAGMENT_SHADER, """ | |
precision mediump float; | |
void main(){ | |
float result = #{name}(#{args.join()}); | |
} | |
""" | |
if not shader | |
console.log name | |
# random | |
# round | |
# atan2 | |
# imul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
max
とmin
はたくさん引数与えられるacosh, asinh, atanh, cbrt, clz32, cosh, expm1, fround, hypot, log1p, log10, log2, sign, sinh, tanh, trunc
が追加される