You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,8 @@ void main() {
113
113
gl_FragColor = vec4(r, g, b, 1.0);
114
114
}
115
115
```
116
-
Note that compared to *shadertoy.com*`gl_FragCoord` replaces `fragCoord` and `gl_FragColor` replaces `fragColor` in the original demo. There is however a rudimentary support for inserting a trivial `void main()` which will delegate to a `void mainImage(out vec4, in vec2)` function. The definition of `void main()` is found by matching the regex `/void\s+main\s*\(\s*\)\s*\{/g`, thus if you require to define `void main()` in addition to the extension generating a definition you may define it as `void main(void)`. This might be necessary, for example, if your main definition would be processed away by the preprocessor and should thus not be picked up by the extension.
116
+
Note that compared to *shadertoy.com*`gl_FragCoord` replaces `fragCoord` and `gl_FragColor` replaces `fragColor` in the original demo. There is however a rudimentary support for inserting a trivial `void main()` which will delegate to a `void mainImage(out vec4, in vec2)` function. The definition of `void main()` is found by matching the regex `/void\s+main\s*\(\s*\)\s*\{/g`, thus if you require to define `void main()` in addition to the extension generating a definition you may define it as `void main(void)`. This might be necessary, for example, if your main definition would be processed away by the preprocessor and should thus not be picked up by the extension.
117
+
Since compatibility is achieved with a simple regex match it is only semi-reliable. If you only use shaders from *shadertoy.com* that do things such as defining `mainImage` via macros you may want to enable the "Shader Toy Strict Compatibility" setting, which disables the ability to use shaders that define `void main()` and only allows shaders that define `mainImage` in some way. Alternatively you can use `#StrictCompatibility` in your shader to have this feature localized to just that shader.
117
118
118
119
### Integration of _glslify_
119
120
You can enable support for _glslify_ in the settings, but because _glslify_ does not support line mappings pre and post its transform, line numbers on errors will unfortunately be disabled as long as you have the setting enabled. Using _glslify_ allows using a node.js-style module system for your shaders:
@@ -168,7 +169,10 @@ Contributions of any kind are welcome and encouraged.
168
169
169
170
### 0.10.12
170
171
* Fix attributions of several demo shaders,
171
-
* align default wrap mode with what is default on shader-toy.com
172
+
* align default wrap mode with what is default on shadertoy.com,
173
+
* allow control of filter and wrap mode for sampling other shaders,
174
+
* add a strict compatibility mode for shadertoy.com,
175
+
* add setting to skip all automatic recompilation and instead have a button in the webview for that.
0 commit comments