This file has been truncated, but you can view the full file.
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
{ | |
"Version": "0.1", | |
"Guid": { | |
"Guid": "00000000-0000-0000-0000-000000000000", | |
"DebugName": null | |
}, | |
"OwnerPlayerGuidString": "", | |
"OwnerPlayerId": 0, | |
"AuthorityPlayerId": 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
#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 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
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 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); |
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 lambertNDF(vec3 normal, vec3 dir, float roughness){ | |
float exponent = getLambertExponent(roughness*PI*0.5); | |
float lambert = max(0.0, dot(normal, dir)); | |
return pow(lambert, exponent); | |
} | |
float ggxNDF(vec3 normal, vec3 dir, float roughness){ | |
float a = roughness*roughness; | |
float d = max(0.000001, dot(normal, dir)); |
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 checkerSphere(){ | |
vec3 normal = normalize(vNormal); | |
float c = (acos(normal.y)/PI)*20.0; | |
float dc = fwidth(c); | |
c = mod(c, 2.0); | |
c = smoothstep(0.5-dc, 0.5+dc, c) - smoothstep(1.5-dc, 1.5+dc, c); | |
vec2 dir = normalize(normal.xz); | |
float t = (atan(dir.x, dir.y)/TAU)*40.0; | |
float dt = fwidth(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
vec2 pack16(float value){ | |
float f = clamp(value, 0.0, 1.0)*255.0; | |
float digitLow = fract(f); | |
float digitHigh = floor(f)/255.0; | |
return vec2(digitHigh, digitLow); | |
} | |
float unpack16(vec2 value){ | |
return value.x+value.y/255.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
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 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 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 | |
} |
NewerOlder