@triforge/shader-core 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -2867,10 +2867,7 @@ vec3 _st_bump(float height, float strength, float distance, vec3 N) {
2867
2867
  }
2868
2868
  compileDefs() {
2869
2869
  if (this._method === "uv-offset") {
2870
- return [
2871
- "#extension GL_EXT_shader_texture_lod : enable",
2872
- `uniform sampler2D ${this._uniformName};`
2873
- ].join("\n");
2870
+ return `uniform sampler2D ${this._uniformName};`;
2874
2871
  }
2875
2872
  return _Bump.derivativeGlslFunction;
2876
2873
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Bump.d.ts","sourceRoot":"","sources":["../../../src/nodes/process/Bump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAIvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAChC,MAAM,CAAC,EAAI,YAAY,CAAA;IACvB,MAAM,CAAC,EAAI,YAAY,CAAA;IACvB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAO,YAAY,GAAG,WAAW,CAAA;IACxC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,MAAM,CAAC,EAAO,YAAY,CAAA;IAC1B,oFAAoF;IACpF,SAAS,CAAC,EAAI,YAAY,GAAG,MAAM,CAAA;IACnC,mEAAmE;IACnE,GAAG,CAAC,EAAU,YAAY,GAAG,MAAM,CAAA;CACpC;AAED;;;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mEAAmE;IACnE,GAAG,CAAC,EAAU,YAAY,GAAG,MAAM,CAAA;CACpC;AAED;;;;;;;;GAQG;AACH,qBAAa,IAAK,SAAQ,WAAW;IACnC,IAAI,QAAQ,WAAoB;IAKhC,MAAM,CAAC,mBAAmB,UAAO;IAEjC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,MAAM,CAAC,sBAAsB,SA8BxB;IAEL,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2E;IACnG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;gBAEhF,MAAM,GAAE,UAAe;IA+BnC,eAAe;IACf,gBAAgB;IAEhB,WAAW,IAAI,MAAM;IAWrB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAkDzC"}
@@ -50,14 +50,11 @@ export class Bump extends ProcessNode {
50
50
  getOutputSockets() { return this._outputs; }
51
51
  compileDefs() {
52
52
  if (this._method === 'uv-offset') {
53
- // The #extension line is hoisted to the very top of the fragment shader
54
- // (before `precision`) and deduplicated by CompileContext regardless of
55
- // where/how many times it's emitted here — see
56
- // CompileContext._extractExtensions. No local guard needed.
57
- return [
58
- '#extension GL_EXT_shader_texture_lod : enable',
59
- `uniform sampler2D ${this._uniformName};`,
60
- ].join('\n');
53
+ // No #extension needed: three.js's WebGL2/ESSL3 prefix already
54
+ // #defines texture2DLodEXT to the core textureLod() built-in, and that
55
+ // prefix is injected ahead of anything CompileContext could hoist this
56
+ // extension above — emitting it here breaks ESSL3's ordering rule.
57
+ return `uniform sampler2D ${this._uniformName};`;
61
58
  }
62
59
  return Bump.derivativeGlslFunction;
63
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triforge/shader-core",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "GLSL shader library for Three.js with Blender workflow",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",