Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIXI Web GL #2476

Merged
Merged
Show file tree
Hide file tree
Changes from 142 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
3cf31d0
VisionSource
JPMeehan Nov 13, 2023
1602a1f
Import TODO
JPMeehan Nov 13, 2023
3fcd5e5
Merge branch 'main' into 2074-VisionSource
JPMeehan Nov 15, 2023
a135d27
PointSource updates
JPMeehan Nov 15, 2023
ed10bd1
Deprecations
JPMeehan Nov 15, 2023
8dc3784
LightSource and GlobalLightSource
JPMeehan Nov 15, 2023
127baec
PointSource to v11
JPMeehan Nov 20, 2023
a5b1dea
MovementSource
JPMeehan Nov 20, 2023
d27762e
Rendered Source
JPMeehan Nov 20, 2023
5b7169a
Any option
JPMeehan Nov 20, 2023
f6351b4
LightSource
JPMeehan Nov 21, 2023
5875d68
Vision Source
JPMeehan Nov 21, 2023
1128df1
Declaration Rework
JPMeehan Nov 21, 2023
e14ef9d
SoundSource
JPMeehan Nov 21, 2023
fda9515
Merge branch 'main' into 2074-VisionSource
JPMeehan Nov 21, 2023
7928b58
Polygon updates
JPMeehan Nov 21, 2023
8bfd6c5
Update Client/Pixi/Perception to v11.315
JPMeehan Nov 21, 2023
7d5269c
Vision and Detection Mode
JPMeehan Nov 21, 2023
6195024
Color Manager
JPMeehan Nov 21, 2023
21288e3
Fog
JPMeehan Nov 21, 2023
821f01e
Perception Manager
JPMeehan Nov 21, 2023
a2a86d9
WeilerAthertonClipper
JPMeehan Nov 21, 2023
dc8877c
Bump @types/showdown from 2.0.5 to 2.0.6
dependabot[bot] Nov 22, 2023
79332e2
Bump @types/jquery from 3.5.28 to 3.5.29
dependabot[bot] Nov 22, 2023
a2ef471
Merge pull request #2455 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 22, 2023
4e41964
Merge pull request #2456 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 22, 2023
a5dc6a3
Resolved Clip Types
JPMeehan Nov 22, 2023
4cf39b2
Clockwise Sweep & other updates
JPMeehan Nov 22, 2023
3d8ad8d
Made VisionMode abstract
JPMeehan Nov 22, 2023
a1aa524
Type checking fixes
JPMeehan Nov 22, 2023
7d79c91
Merge branch 'main' into 2054-VisionMode
JPMeehan Nov 22, 2023
5d54d05
Merge branch 'main' into 2074-VisionSource
JPMeehan Nov 22, 2023
104c9d8
Fixed Linting Errors
JPMeehan Nov 22, 2023
622e7a0
PointSourcePolygon updates
JPMeehan Nov 22, 2023
dcda6bf
PIXI.Polygon Extensions
JPMeehan Nov 22, 2023
ca16d6d
PIXI.Circle
JPMeehan Nov 22, 2023
73f1ea7
Adjusted Options Typing
JPMeehan Nov 22, 2023
61c1ebb
Adjusted parameters
JPMeehan Nov 22, 2023
778de24
PIXI.Rectangle
JPMeehan Nov 22, 2023
db0fe9e
Index
JPMeehan Nov 22, 2023
9be0ed3
Merge branch '2074-VisionSource' into 2054-VisionMode
JPMeehan Nov 22, 2023
f280e94
Adjusted Vision.fov typing
JPMeehan Nov 24, 2023
127c35a
Merge branch '2074-VisionSource' into 2054-VisionMode
JPMeehan Nov 24, 2023
19488ce
Clockwise Sweep Fixes
JPMeehan Nov 24, 2023
55f23e5
Test updates
JPMeehan Nov 24, 2023
fecf5b3
Test Fixes, Type Problems
JPMeehan Nov 24, 2023
957cf60
pixi/core/interaction
JPMeehan Nov 24, 2023
718090a
Finishing client/pixi/core/interaction
JPMeehan Nov 24, 2023
e0f40c4
Pings
JPMeehan Nov 24, 2023
5c8d021
AlertPing
JPMeehan Nov 24, 2023
5832370
Fixed Typing
JPMeehan Nov 25, 2023
02c9d57
Update src/foundry/client/pixi/core/interaction/control-icon.d.ts
JPMeehan Nov 27, 2023
dff3ce1
Updated imports, made requested adjustments
JPMeehan Nov 27, 2023
bc372d7
More Touch-ups
JPMeehan Nov 27, 2023
a21790a
Bump @typescript-eslint/eslint-plugin from 6.12.0 to 6.13.0
dependabot[bot] Nov 28, 2023
1334ae0
Bump @typescript-eslint/parser from 6.12.0 to 6.13.0
dependabot[bot] Nov 28, 2023
78353c6
Merge pull request #2458 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 28, 2023
358cb24
Merge pull request #2459 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 28, 2023
0b8a71a
Bump @typescript-eslint/parser from 6.13.0 to 6.13.1
dependabot[bot] Nov 28, 2023
ba98594
Fixed testCollision return values
JPMeehan Nov 28, 2023
33c3391
Merge branch 'main' into 2054-VisionMode
JPMeehan Nov 28, 2023
7de4297
Graphics typefix
JPMeehan Nov 28, 2023
628614d
Event changeout
JPMeehan Nov 28, 2023
462e743
Temporary type fixing pending rewrites
JPMeehan Nov 28, 2023
8e01244
Bump @typescript-eslint/eslint-plugin from 6.13.0 to 6.13.1
dependabot[bot] Nov 29, 2023
1680b9a
Resolved dependency issue
JPMeehan Nov 29, 2023
55b663e
Adjusted Graphics to v11
JPMeehan Nov 29, 2023
db0e892
Fixed Graphics?
JPMeehan Nov 29, 2023
8a27487
Merge pull request #2460 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 29, 2023
5ed1b8a
Merge pull request #2462 from League-of-Foundry-Developers/dependabot…
kmoschcau Nov 29, 2023
43ab978
Further review adjustments
JPMeehan Nov 29, 2023
94c613d
PIXI/Core root js files
JPMeehan Nov 29, 2023
92e8e72
Bump eslint-config-prettier from 9.0.0 to 9.1.0
dependabot[bot] Dec 4, 2023
f16af56
Bump lint-staged from 15.1.0 to 15.2.0
dependabot[bot] Dec 4, 2023
0384c25
Merge pull request #2463 from League-of-Foundry-Developers/dependabot…
kmoschcau Dec 4, 2023
960e3fa
Merge pull request #2464 from League-of-Foundry-Developers/dependabot…
kmoschcau Dec 4, 2023
72a4431
Bump eslint from 8.54.0 to 8.55.0
dependabot[bot] Dec 4, 2023
4669bf2
Merge pull request #2465 from League-of-Foundry-Developers/dependabot…
kmoschcau Dec 4, 2023
e2c7918
Many fixes, including typing the light source
JPMeehan Dec 7, 2023
6ceef29
Attempted Render Flag Type Specification
JPMeehan Dec 7, 2023
8df4c56
More PointSourcePolygon updates
JPMeehan Dec 8, 2023
0b5087e
More VisionMode updates
JPMeehan Dec 8, 2023
168b0f9
Merge branch '2054-VisionMode' into PIXI-Core
JPMeehan Dec 8, 2023
8b94c70
Stuck on Full-Canvas-Container mixin
JPMeehan Dec 8, 2023
40e91fe
TODO: Sprite-Mesh, Unbound-Countainer
JPMeehan Dec 8, 2023
d6c37cd
Unbound Container. TODO: Sprite-Mesh
JPMeehan Dec 8, 2023
45c33db
PIXI/Core/Containers
JPMeehan Dec 11, 2023
f8837f4
Fixed typings on PIXI/Core container mixins, started on PIXI/Core/Shapes
JPMeehan Dec 11, 2023
ecae5ac
Fixed PolygonMesher file name
JPMeehan Dec 11, 2023
c246e0f
Finishing PIXI/Core/Shapes
JPMeehan Dec 11, 2023
7aafa38
Fixed Type Errors
JPMeehan Dec 11, 2023
4d50272
Removed import
JPMeehan Dec 11, 2023
f6e0f41
Merge branch 'main' into 2054-VisionMode
JPMeehan Dec 11, 2023
668f3b1
Merge branch '2054-VisionMode' into PIXI-Core
JPMeehan Dec 11, 2023
72320d0
Initialized PIXI/webgl
JPMeehan Dec 11, 2023
bc51505
Initialized PIXI/WebGL classes
JPMeehan Dec 11, 2023
7733b29
AbstractBaseShader to v11
JPMeehan Dec 12, 2023
26ee886
Adjusted typing with declared classes
JPMeehan Dec 12, 2023
b0b3efb
Initialized Helpers
JPMeehan Dec 12, 2023
b7ad2e3
PIXI WebGL Extensions
JPMeehan Dec 12, 2023
7e08bf5
WebGL Helpers
JPMeehan Dec 12, 2023
9a8c211
Reduced imports
JPMeehan Dec 12, 2023
2b1e1f9
Merge branch 'PIXI-Core' into PIXI-WebGL
JPMeehan Dec 12, 2023
865f05a
Lighting Shaders to v11
JPMeehan Dec 12, 2023
386a2dc
Vision Shaders to v11
JPMeehan Dec 13, 2023
ee8ddcb
AbstractWeatherShader
JPMeehan Dec 13, 2023
1de9038
WeatherShaderEffect
JPMeehan Dec 13, 2023
1ecd208
Redoing typings on AbstractBaseShader.create
JPMeehan Dec 13, 2023
992570b
Weather
JPMeehan Dec 13, 2023
5040b7c
Initial draft of Filters
JPMeehan Dec 14, 2023
c0e4060
Major improvements to Filters + completion of fxaa to v11
JPMeehan Dec 14, 2023
ffd8728
Fixed VisualEffectsMaskingFilter.CreateOptions
JPMeehan Dec 14, 2023
cc9c48f
Samplers
JPMeehan Dec 14, 2023
d1b5532
Increased specificity
JPMeehan Dec 14, 2023
ac0e4d6
Improved types
JPMeehan Dec 14, 2023
79320b0
Type improvements
JPMeehan Dec 14, 2023
b7ac207
Merge branch 'PIXI-Core' into PIXI-WebGL
JPMeehan Dec 14, 2023
b434b7f
Still-failing CreateOptions
JPMeehan Dec 14, 2023
d30e34f
Refined filter test
JPMeehan Dec 15, 2023
2c05429
Added remarks clarifying the overload
JPMeehan Dec 15, 2023
3fd34e7
Moved RenderFlagObject out of the global scope
JPMeehan Dec 18, 2023
99748ff
Added mixin type
JPMeehan Dec 18, 2023
fba2f10
Merge branch '2054-VisionMode' into PIXI-Core
JPMeehan Dec 18, 2023
f48b3b8
New Mixin util type
JPMeehan Dec 18, 2023
82f0b0f
Adjusted RenderFlagsMixin class
JPMeehan Dec 18, 2023
39afb0e
Merge branch 'PIXI-Core' into PIXI-WebGL
JPMeehan Dec 18, 2023
c632fd0
Adjusted shader mixins to use new Mixin type
JPMeehan Dec 18, 2023
015aeaf
Removed generic animation return value
JPMeehan Dec 18, 2023
cbd99f7
Significant cleanup
JPMeehan Dec 18, 2023
4cb52ce
Removed remaining generic references
JPMeehan Dec 18, 2023
0324870
Updated typings on render flags, condensed PIXI
JPMeehan Dec 18, 2023
a077039
Cleaned up return type
JPMeehan Dec 18, 2023
a8380ae
Some Unknown removal
JPMeehan Dec 18, 2023
174bd20
Fixed Uniform typing
JPMeehan Dec 19, 2023
64f38ec
Removed TODO
JPMeehan Dec 19, 2023
7f4060c
Merge branch '2054-VisionMode' into PIXI-Core
JPMeehan Dec 19, 2023
e94c50d
Fixing bad merge
JPMeehan Dec 19, 2023
209d16f
Merge branch 'PIXI-Core' into PIXI-WebGL
JPMeehan Dec 19, 2023
8d5fdf1
Merge branch 'canvas-updates' into PIXI-Core
JPMeehan Dec 19, 2023
6b2fdcb
Adjusted for comments
JPMeehan Dec 19, 2023
345aa81
Merge branch 'PIXI-Core' into PIXI-WebGL
JPMeehan Dec 21, 2023
db6c6ab
Cleaned up shader test
JPMeehan Dec 21, 2023
fa6aab4
Reviewed Changes
JPMeehan Dec 21, 2023
f129743
Merge branch 'canvas-updates' into PIXI-WebGL
JPMeehan Dec 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/foundry/client/pixi/core/containers/base-canvas-group.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export {};

