Skip to content

Instantly share code, notes, and snippets.

@pyalot
pyalot / gist:05f5007b6826342621a8
Created April 2, 2015 08:34
state assembly test
createState: (framebuffer, code) ->
@fw.state
cull: 'back'
shader: [
fs.open('/pbr-tools.shader')
fs.open('tools.shader')
"""essl
fragment:
void main(){
#{code}
@pyalot
pyalot / octahedral.shader
Last active January 25, 2025 08:06
octahedral mapping
#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.
{
"Version": "0.1",
"Guid": {
"Guid": "00000000-0000-0000-0000-000000000000",
"DebugName": null
},
"OwnerPlayerGuidString": "",
"OwnerPlayerId": 0,
"AuthorityPlayerId": 0,
"AssemblyOABConfig": {