Skip to content

Commit

Permalink
add register-shader-chunks to exports v 0.12.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchemist0823 committed Jun 9, 2024
1 parent c73902b commit 4dbfbc5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "three.quarks",
"version": "0.12.3",
"version": "0.12.4",
"description": "A General-Purpose Particle System for three.js",
"type": "module",
"types": "./dist/types/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import registerShaderChunks from "./shaders/chunks/register-shader-chunks";
import {registerShaderChunks} from './shaders';

export * from './ParticleEmitter';
export * from './Particle';
Expand All @@ -18,7 +18,8 @@ export * from './functions/';
export * from './behaviors/';
export * from './sequencers/';
export * from './nodes/';
export * from './shaders/';

registerShaderChunks();
// remove this line if you have pro license
console.log('%c Particle system powered by three.quarks. https://quarks.art/', 'font-size: 16px; font-weight: bold;');
console.log('%c Particle system powered by three.quarks. https://quarks.art/', 'font-size: 14px; font-weight: bold;');
1 change: 1 addition & 0 deletions src/shaders/chunks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './register-shader-chunks';
37 changes: 18 additions & 19 deletions src/shaders/chunks/register-shader-chunks.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { ShaderChunk as ShaderChunkReadOnly } from "three";
import soft_fragment from "./soft_fragment.glsl";
import soft_pars_fragment from "./soft_pars_fragment.glsl";
import soft_pars_vertex from "./soft_pars_vertex.glsl";
import soft_vertex from "./soft_vertex.glsl";
import {ShaderChunk as ShaderChunkReadOnly} from 'three';
import soft_fragment from './soft_fragment.glsl';
import soft_pars_fragment from './soft_pars_fragment.glsl';
import soft_pars_vertex from './soft_pars_vertex.glsl';
import soft_vertex from './soft_vertex.glsl';

import tile_fragment from "./tile_fragment.glsl";
import tile_pars_fragment from "./tile_pars_fragment.glsl";
import tile_pars_vertex from "./tile_pars_vertex.glsl";
import tile_vertex from "./tile_vertex.glsl";
import tile_fragment from './tile_fragment.glsl';
import tile_pars_fragment from './tile_pars_fragment.glsl';
import tile_pars_vertex from './tile_pars_vertex.glsl';
import tile_vertex from './tile_vertex.glsl';

const ShaderChunk = ShaderChunkReadOnly as Record<string, string>;

export default function registerShaderChunks() {
ShaderChunk["tile_pars_vertex"] = tile_pars_vertex;
ShaderChunk["tile_vertex"] = tile_vertex;
export function registerShaderChunks() {
ShaderChunk['tile_pars_vertex'] = tile_pars_vertex;
ShaderChunk['tile_vertex'] = tile_vertex;

ShaderChunk["tile_pars_fragment"] = tile_pars_fragment;
ShaderChunk["tile_fragment"] = tile_fragment;
ShaderChunk['tile_pars_fragment'] = tile_pars_fragment;
ShaderChunk['tile_fragment'] = tile_fragment;

ShaderChunk["soft_pars_vertex"] = soft_pars_vertex;
ShaderChunk["soft_vertex"] = soft_vertex;
ShaderChunk['soft_pars_vertex'] = soft_pars_vertex;
ShaderChunk['soft_vertex'] = soft_vertex;

ShaderChunk["soft_pars_fragment"] = soft_pars_fragment;
ShaderChunk["soft_fragment"] = soft_fragment;
ShaderChunk['soft_pars_fragment'] = soft_pars_fragment;
ShaderChunk['soft_fragment'] = soft_fragment;
}

1 change: 1 addition & 0 deletions src/shaders/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './chunks';

0 comments on commit 4dbfbc5

Please sign in to comment.