This file contains hidden or 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
| #define sectorize(value) step(0.0, (value))*2.0-1.0 | |
| #define sum(value) dot(clamp((value), 1.0, 1.0), (value)) | |
| #define PI 3.141592653589793 | |
| vec2 normalToUvRectOct(vec3 normal){ | |
| normal /= sum(abs(normal)); | |
| if(normal.y > 0.0){ | |
| return normal.xz*0.5+0.5; | |
| } | |
| else{ |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| { | |
| "Version": "0.1", | |
| "Guid": { | |
| "Guid": "00000000-0000-0000-0000-000000000000", | |
| "DebugName": null | |
| }, | |
| "OwnerPlayerGuidString": "", | |
| "OwnerPlayerId": 0, | |
| "AuthorityPlayerId": 0, | |
| "AssemblyOABConfig": { |
This file contains hidden or 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
| from struct import unpack | |
| from zlib import decompress | |
| class BufferStream: | |
| def __init__(self, data): | |
| self.pos = 0 | |
| self.data = data | |
| def get(self, amount): | |
| result = self.data[self.pos:self.pos+amount] |
This file contains hidden or 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
| preprocess: (source) -> | |
| lines = [] | |
| result = [] | |
| filename = 'no file' | |
| lineno = 1 | |
| for line in source.split('\n') | |
| match = line.match /#line (\d+) (.*)/ | |
| if match | |
| lineno = parseInt(match[1], 10)+1 | |
| filename = match[2] |
This file contains hidden or 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
| ## create backup of home! ## | |
| ## part 1 before reboot, update system ## | |
| apt-get update | |
| apt-get upgrade | |
| shutdown -r now | |
| ## part 2 after first reboot install nvidia driver that works ## | |
| apt-add-repository ppa:ubuntu-x-swat/x-updates | |
| apt-get update |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| function countFiles { | |
| for i in $(pwd)/* ; do | |
| if [ -d "$i" ]; then | |
| echo $(find $i -type f | wc -l) $i | |
| fi | |
| done | |
| } |
This file contains hidden or 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
| maskEval = (src) -> | |
| whitelist = ['Math', 'performance'] | |
| names = [] | |
| for name of window | |
| if name not in whitelist | |
| names.push name | |
| names = names.join(',') | |
| return eval("(function(){var #{names};return #{src};})").call({}) |
This file contains hidden or 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
| decodingTable = new Uint8Array(256) | |
| for c, i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
| decodingTable[c.charCodeAt(0)] = i | |
| base64decode = (string) -> | |
| last = string[string.length-2...string.length] | |
| if last == '==' | |
| remainder = 2 | |
| else if last[1] == '=' | |
| remainder = 1 |
This file contains hidden or 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
| createState: (framebuffer, code) -> | |
| @fw.state | |
| cull: 'back' | |
| shader: [ | |
| fs.open('/pbr-tools.shader') | |
| fs.open('tools.shader') | |
| """essl | |
| fragment: | |
| void main(){ | |
| #{code} |
This file contains hidden or 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
| vec3 shade(vec3 color, float roughness, float metallness){ | |
| float fresnelFactor = 0.93; | |
| float specularFactor = 0.65; | |
| vec3 normal = normalize(vNormal); | |
| vec3 eyeDir = getEyeDir(); | |
| vec3 N = normal; | |
| vec3 V = -eyeDir; | |
| vec3 reflected = reflect(eyeDir, normal); |
NewerOlder