Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Preprocess and format the shader code.

License

NotificationsYou must be signed in to change notification settings

06wj/shaderViewer

Repository files navigation

Preprocess and format the shader code.

Feature

  • Preprocess directives,#define,#if,#elif,#endif,#if defined ...
  • Remove unused function, struct...
  • Format

Chrome Extensions

Chrome Extensions.crx
This extension can automatically detect the shader of the current page, then preprocess and show it in the panel.

Online Demo

https://06wj.github.io/shaderViewer/demo/

Module Usage

  • import modules

    const compiler = require('shader-compiler').compiler;const shake = require('shader-compiler').shake;
  • set theoptions

    const 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});

Dev

  • runnpm install to install dependencies
  • runnpm run dev to watch and develop
  • runnpm run build to build

License

MIT License

About

Preprocess and format the shader code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp