Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pixi3d

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixi3d - npm Package Compare versions

Comparing version 0.9.2 to 0.9.3

types/material/material-render-type.d.ts

4

package.json
{
"name": "pixi3d",
"version": "0.9.2",
"version": "0.9.3",
"description": "The 3D renderer for PixiJS. Seamless integration with 2D applications.",

@@ -13,3 +13,3 @@ "main": "dist/pixi3d.js",

"build": "webpack --env.production",
"prepare": "npm run build",
"prepare": "rm -rf dist types && npm run build",
"serve": "webpack-dev-server --open --config examples/example.config.js",

@@ -16,0 +16,0 @@ "docs": "typedoc src/index.ts",

@@ -136,5 +136,5 @@ # Pixi3D

### Casting shadows
To enable lights to cast shadows, there are two different components needed. First is a shadow casting light, which wraps a light and gives it the ability to cast shadows. It has multiple settings for controlling the quality of the shadow, for example the size of the shadow texture and the softness of the shadow. Both directional and spot light types have support for casting shadows.
To enable lights to cast shadows, a shadow casting light is required. It wraps a light and gives it the ability to cast shadows. It has multiple settings for controlling the quality of the shadow, for example the size of the shadow texture and the softness of the shadow. Both directional and spot light types have support for casting shadows.
The second component needed, is the shadow render pass, which renders shadows using the shadow casting light. The shadow render pass is available on the standard pipeline (which is created and used by default). Finally, shadows must be enabled for an object to both receive and cast shadows.
The shadows must also be enabled (using the standard pipeline) for an object to both receive and cast shadows.

@@ -144,8 +144,7 @@ ```javascript

app.renderer, dirLight, 512, 15, 1, PIXI3D.ShadowQuality.medium)
let pipeline = PIXI3D.StandardPipeline.from(app.renderer)
pipeline.shadowRenderPass.lights.push(shadowCastingLight)
pipeline.shadowRenderPass.enableShadows(model, shadowCastingLight)
pipeline.enableShadows(model, shadowCastingLight)
```
*Creates a shadow casting light and adds it to the shadow render pass. Also enables shadows for the model to both receive and cast shadows.*
*Creates a shadow casting light and enables it for the model using the standard pipeline.*

@@ -152,0 +151,0 @@ ### 2D and 3D

@@ -41,4 +41,8 @@ import * as PIXI from "pixi.js";

* @param point Point to set.
* @param viewSize The size of the view when not rendering to the entire screen.
*/
screenToWorld(x: number, y: number, distance: number, point?: ObservablePoint3D): ObservablePoint3D | undefined;
screenToWorld(x: number, y: number, distance: number, point?: ObservablePoint3D, viewSize?: {
width: number;
height: number;
}): ObservablePoint3D | undefined;
/**

@@ -50,4 +54,8 @@ * Converts world coordinates to screen coordinates.

* @param point Point to set.
* @param viewSize The size of the view when not rendering to the entire screen.
*/
worldToScreen(x: number, y: number, z: number, point?: PIXI.Point): PIXI.Point;
worldToScreen(x: number, y: number, z: number, point?: PIXI.Point, viewSize?: {
width: number;
height: number;
}): PIXI.Point;
private _fieldOfView;

@@ -54,0 +62,0 @@ private _near;

@@ -30,3 +30,3 @@ import * as PIXI from "pixi.js";

static isEmbeddedResource(uri: string): boolean;
static getEmbeddedBuffer(value: string): ArrayBufferLike;
static getEmbeddedBuffer(value: string): ArrayBuffer | SharedArrayBuffer;
}

@@ -33,0 +33,0 @@ /**

import * as PIXI from "pixi.js";
import { Mesh3D } from "../mesh/mesh";
import { MaterialRenderType } from "./material-render-type";
import { MeshShader } from "../mesh/mesh-shader";

@@ -9,8 +10,19 @@ /**

protected _shader?: MeshShader;
/** State used to render a mesh. */
state: PIXI.State & {
culling: boolean;
clockwiseFrontFace: boolean;
depthTest: boolean;
};
/** Draw mode used to render a mesh. */
drawMode: PIXI.DRAW_MODES;
/** Value indicating if the material is transparent. */
transparent: boolean;
/** Render type used to render a mesh. This will determine in which order
* the material is being rendered compared to other materials. */
renderType: MaterialRenderType;
/** Value indicating if the material is double sided. */
doubleSided: boolean;
get doubleSided(): boolean;
set doubleSided(value: boolean);
/** Blend mode used to render a mesh. */
get blendMode(): PIXI.BLEND_MODES;
set blendMode(value: PIXI.BLEND_MODES);
/**

@@ -36,5 +48,4 @@ * Creates a shader used to render the specified mesh.

* @param renderer The renderer to use.
* @param state The state to use.
*/
render(mesh: Mesh3D, renderer: PIXI.Renderer, state?: PIXI.State): void;
render(mesh: Mesh3D, renderer: PIXI.Renderer): void;
}

@@ -25,3 +25,2 @@ import * as PIXI from "pixi.js";

private _metallicRoughnessTexture?;
private _transparent;
private _shadowCastingLight?;

@@ -66,4 +65,2 @@ private _lightsCount?;

