BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/three/examples/jsm/transpiler
Run
Logout
Edit File
Size: 1010 B
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/three/examples/jsm/transpiler/ShaderToyDecoder.js
Text
Base64
import { Return, VariableDeclaration, Accessor } from './AST.js'; import GLSLDecoder from './GLSLDecoder.js'; class ShaderToyDecoder extends GLSLDecoder { constructor() { super(); this.addPolyfill( 'iTime', 'float iTime = time;' ); this.addPolyfill( 'iResolution', 'vec2 iResolution = screenSize;' ); this.addPolyfill( 'fragCoord', 'vec3 fragCoord = vec3( screenCoordinate.x, screenSize.y - screenCoordinate.y, screenCoordinate.z );' ); } parseFunction() { const node = super.parseFunction(); if ( node.name === 'mainImage' ) { node.params = []; // remove default parameters node.type = 'vec4'; node.layout = false; // for now const fragColor = new Accessor( 'fragColor' ); for ( const subNode of node.body ) { if ( subNode.isReturn ) { subNode.value = fragColor; } } node.body.unshift( new VariableDeclaration( 'vec4', 'fragColor' ) ); node.body.push( new Return( fragColor ) ); } return node; } } export default ShaderToyDecoder;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AST.js
3.11 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
GLSLDecoder.js
18.60 KB
lrw-r--r--
2025-03-28 11:04:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ShaderToyDecoder.js
1010 B
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Transpiler.js
228 B
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TSLEncoder.js
14.99 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).