racz16 / WebGL-GLSL-Editor

WebGL GLSL shader editor extension for Visual Studio Code.
Other
100 stars 12 forks source link

[Feature]: Support for extension like .glsl3, frag3, etc #65

Open airfortech opened 1 month ago

airfortech commented 1 month ago

Feature details

There are many problems with Three.js using glsl3 and plugin, f.e. you cant just add # version 300 es to shader code, because it throws error:

1: #define SHADER_TYPE RawShaderMaterial
  2: #define SHADER_NAME 
> 3: # version 300 es

Implementation just adds first line of code as third. Without # version 300 es i cant use 3.0 syntax. Workaround would be adding support for extensions like .glsl3, .frag3, .vert3, so when using it, plugin would know shader is using 3.0 without neccessary to put # version 300 es in shader file allowing to use 3.0 syntax.

Other workaround is recognition of // # version 300 es as # version 300 es