declare class BaseCanvasMixinClass {
/** @defaultValue `true` */
sortableChildren: boolean;

/**
* The name of this canvas group
* @remarks Foundry marked as abstract
*/
static groupName: string;

/**
* If this canvas group should teardown non-layers children.
*/
static tearDownChildren: boolean;

/**
* A mapping of CanvasLayer classes which belong to this group.
* @remarks Default value defined by this.#createLayers, which pulls from CONFIG.Canvas.layers
*/
layers: Record<string, CanvasLayer>;

/** Draw the canvas group and all its component layers. */
draw(): Promise<void>;

/** Remove and destroy all layers from the base canvas. */
tearDown(options: InexactPartial<Record<string, unknown>>): Promise<void>;
}

declare global {
/**
* A mixin which decorates any container with base canvas common properties.
* @param ContainerClass - The parent Container class being mixed.
* @returns A ContainerClass subclass mixed with BaseCanvasMixin features.
*/
function BaseCanvasMixin<BaseClass extends typeof PIXI.Container>(
ContainerClass: BaseClass,
): Mixin<typeof BaseCanvasMixinClass, BaseClass>;
}
151 changes: 92 additions & 59 deletions src/foundry/client/pixi/core/containers/cached-container.d.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,97 @@
export {};

/**
* A special type of PIXI.Container which draws its contents to a cached RenderTexture.
* This is accomplished by overriding the Container#render method to draw to our own special RenderTexture.
*/
declare class CachedContainer extends PIXI.Container {
constructor();

/**
* The RenderTexture that is the render destination for the contents of this Container
*/
readonly renderTexture: PIXI.RenderTexture;

protected _onResize: () => void;

/**
* An object which stores a reference to the normal renderer target and source frame.
* We track this so we can restore them after rendering our cached texture.
*/
protected _backup: {
renderTexture: PIXI.RenderTexture | undefined;
sourceFrame: PIXI.Rectangle;
};

/**
* An RGBA array used to define the clear color of the RenderTexture
* @defaultValue `[0, 0, 0, 1]`
*/
clearColor: [r: number, g: number, b: number, a: number];

/**
* Should our Container also be displayed on screen, in addition to being drawn to the cached RenderTexture?
* @defaultValue `false`
*/
displayed: boolean;

/**
* A bound Sprite which uses this container's render texture
*/
get sprite(): PIXI.Sprite;

/** @internal */
protected _sprite: PIXI.Sprite | undefined;

destroy(options?: Parameters<PIXI.Container["destroy"]>[0]): ReturnType<PIXI.Container["destroy"]>;

render(renderer: Parameters<PIXI.Container["render"]>[0]): void;

/**
* Bind our cached RenderTexture to the Renderer, replacing the original target.
* @param renderer - The active canvas renderer
*/
protected _bind(renderer: PIXI.Renderer): void;

/**
* Remove our cached RenderTexture from the Renderer, re-binding the original target.
* @param renderer - The active canvas renderer
*/
protected _unbind(renderer: PIXI.Renderer): void;

/**
* Resize the cached RenderTexture when the dimensions or resolution of the Renderer have changed.
*/
protected _resize(renderer: PIXI.Renderer): void;
declare global {
class CachedContainer extends PIXI.Container {
/**
* Construct a CachedContainer.
* @param sprite - A specific sprite to bind to this CachedContainer and its renderTexture.
*/
constructor(sprite: PIXI.Sprite | SpriteMesh);

/**
* The texture configuration to use for this cached container
* @remarks Foundry marked as abstract
*/
static textureConfiguration: { multisample: PIXI.MSAA_QUALITY; scaleMode: PIXI.SCALE_MODES; format: PIXI.FORMATS };

/**
* An map of render textures, linked to their render function and an optional RGBA clear color.
*/
protected _renderPaths: Map<PIXI.RenderTexture, CachedContainer.RenderOptions>;

/**
* An RGBA array used to define the clear color of the RenderTexture
* @defaultValue `[0, 0, 0, 1]`
*/
clearColor: [r: number, g: number, b: number, a: number];

/**
* Should our Container also be displayed on screen, in addition to being drawn to the cached RenderTexture?
* @defaultValue `false`
*/
displayed: boolean;

/**
* The primary render texture bound to this cached container.
*/
get renderTexture(): PIXI.RenderTexture;

/**
* Set the alpha mode of the cached container render texture.
*/
set alphaMode(mode: PIXI.ALPHA_MODES);

/**
* A bound Sprite which uses this container's render texture
*/
get sprite(): PIXI.Sprite | SpriteMesh;

set sprite(sprite: PIXI.Sprite | SpriteMesh);

/**
* Create a render texture, provide a render method and an optional clear color.
* @param options - Optional parameters.
* @returns A reference to the created render texture.
*/
createRenderTexture(options?: CachedContainer.RenderOptions): PIXI.RenderTexture;

/**
* Remove a previously created render texture.
* @param renderTexture - The render texture to remove.
* @param destroy - Should the render texture be destroyed?
* (default: `true`)
*/
removeRenderTexture(renderTexture: PIXI.RenderTexture, destroy?: boolean): void;

/**
* Clear the cached container, removing its current contents.
* @param destroy - Tell children that we should destroy texture as well.
* @returns A reference to the cleared container for chaining.
*/
clear(destroy?: boolean): CachedContainer;

override destroy(options?: boolean | PIXI.IDestroyOptions): void;

override render(renderer: PIXI.Renderer): void;

/**
* Resize a render texture passed as a parameter with the renderer.
* @param renderer - The active canvas renderer.
* @param rt - The render texture to resize.
*/
static resizeRenderTexture(renderer: PIXI.Renderer, rt: PIXI.RenderTexture): void;
}

namespace CachedContainer {
type RenderOptions = {
/** Render function that will be called to render into the RT. */
renderFunction?: (renderer: PIXI.Renderer) => void;
/** An optional clear color to clear the RT before rendering into it. */
clearColor?: number[];
};
}
}
28 changes: 23 additions & 5 deletions src/foundry/client/pixi/core/containers/full-canvas-container.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
/**
* A specialized container where bounds are not computed with children, but with canvas dimensions.
*/
declare class FullCanvasContainer extends PIXI.Container {
override calculateBounds(): void;
export {};

declare class FullCanvasObject {
/** @remarks Overrides the mixed in class */
calculateBounds(): void;
}

declare global {
/**
* Augment any PIXI.DisplayObject to assume bounds that are always aligned with the full visible screen.
* The bounds of this container do not depend on its children but always fill the entire canvas.
* @param Base - Any PIXI DisplayObject subclass
* @returns The decorated subclass with full canvas bounds
*/
function FullCanvasObjectMixin<BaseClass extends typeof PIXI.DisplayObject>(
Base: BaseClass,
): Mixin<typeof FullCanvasObject, BaseClass>;

/**
* @deprecated since v11, will be removed in v13
* @remarks You are using the FullCanvasContainer class which has been deprecated in favor of a more flexible FullCanvasObjectMixin which can augment any PIXI.DisplayObject subclass.
*/
class FullCanvasContainer extends FullCanvasObjectMixin(PIXI.Container) {}
}
8 changes: 6 additions & 2 deletions src/foundry/client/pixi/core/containers/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import "./base-canvas-group";
import "./cached-container";
import "./quadtree";
import "./sampler-mesh";
import "./full-canvas-container";
import "./point-source-mesh";
import "./quad-mesh";
import "./quadtree";
import "./sprite-mesh";
import "./unbound-container";
55 changes: 55 additions & 0 deletions src/foundry/client/pixi/core/containers/point-source-mesh.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export {};

declare global {
/**
* Extension of a PIXI.Mesh, with the capabilities to provide a snapshot of the framebuffer.
*/
class PointSourceMesh extends PIXI.Mesh {
/**
* To store the previous blend mode of the last renderer PointSourceMesh.
*/
protected static _priorBlendMode: PIXI.BLEND_MODES;

/**
* The current texture used by the mesh.
*/
protected static _currentTexture: PIXI.Texture;

/**
* The transform world ID of the bounds.
* @defaultValue `-1`
*/
_worldID: number;

/**
* The geometry update ID of the bounds.
* @defaultValue `-1`
*/
_updateID: number;

override get geometry(): PIXI.Geometry;

set geometry(value: PIXI.Geometry);

/** @throws You can't add children to a PointSourceMesh. */
override addChild(): never;

/** @throws You can't add children to a PointSourceMesh. */
override addChildAt(): never;

/**
* @throws You can't add children to a PointSourceMesh.
* @privateRemarks This method is meant to be an override, but the PIXI.Mesh class does not have an addChildren() method
*/
addChildren(): never;

protected override _render(renderer: PIXI.Renderer): void;

override calculateBounds(): void;

protected override _calculateBounds(): void;

/** The local bounds need to be drawn from the underlying geometry. */
override getLocalBounds(rect?: PIXI.Rectangle | undefined): PIXI.Rectangle;
}
}
66 changes: 66 additions & 0 deletions src/foundry/client/pixi/core/containers/quad-mesh.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
export {};

declare global {
/**
* A basic rectangular mesh with a shader only. Does not natively handle textures (but a bound shader can).
* Bounds calculations are simplified and the geometry does not need to handle texture coords.
*/
class QuadMesh extends PIXI.Container {
/**
* @param shaderCls - The shader class to use.
*/
constructor(shaderCls: AbstractBaseShader);

/**
* The shader.
*/
shader: BaseSamplerShader;

/**
* The state.
*/
state: PIXI.State;

/**
* Assigned geometry to this mesh.
* We need to handle the refCount.
*/
get geometry(): PIXI.Geometry;

set geometry(value: PIXI.Geometry);

/**
* Assigned blend mode to this mesh.
*/
get blendMode(): PIXI.BLEND_MODES;

set blendMode(value: PIXI.BLEND_MODES);

/**
* Initialize shader based on the shader class type.
* @param shaderCls - Shader class used. Must inherit from AbstractBaseShader.
*/
setShaderClass(shaderCls: typeof AbstractBaseShader): void;

protected override _render(_renderer: PIXI.Renderer): void;

override get width(): number;
override set width(value: number);

protected _width: number;

get height(): number;
set height(value: number);

protected _height: number;

protected override _calculateBounds(): void;

/**
* Tests if a point is inside this QuadMesh.
*/
containsPoint(point: PIXI.IPointData): boolean;

override destroy(options?: boolean | PIXI.IDestroyOptions | undefined): void;
}
}
Loading
Loading