- Notifications
You must be signed in to change notification settings - Fork6
Preprocess and format the shader code.
License
NotificationsYou must be signed in to change notification settings
06wj/shaderViewer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Preprocess and format the shader code.
- Preprocess directives,
#define,#if,#elif,#endif,#if defined... - Remove unused function, struct...
- Format
Chrome Extensions.crx
This extension can automatically detect the shader of the current page, then preprocess and show it in the panel.
https://06wj.github.io/shaderViewer/demo/
import modules
const compiler = require('shader-compiler').compiler;const shake = require('shader-compiler').shake;set the
optionsconst options = { removeUnused: true, ignoreConstantError: true};preprocess the code
compiler.preprocess(code, function(error, result){ }, options);parse: preprocess => shake => format => result
compiler.parse(code, function(error, result){ }, options);parseHighlight: preprocess => shake => format => hightlight => result
compiler.parseHighlight(code, function(error, result){}, options);shake the code( code must be preprocessed )
shake.shake(code, {function:true, struct:true});
- run
npm installto install dependencies - run
npm run devto watch and develop - run
npm run buildto build
About
Preprocess and format the shader code.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
