Skip to content

Commit

Permalink
update distribution files
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Shimada committed Jun 3, 2024
1 parent 697ff02 commit 8210c9f
Show file tree
Hide file tree
Showing 38 changed files with 1,579 additions and 539 deletions.
3 changes: 2 additions & 1 deletion dist/cjs/foundation/definitions/ShaderSemantics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export declare const ShaderSemantics: Readonly<{
AlphaCutoff: ShaderSemanticsEnum;
AlphaTexture: ShaderSemanticsEnum;
MakeOutputSrgb: ShaderSemanticsEnum;
FramebufferWidth: ShaderSemanticsEnum;
FramebufferSize: ShaderSemanticsEnum;
IsOutputHDR: ShaderSemanticsClass;
BaseColorTextureTransform: ShaderSemanticsClass;
BaseColorTextureRotation: ShaderSemanticsClass;
Expand Down Expand Up @@ -160,5 +160,6 @@ export declare const ShaderSemantics: Readonly<{
AnisotropyStrength: ShaderSemanticsClass;
AnisotropyRotation: ShaderSemanticsClass;
AnisotropyTexture: ShaderSemanticsClass;
EmissiveStrength: ShaderSemanticsClass;
}>;
export {};
21 changes: 21 additions & 0 deletions dist/cjs/foundation/helpers/ExpressionHelper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { RenderTargetTexture } from '../textures/RenderTargetTexture';
import { Expression } from '../renderer/Expression';
import { AbstractTexture } from '../textures/AbstractTexture';
declare function createBloomExpression({ textureToBloom, parameters: { luminanceCriterion, luminanceReduce, gaussianBlurLevelHighLuminance, gaussianKernelSize, gaussianVariance, synthesizeCoefficient, }, }: {
textureToBloom: AbstractTexture;
parameters: {
luminanceCriterion?: number;
luminanceReduce?: number;
gaussianBlurLevelHighLuminance?: number;
gaussianKernelSize?: number;
gaussianVariance?: number;
synthesizeCoefficient?: [number, number, number, number, number, number];
};
}): {
bloomExpression: Expression;
bloomedRenderTarget: RenderTargetTexture;
};
export declare const ExpressionHelper: Readonly<{
createBloomExpression: typeof createBloomExpression;
}>;
export {};
8 changes: 3 additions & 5 deletions dist/cjs/foundation/helpers/MaterialHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,17 @@ declare function createVarianceShadowMapDecodeClassicSingleMaterial({ additional
depthCameraComponent?: CameraComponent;
maxInstancesNumber?: Count;
}, encodedDepthRenderPasses: RenderPass[]): Material;
declare function createDetectHighLuminanceMaterial({ additionalName, colorAttachmentsNumber, maxInstancesNumber }: {
declare function createDetectHighLuminanceMaterial({ additionalName, maxInstancesNumber }: {
additionalName?: string | undefined;
colorAttachmentsNumber?: number | undefined;
maxInstancesNumber?: number | undefined;
} | undefined, HDRRenderPass: RenderPass): Material;
} | undefined, textureToDetectHighLuminance: AbstractTexture): Material;
declare function createGaussianBlurMaterial({ additionalName, maxInstancesNumber, noUseCameraTransform, }?: {
additionalName?: string | undefined;
maxInstancesNumber?: number | undefined;
noUseCameraTransform?: boolean | undefined;
}): Material;
declare function createSynthesizeHDRMaterial({ additionalName, targetRegionTexture, maxInstancesNumber, }: {
declare function createSynthesizeHDRMaterial({ additionalName, maxInstancesNumber, }: {
additionalName?: string;
targetRegionTexture?: AbstractTexture;
maxInstancesNumber?: Count;
}, synthesizeTextures: AbstractTexture[]): Material;
declare function createColorGradingUsingLUTsMaterial({ additionalName, colorAttachmentsNumber, uri, texture, maxInstancesNumber, }: {
Expand Down
1 change: 1 addition & 0 deletions dist/cjs/foundation/helpers/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './EntityHelper';
export * from './ExpressionHelper';
export * from './MaterialHelper';
export * from './MeshHelper';
export * from './RenderableHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { ShaderSemanticsEnum } from '../../definitions/ShaderSemantics';
import { RenderPass } from '../../renderer/RenderPass';
import { Count } from '../../../types/CommonTypes';
import { AbstractMaterialContent } from '../core/AbstractMaterialContent';
import { Material } from '../core/Material';
import { RenderingArgWebGL } from '../../../webgl/types/CommonTypes';
import { AbstractTexture } from '../../textures/AbstractTexture';
export declare class DetectHighLuminanceMaterialContent extends AbstractMaterialContent {
static LuminanceCriterion: ShaderSemanticsEnum;
static LuminanceReduce: ShaderSemanticsEnum;
static FramebufferWidth: ShaderSemanticsEnum;
constructor(HDRRenderPass: RenderPass, colorAttachmentsNumber: Count);
constructor(textureToDetectHighLuminance: AbstractTexture);
_setInternalSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare class SynthesizeHdrMaterialContent extends AbstractMaterialConten
static SynthesizeTexture3: ShaderSemanticsClass;
static SynthesizeTexture4: ShaderSemanticsClass;
static SynthesizeTexture5: ShaderSemanticsClass;
private existTargetRegion;
private textureNumber;
/**
* This material node uses for the glare effect and so on.
Expand All @@ -29,13 +28,12 @@ export declare class SynthesizeHdrMaterialContent extends AbstractMaterialConten
* @synthesizeTextures Textures to be synthesized. The shader supports up to six texture syntheses.
* @targetRegionTexture Texture to specify the area where the texture will be synthesized
*/
constructor(synthesizeTextures: AbstractTexture[], targetRegionTexture?: AbstractTexture);
constructor(synthesizeTextures: AbstractTexture[]);
_setInternalSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
firstTime: boolean;
args: RenderingArgWebGL;
}): void;
get existTargetRegionTexture(): boolean;
get synthesizeTextureNumber(): number;
}
5 changes: 5 additions & 0 deletions dist/cjs/foundation/renderer/RenderPass.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export declare class RenderPass extends RnObject {
toClearDepthBuffer: boolean;
toClearStencilBuffer: boolean;
isDepthTest: boolean;
/**
* depth write mask for primitives drawing
* false does not prevent depth clear.
*/
depthWriteMask: boolean;
clearColor: Vector4;
clearDepth: number;
clearStencil: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export declare class ForwardRenderPipeline extends RnObject {
private __width;
private __height;
private __isShadow;
private __isBloom;
private __isSimple;
private __shadowMapSize;
private __oFrame;
Expand All @@ -69,6 +70,7 @@ export declare class ForwardRenderPipeline extends RnObject {
private __expressions;
private __oGenerateMipmapsExpression;
private __depthMomentExpressions;
private __oBloomExpression;
private __oGammaExpression;
private __transparentOnlyExpressions;
private __oWebXRSystem;
Expand All @@ -82,8 +84,9 @@ export declare class ForwardRenderPipeline extends RnObject {
* @param canvasWidth - The width of the canvas.
* @param canvasHeight - The height of the canvas.
*/
setup(canvasWidth: number, canvasHeight: number, { isShadow, shadowMapSize, isSimple }?: {
setup(canvasWidth: number, canvasHeight: number, { isShadow, isBloom, shadowMapSize, isSimple }?: {
isShadow?: boolean | undefined;
isBloom?: boolean | undefined;
shadowMapSize?: number | undefined;
isSimple?: boolean | undefined;
}): Promise<Err<unknown, undefined> | Ok<unknown, unknown>>;
Expand Down
644 changes: 484 additions & 160 deletions dist/cjs/index.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/cjs/webgl/WebGLContextWrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export declare class WebGLContextWrapper {
readonly webgl1ExtCTEtc1?: WEBGL_compressed_texture_etc1;
readonly webgl1ExtCTBptc?: WEBGL_compressed_texture_bptc;
readonly webgl2ExtTFL?: OES_texture_float_linear;
readonly webgl2ExtTHFL?: OES_texture_half_float_linear;
readonly webgl2ExtTFA?: EXT_texture_filter_anisotropic;
readonly webgl2ExtCBF?: EXT_color_buffer_float;
readonly webgl2ExtCBHF?: EXT_color_buffer_half_float;
Expand Down
4 changes: 2 additions & 2 deletions dist/cjs/webgpu/WebGPUStrategyBasic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Primitive } from '../foundation/geometry/Primitive';
import { Material } from '../foundation/materials/core/Material';
import { CGAPIStrategy } from '../foundation/renderer/CGAPIStrategy';
import { RenderPass } from '../foundation/renderer/RenderPass';
import { Count, PrimitiveUID } from '../types/CommonTypes';
import { PrimitiveUID } from '../types/CommonTypes';
import { getShaderPropertyFunc } from '../foundation/definitions/ShaderSemantics';
export declare class WebGpuStrategyBasic implements CGAPIStrategy {
private static __instance;
Expand Down Expand Up @@ -35,7 +35,7 @@ export declare class WebGpuStrategyBasic implements CGAPIStrategy {
prerender(): void;
common_$render(primitiveUids: PrimitiveUID[], renderPass: RenderPass, renderPassTickCount: number): boolean;
private __renderWithoutBuffers;
renderInner(primitiveUid: PrimitiveUID, renderPass: RenderPass, renderPassTickCount: Count): boolean;
renderInner(primitiveUid: PrimitiveUID, renderPass: RenderPass, isOpaque: boolean): boolean;
private __createAndUpdateStorageBuffer;
private __createOrUpdateStorageBlendShapeBuffer;
private __updateUniformMorph;
Expand Down
4 changes: 2 additions & 2 deletions dist/cjs/webgpu/WebGpuResourceRepository.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ export declare class WebGpuResourceRepository extends CGAPIResourceRepository im
onError?: (message: string) => void;
}): number;
clearFrameBuffer(renderPass: RenderPass): void;
draw(primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number): void;
draw(primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, isOpaque: boolean): void;
private createRenderBundleEncoder;
private createRenderPassEncoder;
private __toClearRenderBundles;
executeRenderBundle(renderPass: RenderPass): boolean;
finishRenderBundleEncoder(renderPass: RenderPass): void;
getOrCreateRenderPipeline(renderPipelineId: string, primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, diffuseCubeMap?: CubeTexture, specularCubeMap?: CubeTexture): [GPURenderPipeline, boolean];
getOrCreateRenderPipeline(renderPipelineId: string, primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, isOpaque: boolean, diffuseCubeMap?: CubeTexture, specularCubeMap?: CubeTexture): [GPURenderPipeline, boolean];
flush(): void;
/**
* Create Cube Texture from image files.
Expand Down
3 changes: 2 additions & 1 deletion dist/esm/foundation/definitions/ShaderSemantics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export declare const ShaderSemantics: Readonly<{
AlphaCutoff: ShaderSemanticsEnum;
AlphaTexture: ShaderSemanticsEnum;
MakeOutputSrgb: ShaderSemanticsEnum;
FramebufferWidth: ShaderSemanticsEnum;
FramebufferSize: ShaderSemanticsEnum;
IsOutputHDR: ShaderSemanticsClass;
BaseColorTextureTransform: ShaderSemanticsClass;
BaseColorTextureRotation: ShaderSemanticsClass;
Expand Down Expand Up @@ -160,5 +160,6 @@ export declare const ShaderSemantics: Readonly<{
AnisotropyStrength: ShaderSemanticsClass;
AnisotropyRotation: ShaderSemanticsClass;
AnisotropyTexture: ShaderSemanticsClass;
EmissiveStrength: ShaderSemanticsClass;
}>;
export {};
21 changes: 21 additions & 0 deletions dist/esm/foundation/helpers/ExpressionHelper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { RenderTargetTexture } from '../textures/RenderTargetTexture';
import { Expression } from '../renderer/Expression';
import { AbstractTexture } from '../textures/AbstractTexture';
declare function createBloomExpression({ textureToBloom, parameters: { luminanceCriterion, luminanceReduce, gaussianBlurLevelHighLuminance, gaussianKernelSize, gaussianVariance, synthesizeCoefficient, }, }: {
textureToBloom: AbstractTexture;
parameters: {
luminanceCriterion?: number;
luminanceReduce?: number;
gaussianBlurLevelHighLuminance?: number;
gaussianKernelSize?: number;
gaussianVariance?: number;
synthesizeCoefficient?: [number, number, number, number, number, number];
};
}): {
bloomExpression: Expression;
bloomedRenderTarget: RenderTargetTexture;
};
export declare const ExpressionHelper: Readonly<{
createBloomExpression: typeof createBloomExpression;
}>;
export {};
8 changes: 3 additions & 5 deletions dist/esm/foundation/helpers/MaterialHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,17 @@ declare function createVarianceShadowMapDecodeClassicSingleMaterial({ additional
depthCameraComponent?: CameraComponent;
maxInstancesNumber?: Count;
}, encodedDepthRenderPasses: RenderPass[]): Material;
declare function createDetectHighLuminanceMaterial({ additionalName, colorAttachmentsNumber, maxInstancesNumber }: {
declare function createDetectHighLuminanceMaterial({ additionalName, maxInstancesNumber }: {
additionalName?: string | undefined;
colorAttachmentsNumber?: number | undefined;
maxInstancesNumber?: number | undefined;
} | undefined, HDRRenderPass: RenderPass): Material;
} | undefined, textureToDetectHighLuminance: AbstractTexture): Material;
declare function createGaussianBlurMaterial({ additionalName, maxInstancesNumber, noUseCameraTransform, }?: {
additionalName?: string | undefined;
maxInstancesNumber?: number | undefined;
noUseCameraTransform?: boolean | undefined;
}): Material;
declare function createSynthesizeHDRMaterial({ additionalName, targetRegionTexture, maxInstancesNumber, }: {
declare function createSynthesizeHDRMaterial({ additionalName, maxInstancesNumber, }: {
additionalName?: string;
targetRegionTexture?: AbstractTexture;
maxInstancesNumber?: Count;
}, synthesizeTextures: AbstractTexture[]): Material;
declare function createColorGradingUsingLUTsMaterial({ additionalName, colorAttachmentsNumber, uri, texture, maxInstancesNumber, }: {
Expand Down
1 change: 1 addition & 0 deletions dist/esm/foundation/helpers/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './EntityHelper';
export * from './ExpressionHelper';
export * from './MaterialHelper';
export * from './MeshHelper';
export * from './RenderableHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { ShaderSemanticsEnum } from '../../definitions/ShaderSemantics';
import { RenderPass } from '../../renderer/RenderPass';
import { Count } from '../../../types/CommonTypes';
import { AbstractMaterialContent } from '../core/AbstractMaterialContent';
import { Material } from '../core/Material';
import { RenderingArgWebGL } from '../../../webgl/types/CommonTypes';
import { AbstractTexture } from '../../textures/AbstractTexture';
export declare class DetectHighLuminanceMaterialContent extends AbstractMaterialContent {
static LuminanceCriterion: ShaderSemanticsEnum;
static LuminanceReduce: ShaderSemanticsEnum;
static FramebufferWidth: ShaderSemanticsEnum;
constructor(HDRRenderPass: RenderPass, colorAttachmentsNumber: Count);
constructor(textureToDetectHighLuminance: AbstractTexture);
_setInternalSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare class SynthesizeHdrMaterialContent extends AbstractMaterialConten
static SynthesizeTexture3: ShaderSemanticsClass;
static SynthesizeTexture4: ShaderSemanticsClass;
static SynthesizeTexture5: ShaderSemanticsClass;
private existTargetRegion;
private textureNumber;
/**
* This material node uses for the glare effect and so on.
Expand All @@ -29,13 +28,12 @@ export declare class SynthesizeHdrMaterialContent extends AbstractMaterialConten
* @synthesizeTextures Textures to be synthesized. The shader supports up to six texture syntheses.
* @targetRegionTexture Texture to specify the area where the texture will be synthesized
*/
constructor(synthesizeTextures: AbstractTexture[], targetRegionTexture?: AbstractTexture);
constructor(synthesizeTextures: AbstractTexture[]);
_setInternalSettingParametersToGpuWebGL({ material, shaderProgram, firstTime, args, }: {
material: Material;
shaderProgram: WebGLProgram;
firstTime: boolean;
args: RenderingArgWebGL;
}): void;
get existTargetRegionTexture(): boolean;
get synthesizeTextureNumber(): number;
}
5 changes: 5 additions & 0 deletions dist/esm/foundation/renderer/RenderPass.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export declare class RenderPass extends RnObject {
toClearDepthBuffer: boolean;
toClearStencilBuffer: boolean;
isDepthTest: boolean;
/**
* depth write mask for primitives drawing
* false does not prevent depth clear.
*/
depthWriteMask: boolean;
clearColor: Vector4;
clearDepth: number;
clearStencil: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export declare class ForwardRenderPipeline extends RnObject {
private __width;
private __height;
private __isShadow;
private __isBloom;
private __isSimple;
private __shadowMapSize;
private __oFrame;
Expand All @@ -69,6 +70,7 @@ export declare class ForwardRenderPipeline extends RnObject {
private __expressions;
private __oGenerateMipmapsExpression;
private __depthMomentExpressions;
private __oBloomExpression;
private __oGammaExpression;
private __transparentOnlyExpressions;
private __oWebXRSystem;
Expand All @@ -82,8 +84,9 @@ export declare class ForwardRenderPipeline extends RnObject {
* @param canvasWidth - The width of the canvas.
* @param canvasHeight - The height of the canvas.
*/
setup(canvasWidth: number, canvasHeight: number, { isShadow, shadowMapSize, isSimple }?: {
setup(canvasWidth: number, canvasHeight: number, { isShadow, isBloom, shadowMapSize, isSimple }?: {
isShadow?: boolean | undefined;
isBloom?: boolean | undefined;
shadowMapSize?: number | undefined;
isSimple?: boolean | undefined;
}): Promise<Err<unknown, undefined> | Ok<unknown, unknown>>;
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/esm/webgl/WebGLContextWrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export declare class WebGLContextWrapper {
readonly webgl1ExtCTEtc1?: WEBGL_compressed_texture_etc1;
readonly webgl1ExtCTBptc?: WEBGL_compressed_texture_bptc;
readonly webgl2ExtTFL?: OES_texture_float_linear;
readonly webgl2ExtTHFL?: OES_texture_half_float_linear;
readonly webgl2ExtTFA?: EXT_texture_filter_anisotropic;
readonly webgl2ExtCBF?: EXT_color_buffer_float;
readonly webgl2ExtCBHF?: EXT_color_buffer_half_float;
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/webgpu/WebGPUStrategyBasic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Primitive } from '../foundation/geometry/Primitive';
import { Material } from '../foundation/materials/core/Material';
import { CGAPIStrategy } from '../foundation/renderer/CGAPIStrategy';
import { RenderPass } from '../foundation/renderer/RenderPass';
import { Count, PrimitiveUID } from '../types/CommonTypes';
import { PrimitiveUID } from '../types/CommonTypes';
import { getShaderPropertyFunc } from '../foundation/definitions/ShaderSemantics';
export declare class WebGpuStrategyBasic implements CGAPIStrategy {
private static __instance;
Expand Down Expand Up @@ -35,7 +35,7 @@ export declare class WebGpuStrategyBasic implements CGAPIStrategy {
prerender(): void;
common_$render(primitiveUids: PrimitiveUID[], renderPass: RenderPass, renderPassTickCount: number): boolean;
private __renderWithoutBuffers;
renderInner(primitiveUid: PrimitiveUID, renderPass: RenderPass, renderPassTickCount: Count): boolean;
renderInner(primitiveUid: PrimitiveUID, renderPass: RenderPass, isOpaque: boolean): boolean;
private __createAndUpdateStorageBuffer;
private __createOrUpdateStorageBlendShapeBuffer;
private __updateUniformMorph;
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/webgpu/WebGpuResourceRepository.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ export declare class WebGpuResourceRepository extends CGAPIResourceRepository im
onError?: (message: string) => void;
}): number;
clearFrameBuffer(renderPass: RenderPass): void;
draw(primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number): void;
draw(primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, isOpaque: boolean): void;
private createRenderBundleEncoder;
private createRenderPassEncoder;
private __toClearRenderBundles;
executeRenderBundle(renderPass: RenderPass): boolean;
finishRenderBundleEncoder(renderPass: RenderPass): void;
getOrCreateRenderPipeline(renderPipelineId: string, primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, diffuseCubeMap?: CubeTexture, specularCubeMap?: CubeTexture): [GPURenderPipeline, boolean];
getOrCreateRenderPipeline(renderPipelineId: string, primitive: Primitive, material: Material, renderPass: RenderPass, cameraId: number, isOpaque: boolean, diffuseCubeMap?: CubeTexture, specularCubeMap?: CubeTexture): [GPURenderPipeline, boolean];
flush(): void;
/**
* Create Cube Texture from image files.
Expand Down
Loading

0 comments on commit 8210c9f

Please sign in to comment.