set debugMode(value: StandardMaterialDebugMode | undefined);
get transparent(): boolean;
set transparent(value: boolean);
/**

@@ -103,5 +100,5 @@ * The camera used when rendering a mesh. If this value is not set, the main

static create(source: unknown): StandardMaterial;
render(mesh: Mesh3D, renderer: PIXI.Renderer, state?: PIXI.State): void;
render(mesh: Mesh3D, renderer: PIXI.Renderer): void;
createShader(mesh: Mesh3D, renderer: PIXI.Renderer): StandardShader | undefined;
updateUniforms(mesh: Mesh3D, shader: PIXI.Shader): void;
}

@@ -11,5 +11,2 @@ import * as PIXI from "pixi.js";

private _renderTexture?;
private _transparent;
private _default;
private _doubleSided;
/** The color (r,g,b,a) used for clearing the render texture. If this value is empty, the render texture will not be cleared. */

@@ -26,11 +23,4 @@ clearColor?: number[] | undefined;

constructor(renderer: PIXI.Renderer, name: string);
/**
* Creates a new material render pass using the specified renderer and adds it
* to the standard pipeline.
* @param renderer The renderer to use.
* @param name The name for the render pass.
*/
static addAsRenderPass(renderer: PIXI.Renderer, name: string): MaterialRenderPass;
clear(): void;
render(meshes: Mesh3D[]): void;
}
import * as PIXI from "pixi.js";
interface PostProcessingSpriteOptions {
export interface PostProcessingSpriteOptions {
width?: number;

@@ -26,2 +26,1 @@ height?: number;

}
export {};
import * as PIXI from "pixi.js";
import { MaterialRenderPass } from "./material-render-pass";
import { Mesh3D } from "../mesh/mesh";
import { ShadowRenderPass } from "../shadow/shadow-render-pass";
import { PostProcessingSprite, PostProcessingSpriteOptions } from "./post-processing-sprite";
import { Model } from "../model";
import { ShadowCastingLight } from "../shadow/shadow-casting-light";
import { RenderPass } from "./render-pass";
import { ShadowRenderPass } from "../shadow/shadow-render-pass";
/**

@@ -12,11 +15,6 @@ * The standard pipeline renders meshes using the specified render passes. The

renderer: PIXI.Renderer;
private _materialRenderPass;
private _renderPasses;
private _meshes;
private _shadowRenderPass;
/** The pass used for rendering shadows. */
get shadowRenderPass(): ShadowRenderPass;
/** The pass used for rendering materials. */
get materialRenderPass(): MaterialRenderPass;
/** The passes used for rendering the meshes. */
renderPasses: RenderPass[];
private _materialPass;
private _shadowPass;
/**

@@ -33,2 +31,18 @@ * Returns the standard pipeline from the specified renderer.

/**
* Adds a render pass.
* @param renderPass The pass to add.
*/
addRenderPass<T extends RenderPass>(renderPass: T): T;
/**
* Removes a render pass.
* @param renderPass The pass to remove.
*/
removeRenderPass(renderPass: RenderPass): void;
/**
* Creates a new post processing sprite and uses that to render to it's
* texture.
* @param options The options when creating the sprite.
*/
createPostProcessingSprite(options?: PostProcessingSpriteOptions): PostProcessingSprite;
/**
* Adds a mesh to be rendered.

@@ -43,5 +57,22 @@ * @param mesh Mesh to add.

/**
* Sorts the meshes for rendering order.
* Sorts the meshes by rendering order.
*/
sort(): void;
/** The pass used for rendering shadows. */
get shadowPass(): ShadowRenderPass;
/** The pass used for rendering materials. */
get materialPass(): MaterialRenderPass;
/**
* Enables shadows for the specified object. Adds the render pass to the
* specified object and enables the standard material to use the casting light.
* @param object The mesh or model to enable shadows for.
* @param light The shadow casting light to associate with the
* object when using the standard material.
*/
enableShadows(object: Mesh3D | Model, light?: ShadowCastingLight): void;
/**
* Disables shadows for the specified object.
* @param object The mesh or model to disable shadows for.
*/
disableShadows(object: Mesh3D | Model): void;
}

@@ -5,3 +5,2 @@ import * as PIXI from "pixi.js";

import { ShadowCastingLight } from "./shadow-casting-light";
import { Model } from "../model";
/**

@@ -13,6 +12,5 @@ * Pass used for rendering shadows.

name: string;
private _lights;
private _filter;
private _shadow;
/** An array of shadow casting lights. */
lights: ShadowCastingLight[];
/**

@@ -25,11 +23,13 @@ * Creates a new shadow render pass using the specified renderer.

/**
* Enables shadows for the specified object. Adds the render pass to the
* specified object and enables the standard material to use the casting light.
* @param object The mesh or model to enable shadows for.
* @param shadowCastingLight The shadow casting light to associate with the
* object when using the standard material.
* Adds a shadow casting light.
* @param shadowCastingLight The light to add.
*/
enableShadows(object: Mesh3D | Model, shadowCastingLight?: ShadowCastingLight): void;
addShadowCastingLight(shadowCastingLight: ShadowCastingLight): void;
/**
* Removes a shadow casting light.
* @param shadowCastingLight The light to remove.
*/
removeShadowCastingLight(shadowCastingLight: ShadowCastingLight): void;
clear(): void;
render(meshes: Mesh3D[]): void;
}
import * as PIXI from "pixi.js";
import { ShadowQuality } from "./shadow-quality";
export declare namespace ShadowTexture {
function create(renderer: PIXI.Renderer, size: number, quality: ShadowQuality): PIXI.RenderTexture;
function create(renderer: PIXI.Renderer, size: number, quality: ShadowQuality): any;
}

@@ -9,3 +9,2 @@ import * as PIXI from "pixi.js";

private _texture;
private _state;
get texture(): CubeMipmapTexture;

@@ -12,0 +11,0 @@ set texture(value: CubeMipmapTexture);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc