sparcoon 0.7.0 → 0.7.1

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.
@@ -4,7 +4,7 @@ import type { FXNodeBlending } from "../../nodes/blending/FXNodeBlending";
4
4
  import { FXNodeColor } from "../../nodes/color/FXNodeColor";
5
5
  import type { FXNodeNormal } from "../../nodes/normal/FXNodeNormal";
6
6
  import { FXNodeTexture } from "../../nodes/texture/FXNodeTexture";
7
- import { FXBlending } from "../FXMaterial/FXMaterial";
7
+ import type { FXBlending } from "../FXMaterial/FXMaterial";
8
8
  export interface FXScatterUniforms {
9
9
  u_ScatterTint: {
10
10
  value: Color;
@@ -4,7 +4,6 @@ import { FXNodeColor } from '../../nodes/color/FXNodeColor.js';
4
4
  import { CURRENT_EXPRESSION_VALUE_PLACEHOLDER } from '../../nodes/FXNode.js';
5
5
  import { FXNodeTexture } from '../../nodes/texture/FXNodeTexture.js';
6
6
  import { buildAlbedoAndBlendingCode } from '../FXMaterial/FXBlending.Internal.js';
7
- import { FXBlending } from '../FXMaterial/FXMaterial.js';
8
7
 
9
8
  /**
10
9
  * Wraps every `getShadow(...)` call in the shader source with
@@ -258,17 +257,18 @@ function buildFXDiffuseMaterial(varyings, blending, useAlphaHashing, alphaTest,
258
257
  fragmentShader = fragmentShader.replace("#include <premultiplied_alpha_fragment>", albedoCode.premultChunk);
259
258
  shader.fragmentShader = fragmentPreamble + "\n" + fragmentShader;
260
259
  };
261
- const scatterKey = useScatter ? `scatter(${scatterUniforms.u_ScatterPower.value})` : "no-scatter";
262
- const shadowKey = useShadowSensitivity ? "shadow-sens" : "no-shadow-sens";
263
- material.customProgramCacheKey = () => [
264
- "fx",
265
- albedoNodes.map((node) => node.cacheKey).join("-") || "none",
266
- normalNodes.map((node) => node.cacheKey).join("-") || "none",
267
- emissionNodes.map((node) => node.cacheKey).join("-") || "none",
268
- FXBlending[blending],
269
- scatterKey,
270
- shadowKey,
271
- ].join("_");
260
+ // const scatterKey = useScatter ? `scatter(${scatterUniforms.u_ScatterPower.value})` : "no-scatter";
261
+ // const shadowKey = useShadowSensitivity ? "shadow-sens" : "no-shadow-sens";
262
+ // material.customProgramCacheKey = (): string =>
263
+ // [
264
+ // "fx",
265
+ // albedoNodes.map((node) => node.cacheKey).join("-") || "none",
266
+ // normalNodes.map((node) => node.cacheKey).join("-") || "none",
267
+ // emissionNodes.map((node) => node.cacheKey).join("-") || "none",
268
+ // FXBlending[blending],
269
+ // scatterKey,
270
+ // shadowKey,
271
+ // ].join("_");
272
272
  return material;
273
273
  }
274
274
 
@@ -137,7 +137,8 @@ function buildDepthMaterial(albedoNodes, depthAlphaTest, useDepthAlphaHash, useS
137
137
  }
138
138
  shader.fragmentShader = fragmentPreamble + "\n" + fragmentShader;
139
139
  };
140
- material.customProgramCacheKey = () => `fx-depth-${useDepthAlphaHash ? "alphaHash" : "alphaTest"}-${useSphericalDepth ? "spherical" : "flat"}-${depthNodes.map((node) => node.cacheKey).join("-") || "none"}`;
140
+ // material.customProgramCacheKey = (): string =>
141
+ // `fx-depth-${useDepthAlphaHash ? "alphaHash" : "alphaTest"}-${useSphericalDepth ? "spherical" : "flat"}-${depthNodes.map((node) => node.cacheKey).join("-") || "none"}`;
141
142
  return material;
142
143
  }
143
144
 
@@ -168,7 +168,8 @@ function buildDistanceMaterial(albedoNodes, distanceAlphaTest, useDistanceAlphaH
168
168
  }
169
169
  shader.fragmentShader = fragmentPreamble + "\n" + fragmentShader;
170
170
  };
171
- material.customProgramCacheKey = () => `fx-distance-${useDistanceAlphaHash ? "alphaHash" : "alphaTest"}-${useSphericalDepth ? "spherical" : "flat"}-${distanceNodes.map((node) => node.cacheKey).join("-") || "none"}`;
171
+ // material.customProgramCacheKey = (): string =>
172
+ // `fx-distance-${useDistanceAlphaHash ? "alphaHash" : "alphaTest"}-${useSphericalDepth ? "spherical" : "flat"}-${distanceNodes.map((node) => node.cacheKey).join("-") || "none"}`;
172
173
  return material;
173
174
  }
174
175
 
@@ -3,5 +3,5 @@ import type { GLTypeInfo } from "../../instancedParticle/shared";
3
3
  import type { FXNodeBlending } from "../../nodes/blending/FXNodeBlending";
4
4
  import type { FXNodeColor } from "../../nodes/color/FXNodeColor";
5
5
  import type { FXNodeTexture } from "../../nodes/texture/FXNodeTexture";
6
- import { FXBlending } from "../FXMaterial/FXMaterial";
6
+ import type { FXBlending } from "../FXMaterial/FXMaterial";
7
7
  export declare function buildFXUnlitMaterial(varyings: Record<string, GLTypeInfo>, blending: FXBlending, useAlphaHashing: boolean, alphaTest: number, albedoNodes: readonly (FXNodeColor | FXNodeTexture | FXNodeBlending)[]): MeshBasicMaterial;
@@ -1,7 +1,6 @@
1
1
  import { MeshBasicMaterial, DoubleSide, NormalBlending } from 'three';
2
2
  import { PARTICLE_DEFINES } from '../../miscellaneous/miscellaneous.js';
3
3
  import { buildAlbedoAndBlendingCode } from '../FXMaterial/FXBlending.Internal.js';
4
- import { FXBlending } from '../FXMaterial/FXMaterial.js';
5
4
 
6
5
  function buildFXUnlitMaterial(varyings, blending, useAlphaHashing, alphaTest, albedoNodes) {
7
6
  const attributeDeclarations = [];
@@ -92,7 +91,10 @@ function buildFXUnlitMaterial(varyings, blending, useAlphaHashing, alphaTest, al
92
91
  fragmentShader = fragmentShader.replace("#include <premultiplied_alpha_fragment>", albedoCode.premultChunk);
93
92
  shader.fragmentShader = fragmentPreamble + "\n" + fragmentShader;
94
93
  };
95
- material.customProgramCacheKey = () => ["fx-unlit", albedoNodes.map((node) => node.cacheKey).join("-") || "none", FXBlending[blending]].join("_");
94
+ // material.customProgramCacheKey = (): string =>
95
+ // ["fx-unlit", albedoNodes.map((node) => node.cacheKey).join("-") || "none", FXBlending[blending]].join(
96
+ // "_",
97
+ // );
96
98
  return material;
97
99
  }
98
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparcoon",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Instanced-mesh particle system for Three.js.",
5
5
  "keywords": [
6
6
  "particles",