roavatar-renderer 1.9.5 → 1.9.6

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +36 -4
  2. package/dist/index.js +9582 -8800
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { EffectComposer } from 'postprocessing';
2
+ import { EffectPass } from 'postprocessing';
2
3
  import { N8AOPostPass } from 'n8ao';
3
4
  import { OrbitControls } from 'three/examples/jsm/Addons.js';
4
5
  import * as THREE from 'three';
@@ -1029,6 +1030,7 @@ declare class Cache_2<K, V> {
1029
1030
  map: Map<K, V>;
1030
1031
  lastAccess: Map<K, number>;
1031
1032
  maxEntries: number;
1033
+ onDelete?: (key: K) => void;
1032
1034
  constructor(maxEntries?: number);
1033
1035
  get(key: K): V | undefined;
1034
1036
  set(key: K, value: V): Cache_2<K, V>;
@@ -1431,6 +1433,11 @@ export declare function exposeAPI(): void;
1431
1433
  */
1432
1434
  export declare function exposeFLAGS(): void;
1433
1435
 
1436
+ /**
1437
+ * @category Exposer
1438
+ */
1439
+ export declare function exposeManagedTextures(): void;
1440
+
1434
1441
  /**
1435
1442
  * @category Exposer
1436
1443
  */
@@ -1640,7 +1647,7 @@ export declare const FLAGS: {
1640
1647
  RBF_PATCH_SHAPE_SAMPLES: number;
1641
1648
  /**forces vertex color to be white when false */
1642
1649
  USE_VERTEX_COLOR: boolean;
1643
- /**this enables bloom and ssao */
1650
+ /**despite its name it is not needed for post processing, all it does is automatically add post processing to RBXRenderer.firstScene*/
1644
1651
  USE_POST_PROCESSING: boolean;
1645
1652
  /**doubles render resolution when using post processing, makes anti-aliasing artifacts less visible but can be performance heavy on high resolutions */
1646
1653
  POST_PROCESSING_IS_DOUBLE_SIZE: boolean;
@@ -3541,7 +3548,9 @@ export declare class RBXRenderer {
3541
3548
  /**@deprecated This can only get the first renderScene's controls */
3542
3549
  static get controls(): OrbitControls<THREE.Camera> | undefined;
3543
3550
  static renderer?: THREE.WebGLRenderer;
3544
- /**Can be used to disable post processing even when FLAGS.USE_POST_PROCESSING = true */
3551
+ /**
3552
+ * @deprecated Renders wihout the effectComposer, which is no longer intended behavior as it leads to incorrect color management, instead create a new effect composer
3553
+ */
3545
3554
  static usePostProcessing: boolean;
3546
3555
  static resolution: [number, number];
3547
3556
  static backgroundColor: THREE.ColorRepresentation;
@@ -3573,7 +3582,12 @@ export declare class RBXRenderer {
3573
3582
  static boilerplateSetup(): Promise<void>;
3574
3583
  static showErrorHTML(): Promise<void>;
3575
3584
  static createLoadingIconHTML(): void;
3576
- static addScene(): RBXRendererScene;
3585
+ /**
3586
+ *
3587
+ * @param includeEffectComposer Only ever set this to false if you know you will be rendering to a RenderTarget (for example thumbnail generation), otherwise color handling is incorrect
3588
+ * @returns
3589
+ */
3590
+ static addScene(includeEffectComposer?: boolean): RBXRendererScene;
3577
3591
  /**Fully sets up renderer with scene, camera and frame rendering
3578
3592
  * @returns success
3579
3593
  */
@@ -3607,10 +3621,16 @@ export declare class RBXRenderer {
3607
3621
  * @deprecated use createEffectComposer()
3608
3622
  */
3609
3623
  static _createEffectComposer(renderScene?: RBXRendererScene): void;
3610
- static createEffectComposer(renderScene?: RBXRendererScene): void;
3624
+ /**
3625
+ * Scenes now always have an effectComposer, to add post processing use the dedicated function RBXRendererScene.addPostProcessing()
3626
+ *
3627
+ * This function disposes the original effectComposer and creates a new one, which adds a little overhead (probably) though it still adds post processing for backwards compatibility
3628
+ */
3629
+ static createEffectComposer(renderScene?: RBXRendererScene, includePostProcessing?: boolean): void;
3611
3630
  /**Removes an instance from the renderer */
3612
3631
  static removeInstance(instance: Instance, renderScene?: RBXRendererScene): void;
3613
3632
  static getRenderDescs(instance: Instance): RenderDesc[];
3633
+ private static _addSkeletonToResult;
3614
3634
  private static _addRenderDesc;
3615
3635
  /**Adds an instance to the renderer or updates it */
3616
3636
  static addInstance(instance: Instance, auth: Authentication, renderScene?: RBXRendererScene): void;
@@ -3654,8 +3674,15 @@ export declare class RBXRendererScene {
3654
3674
  controls: OrbitControls | undefined;
3655
3675
  shouldAnimate: boolean;
3656
3676
  destroyed: boolean;
3677
+ /**Used internally to determine color space output */
3678
+ isForRenderTarget: boolean;
3679
+ get colorSpace(): THREE.ColorSpace;
3657
3680
  n8aoPass: N8AOPostPass | undefined;
3681
+ effectPass: EffectPass | undefined;
3658
3682
  effectComposer: EffectComposer | undefined;
3683
+ hasPostProcessing: boolean;
3684
+ /**Used so MSAA will stay the same even when effectComposer is recreated */
3685
+ _msaa: number;
3659
3686
  scissor?: [number, number, number, number];
3660
3687
  viewport?: [number, number, number, number];
3661
3688
  addedInstances: Instance[];
@@ -3679,6 +3706,11 @@ export declare class RBXRendererScene {
3679
3706
  ambientLight?: THREE.AmbientLight;
3680
3707
  directionalLight?: THREE.DirectionalLight;
3681
3708
  directionalLight2?: THREE.DirectionalLight;
3709
+ /**Adds a SSAO pass to the effectComposer and replaces the current EffectPass with one that contains SSAO and Bloom */
3710
+ addPostProcessing(): void;
3711
+ /**Sets/gets MSAA level of the effectComposer, which is 4 by default */
3712
+ set msaa(value: number);
3713
+ get msaa(): number;
3682
3714
  /** Forces viewport to be within bounds */
3683
3715
  setRect(bounds: DOMRect): void;
3684
3716
  /** Makes viewport size 0x0, invisible */