@aura3d/rendering 1.3.3 → 1.4.1
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.
- package/dist/ForwardPass.js +7 -1
- package/dist/ForwardPass.js.map +1 -1
- package/dist/MorphTarget.d.ts +1 -0
- package/dist/MorphTarget.d.ts.map +1 -1
- package/dist/MorphTarget.js.map +1 -1
- package/dist/Renderer.js +7 -1
- package/dist/Renderer.js.map +1 -1
- package/package.json +38 -4
- package/src/ArchitecturalLightingFixtures.ts +0 -241
- package/src/ArchitecturalMaterialCatalog.ts +0 -130
- package/src/ArchitecturalMeasurementFixtures.ts +0 -155
- package/src/BRDFLut.ts +0 -47
- package/src/CameraFraming.ts +0 -200
- package/src/CanonicalSceneFixtures.ts +0 -95
- package/src/CascadedShadowMaps.ts +0 -449
- package/src/ColorManagement.ts +0 -127
- package/src/CullingFixtures.ts +0 -280
- package/src/DecalGeometry.ts +0 -26
- package/src/DepthPass.ts +0 -110
- package/src/EnvironmentBackgroundPass.ts +0 -194
- package/src/EnvironmentBackgroundResources.ts +0 -309
- package/src/EnvironmentLighting.ts +0 -96
- package/src/EnvironmentMapResources.ts +0 -1026
- package/src/EnvironmentPipeline.ts +0 -69
- package/src/EnvironmentPlatform.ts +0 -1306
- package/src/EnvironmentPreset.ts +0 -155
- package/src/Exposure.ts +0 -66
- package/src/ExternalParityRenderPreset.ts +0 -725
- package/src/ForwardPass.ts +0 -1663
- package/src/FrameVisualMetrics.ts +0 -301
- package/src/Geometry.ts +0 -461
- package/src/GeometryPrimitives.ts +0 -2
- package/src/HDRRenderPipeline.ts +0 -94
- package/src/IBL.ts +0 -86
- package/src/IndexBuffer.ts +0 -57
- package/src/InstancedPBRMaterial.ts +0 -186
- package/src/InstancedUnlitMaterial.ts +0 -60
- package/src/Instancing.ts +0 -19
- package/src/LightCollector.ts +0 -82
- package/src/LightUniforms.ts +0 -47
- package/src/LightingDebug.ts +0 -80
- package/src/LightingDefaults.ts +0 -79
- package/src/LightingRig.ts +0 -301
- package/src/LineGeometry.ts +0 -2
- package/src/Material.ts +0 -209
- package/src/MaterialBinding.ts +0 -131
- package/src/MaterialInstance.ts +0 -59
- package/src/MaterialPresets.ts +0 -272
- package/src/MorphTarget.ts +0 -123
- package/src/MorphTargetPlan.ts +0 -178
- package/src/MorphUnlitMaterial.ts +0 -60
- package/src/NormalMappedPBRMaterial.ts +0 -188
- package/src/OceanFixtures.ts +0 -318
- package/src/PBRLightingDefaults.ts +0 -12
- package/src/PBRMaterial.ts +0 -442
- package/src/PMREM.ts +0 -53
- package/src/PbrReference.ts +0 -681
- package/src/PostProcessPass.ts +0 -2507
- package/src/ProceduralTextureFixtures.ts +0 -393
- package/src/ProductTurntableFixtures.ts +0 -815
- package/src/Raycaster.ts +0 -21
- package/src/ReflectionProbe.ts +0 -13
- package/src/ReflectionSurfaces.ts +0 -219
- package/src/RenderBackend.ts +0 -43
- package/src/RenderDebugViews.ts +0 -138
- package/src/RenderDevice.ts +0 -836
- package/src/RenderGraph.ts +0 -194
- package/src/RenderPass.ts +0 -27
- package/src/RenderPipeline.ts +0 -101
- package/src/RenderQueue.ts +0 -12
- package/src/RenderState.ts +0 -12
- package/src/Renderer.ts +0 -2626
- package/src/RendererDebugOverlay.ts +0 -80
- package/src/RendererFeatureGates.ts +0 -150
- package/src/RendererPostprocessPlan.ts +0 -279
- package/src/RendererTiming.ts +0 -251
- package/src/RendererVisualPipelineReport.ts +0 -836
- package/src/ResourceLifecycle.ts +0 -21
- package/src/Sampler.ts +0 -37
- package/src/SceneOptimization.ts +0 -518
- package/src/ShaderChunks.ts +0 -393
- package/src/ShaderLibrary.ts +0 -2766
- package/src/ShaderModule.ts +0 -36
- package/src/ShaderPreprocessor.ts +0 -260
- package/src/ShaderReflection.ts +0 -201
- package/src/ShadowMap.ts +0 -237
- package/src/ShadowPass.ts +0 -198
- package/src/ShadowProjection.ts +0 -115
- package/src/SkinnedLitMaterial.ts +0 -397
- package/src/SkinnedUnlitMaterial.ts +0 -63
- package/src/SkinningBounds.ts +0 -131
- package/src/SpaceEnvironmentFixtures.ts +0 -200
- package/src/SpriteGeometry.ts +0 -21
- package/src/StereoCameraRig.ts +0 -127
- package/src/StereoEffects.ts +0 -274
- package/src/TerrainFixtures.ts +0 -180
- package/src/Texture.ts +0 -307
- package/src/TextureBinding.ts +0 -91
- package/src/TexturedPBRMaterial.ts +0 -1112
- package/src/TexturedUnlitMaterial.ts +0 -67
- package/src/ToneMapping.ts +0 -105
- package/src/UniformBinder.ts +0 -16
- package/src/UniformLayout.ts +0 -129
- package/src/UnlitMaterial.ts +0 -75
- package/src/VegetationFixtures.ts +0 -314
- package/src/VertexBuffer.ts +0 -120
- package/src/VertexFormat.ts +0 -171
- package/src/VoxelWorldFixtures.ts +0 -280
- package/src/WeatherFixtures.ts +0 -223
- package/src/WebGL2Device.ts +0 -2280
- package/src/WebGL2StateCache.ts +0 -330
- package/src/WebGPUDevice.ts +0 -2877
- package/src/WebGPURenderToTextureProof.ts +0 -139
- package/src/advanced-runtime/AdvancedRenderer.ts +0 -73
- package/src/advanced-runtime/index.ts +0 -9
- package/src/animation/AnimationMaterialStyle.ts +0 -32
- package/src/animation/AnimationRenderPreset.ts +0 -45
- package/src/animation/AnimationToonMaterial.ts +0 -387
- package/src/animation/AnimationVisualQuality.ts +0 -71
- package/src/animation/applyAnimationRenderPreset.ts +0 -180
- package/src/animation/index.ts +0 -5
- package/src/cinematic/BloomPass.ts +0 -26
- package/src/cinematic/CinematicDepthComposition.ts +0 -30
- package/src/cinematic/CinematicEvidence.ts +0 -123
- package/src/cinematic/CinematicLightingRig.ts +0 -144
- package/src/cinematic/CinematicMaterialPresets.ts +0 -130
- package/src/cinematic/CinematicPostProcess.ts +0 -83
- package/src/cinematic/DepthHazePass.ts +0 -30
- package/src/cinematic/EmissivePracticalLightSystem.ts +0 -45
- package/src/cinematic/FilmGrainPass.ts +0 -24
- package/src/cinematic/FogVolumeSystem.ts +0 -30
- package/src/cinematic/GlowCardSystem.ts +0 -44
- package/src/cinematic/RainParticleSystem.ts +0 -151
- package/src/cinematic/VignettePass.ts +0 -25
- package/src/cinematic/WetReflectionApproximation.ts +0 -27
- package/src/cinematic/index.ts +0 -14
- package/src/effects/CollisionModule.ts +0 -64
- package/src/effects/ColorModule.ts +0 -60
- package/src/effects/ForceModule.ts +0 -25
- package/src/effects/GPUParticleBackend.ts +0 -569
- package/src/effects/Particle.ts +0 -108
- package/src/effects/ParticleDiagnostics.ts +0 -224
- package/src/effects/ParticleEffectPresets.ts +0 -147
- package/src/effects/ParticleEmitter.ts +0 -326
- package/src/effects/ParticleModule.ts +0 -26
- package/src/effects/ParticleRenderPass.ts +0 -117
- package/src/effects/ParticleRenderer.ts +0 -132
- package/src/effects/ParticleSystem.ts +0 -333
- package/src/effects/SizeModule.ts +0 -56
- package/src/effects/TrailModule.ts +0 -72
- package/src/effects/VelocityModule.ts +0 -75
- package/src/effects/index.ts +0 -15
- package/src/index.ts +0 -925
- package/src/materials/AlphaSorting.ts +0 -30
- package/src/materials/MaterialExtensions.ts +0 -42
- package/src/materials/PhysicalMaterial.ts +0 -133
- package/src/materials/TransmissionPass.ts +0 -51
- package/src/performance/BVH.ts +0 -18
- package/src/performance/Batcher.ts +0 -2
- package/src/performance/FrustumCuller.ts +0 -9
- package/src/performance/LOD.ts +0 -20
- package/src/performance/Octree.ts +0 -10
- package/src/performance/RenderItemSorting.ts +0 -170
- package/src/performance/RendererStats.ts +0 -43
- package/src/performance/ResourceBudget.ts +0 -44
- package/src/postprocess/BloomPass.ts +0 -28
- package/src/postprocess/CinematicDiagnostics.ts +0 -642
- package/src/postprocess/ColorGradingPass.ts +0 -24
- package/src/postprocess/DepthOfFieldPass.ts +0 -12
- package/src/postprocess/EffectComposer.ts +0 -349
- package/src/postprocess/SSAOPass.ts +0 -20
- package/src/postprocess/index.ts +0 -34
- package/src/production-runtime/AnimationControlsPipeline.ts +0 -77
- package/src/production-runtime/PBRHDRPipeline.ts +0 -381
- package/src/production-runtime/ProductionEffectsPipeline.ts +0 -85
- package/src/production-runtime/ProductionRendererTypes.ts +0 -136
- package/src/production-runtime/ProductionRuntimeRenderer.ts +0 -172
- package/src/production-runtime/ProductionWebGL2Renderer.ts +0 -313
- package/src/production-runtime/ProductionWebGPURenderer.ts +0 -396
- package/src/production-runtime/TransmissionBackdropCapture.ts +0 -130
- package/src/production-runtime/animation/MorphTargetRenderer.ts +0 -2
- package/src/production-runtime/animation/SkinningRenderer.ts +0 -2
- package/src/production-runtime/backends/RendererBackend.ts +0 -17
- package/src/production-runtime/backends/WebGL2RendererBackend.ts +0 -30
- package/src/production-runtime/backends/WebGPURendererBackend.ts +0 -24
- package/src/production-runtime/backends/webgl2/WebGL2Buffer.ts +0 -2
- package/src/production-runtime/backends/webgl2/WebGL2Capabilities.ts +0 -2
- package/src/production-runtime/backends/webgl2/WebGL2RenderTarget.ts +0 -2
- package/src/production-runtime/backends/webgl2/WebGL2Shader.ts +0 -2
- package/src/production-runtime/backends/webgl2/WebGL2StateCache.ts +0 -1
- package/src/production-runtime/backends/webgl2/WebGL2Texture.ts +0 -2
- package/src/production-runtime/backends/webgpu/WebGPUBuffer.ts +0 -2
- package/src/production-runtime/backends/webgpu/WebGPUCapabilities.ts +0 -2
- package/src/production-runtime/backends/webgpu/WebGPURenderTarget.ts +0 -2
- package/src/production-runtime/backends/webgpu/WebGPUShader.ts +0 -2
- package/src/production-runtime/backends/webgpu/WebGPUTexture.ts +0 -2
- package/src/production-runtime/color/ColorManagement.ts +0 -3
- package/src/production-runtime/color/ToneMapping.ts +0 -7
- package/src/production-runtime/diagnostics/FrameCapture.ts +0 -2
- package/src/production-runtime/diagnostics/GPUCapabilities.ts +0 -2
- package/src/production-runtime/diagnostics/RendererStats.ts +0 -2
- package/src/production-runtime/environment/EnvironmentMap.ts +0 -1
- package/src/production-runtime/environment/HDRLoader.ts +0 -57
- package/src/production-runtime/environment/PMREMGenerator.ts +0 -713
- package/src/production-runtime/framegraph/FrameGraph.ts +0 -18
- package/src/production-runtime/framegraph/RenderPass.ts +0 -15
- package/src/production-runtime/geometry/ProjectedDecalGeometry.ts +0 -439
- package/src/production-runtime/index.ts +0 -127
- package/src/production-runtime/lights/LightManager.ts +0 -7
- package/src/production-runtime/lights/ShadowMapRenderer.ts +0 -5
- package/src/production-runtime/materials/GLTFMaterialAdapter.ts +0 -6
- package/src/production-runtime/materials/GLTFPBRMaterialAdapter.ts +0 -2
- package/src/production-runtime/materials/MaterialCompiler.ts +0 -7
- package/src/production-runtime/materials/MaterialTextureBindings.ts +0 -5
- package/src/production-runtime/materials/PBRMaterial.ts +0 -2
- package/src/production-runtime/materials/PBRShaderFeatures.ts +0 -2
- package/src/production-runtime/passes/ContactShadowPass.ts +0 -184
- package/src/production-runtime/passes/DepthPrepass.ts +0 -7
- package/src/production-runtime/passes/OpaquePass.ts +0 -7
- package/src/production-runtime/passes/ShadowPass.ts +0 -7
- package/src/production-runtime/passes/SkyboxPass.ts +0 -7
- package/src/production-runtime/passes/ToneMappingPass.ts +0 -7
- package/src/production-runtime/passes/TransparentPass.ts +0 -7
- package/src/production-runtime/postprocess/BloomPass.ts +0 -51
- package/src/production-runtime/postprocess/ColorGradingPass.ts +0 -49
- package/src/production-runtime/postprocess/DOFPass.ts +0 -47
- package/src/production-runtime/postprocess/FXAAPass.ts +0 -53
- package/src/production-runtime/postprocess/ProductionEffectComposer.ts +0 -78
- package/src/production-runtime/postprocess/ProductionPostProcessTypes.ts +0 -174
- package/src/production-runtime/postprocess/SSAOPass.ts +0 -45
- package/src/production-runtime/resources/GPUBuffer.ts +0 -2
- package/src/production-runtime/resources/GPUTexture.ts +0 -2
- package/src/production-runtime/resources/RenderTarget.ts +0 -3
- package/src/production-runtime/resources/ResourceCache.ts +0 -7
- package/src/production-runtime/scene/Camera.ts +0 -1
- package/src/production-runtime/scene/Lights.ts +0 -2
- package/src/production-runtime/scene/RenderableMesh.ts +0 -2
- package/src/production-runtime/scene/RenderablePrimitive.ts +0 -1
- package/src/production-runtime/scene/RenderableScene.ts +0 -4
- package/src/production-runtime/shaders/ShaderProgramLibrary.ts +0 -7
- package/src/production-runtime/shaders/chunks/brdf.glsl +0 -2
- package/src/production-runtime/shaders/chunks/ibl.glsl +0 -3
- package/src/production-runtime/shaders/chunks/pbr.frag.glsl +0 -47
- package/src/production-runtime/shaders/chunks/pbr.vert.glsl +0 -8
- package/src/production-runtime/shaders/chunks/shadows.glsl +0 -2
- package/src/production-runtime/shaders/wgsl/pbr.wgsl +0 -3
- package/src/production-runtime/shaders/wgsl/postprocess.wgsl +0 -2
- package/src/production-runtime/shaders/wgsl/skybox.wgsl +0 -2
- package/src/shaders/depth.frag.glsl +0 -5
- package/src/shaders/depth.vert.glsl +0 -8
- package/src/shaders/pbr-direct.frag.glsl +0 -687
- package/src/shaders/pbr-direct.vert.glsl +0 -18
- package/src/shaders/unlit.frag.glsl +0 -18
- package/src/shaders/unlit.vert.glsl +0 -13
- package/src/shadows/CascadedShadowPipeline.ts +0 -53
- package/src/shadows/ContactShadows.ts +0 -106
- package/src/shadows/ShadowDebugViews.ts +0 -46
- package/src/threejs-compatibility/InstancingSystem.ts +0 -17
- package/src/threejs-compatibility/LightingSystem.ts +0 -22
- package/src/threejs-compatibility/MaterialSystem.ts +0 -9
- package/src/threejs-compatibility/RenderTargetSystem.ts +0 -35
- package/src/threejs-compatibility/RendererDiagnostics.ts +0 -61
- package/src/threejs-compatibility/SceneRenderer.ts +0 -34
- package/src/threejs-compatibility/ShadowSystem.ts +0 -19
- package/src/threejs-compatibility/TextureSystem.ts +0 -19
- package/src/threejs-compatibility/ThreeCompatRenderer.ts +0 -90
- package/src/threejs-compatibility/TransparencySystem.ts +0 -19
- package/src/threejs-compatibility/index.ts +0 -29
- package/src/threejs-compatibility/performance/BVH.ts +0 -14
- package/src/threejs-compatibility/performance/FrustumCulling.ts +0 -10
- package/src/threejs-compatibility/performance/Instancing.ts +0 -4
- package/src/threejs-compatibility/performance/LODSystem.ts +0 -16
- package/src/threejs-compatibility/performance/OcclusionCulling.ts +0 -6
- package/src/threejs-compatibility/performance/RaycastAcceleration.ts +0 -12
- package/src/threejs-compatibility/performance/RendererProfiler.ts +0 -19
- package/src/threejs-compatibility/performance/TextureStreaming.ts +0 -4
- package/src/threejs-compatibility/performance/index.ts +0 -12
- package/src/threejs-compatibility/postprocess/BloomPass.ts +0 -16
- package/src/threejs-compatibility/postprocess/ColorGradingPass.ts +0 -16
- package/src/threejs-compatibility/postprocess/DepthOfFieldPass.ts +0 -21
- package/src/threejs-compatibility/postprocess/EffectComposer.ts +0 -14
- package/src/threejs-compatibility/postprocess/FXAAPass.ts +0 -15
- package/src/threejs-compatibility/postprocess/MotionBlurPass.ts +0 -20
- package/src/threejs-compatibility/postprocess/OutlinePass.ts +0 -21
- package/src/threejs-compatibility/postprocess/PostProcessTypes.ts +0 -169
- package/src/threejs-compatibility/postprocess/RenderPass.ts +0 -9
- package/src/threejs-compatibility/postprocess/SMAAPass.ts +0 -15
- package/src/threejs-compatibility/postprocess/SSAOPass.ts +0 -21
- package/src/threejs-compatibility/postprocess/ShaderPass.ts +0 -7
- package/src/threejs-compatibility/postprocess/TAAPass.ts +0 -15
- package/src/threejs-compatibility/postprocess/VignettePass.ts +0 -16
- package/src/threejs-compatibility/postprocess/index.ts +0 -15
- package/src/threejs-compatibility/shaders/NodeMaterial.ts +0 -21
- package/src/threejs-compatibility/shaders/RawShaderMaterial.ts +0 -6
- package/src/threejs-compatibility/shaders/ShaderDiagnostics.ts +0 -17
- package/src/threejs-compatibility/shaders/ShaderMaterial.ts +0 -18
- package/src/threejs-compatibility/shaders/ThreeCompatShaderChunks.ts +0 -6
- package/src/threejs-compatibility/shaders/Uniforms.ts +0 -18
- package/src/threejs-compatibility/shaders/index.ts +0 -9
- package/src/threejs-compatibility/vfx/GPUPointCloud.ts +0 -7
- package/src/threejs-compatibility/vfx/LineRenderer.ts +0 -13
- package/src/threejs-compatibility/vfx/ParticleSystem.ts +0 -23
- package/src/threejs-compatibility/vfx/SpriteSystem.ts +0 -14
- package/src/threejs-compatibility/vfx/TrailRenderer.ts +0 -8
- package/src/threejs-compatibility/vfx/VFXDiagnostics.ts +0 -23
- package/src/threejs-compatibility/vfx/index.ts +0 -9
- package/src/threejs-example-parity/index.ts +0 -205
- package/src/webgpu/WebGPUBuffer.ts +0 -1
- package/src/webgpu/WebGPUCompute.ts +0 -2
- package/src/webgpu/WebGPUPipelineCache.ts +0 -15
- package/src/webgpu/WebGPUPostProcess.ts +0 -2
- package/src/webgpu/WebGPUTexture.ts +0 -2
- package/tsconfig.json +0 -26
- package/vitest.config.ts +0 -20
|
@@ -1,725 +0,0 @@
|
|
|
1
|
-
import { createEnvironmentMapResourceSet, type EnvironmentMapResourceSet } from "./EnvironmentMapResources";
|
|
2
|
-
import { bloomPixels, fxaaPixels, toneMapPixels, type PostProcessColorSpace, type ToneMappingOperator } from "./PostProcessPass";
|
|
3
|
-
import { Sampler } from "./Sampler";
|
|
4
|
-
import { Texture } from "./Texture";
|
|
5
|
-
import { TextureBinding } from "./TextureBinding";
|
|
6
|
-
import type { EnvironmentLightingOptions } from "./ForwardPass";
|
|
7
|
-
|
|
8
|
-
export type ExternalParityRenderPresetFeature =
|
|
9
|
-
| "color-management"
|
|
10
|
-
| "tone-mapping"
|
|
11
|
-
| "exposure"
|
|
12
|
-
| "pbr"
|
|
13
|
-
| "bounded-pbr"
|
|
14
|
-
| "environment-reflections"
|
|
15
|
-
| "directional-shadows"
|
|
16
|
-
| "contact-shadows"
|
|
17
|
-
| "postprocess-bloom"
|
|
18
|
-
| "postprocess-fxaa"
|
|
19
|
-
| "depth-textures"
|
|
20
|
-
| "lod"
|
|
21
|
-
| "gpu-timing"
|
|
22
|
-
| "hdr";
|
|
23
|
-
|
|
24
|
-
export interface ExternalParityRenderPresetFeatureStatus {
|
|
25
|
-
readonly feature: ExternalParityRenderPresetFeature;
|
|
26
|
-
readonly state: "active" | "blocked" | "unsupported";
|
|
27
|
-
readonly evidence?: string;
|
|
28
|
-
readonly reason?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ExternalParityRenderPresetEvidence {
|
|
32
|
-
readonly presetId: "aura3d-external-parity-visual-quality-preset";
|
|
33
|
-
readonly presetVersion: 1;
|
|
34
|
-
readonly exampleId: string;
|
|
35
|
-
readonly screenshotPath: string;
|
|
36
|
-
readonly colorManagement: {
|
|
37
|
-
readonly inputColorSpace: PostProcessColorSpace;
|
|
38
|
-
readonly outputColorSpace: PostProcessColorSpace;
|
|
39
|
-
readonly toneMapper: ToneMappingOperator | "bounded-direct";
|
|
40
|
-
readonly exposure: number;
|
|
41
|
-
readonly whitePoint: number;
|
|
42
|
-
};
|
|
43
|
-
readonly activeFeatures: readonly ExternalParityRenderPresetFeature[];
|
|
44
|
-
readonly blockedFeatures: readonly ExternalParityRenderPresetFeatureStatus[];
|
|
45
|
-
readonly features: readonly ExternalParityRenderPresetFeatureStatus[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type ExternalParityEnvironmentPreset =
|
|
49
|
-
| "studio"
|
|
50
|
-
| "softbox"
|
|
51
|
-
| "inspection"
|
|
52
|
-
| "daylight"
|
|
53
|
-
| "exhibit"
|
|
54
|
-
| "evening"
|
|
55
|
-
| "gameplay";
|
|
56
|
-
|
|
57
|
-
export interface ExternalParityEnvironmentLightingBundle {
|
|
58
|
-
readonly presetId: "aura3d-external-parity-visual-quality-preset";
|
|
59
|
-
readonly manifestPath: "fixtures/environment-corpus/manifest.json";
|
|
60
|
-
readonly preset: ExternalParityEnvironmentPreset;
|
|
61
|
-
readonly lighting: EnvironmentLightingOptions;
|
|
62
|
-
readonly resources: EnvironmentMapResourceSet["diagnostics"] & {
|
|
63
|
-
readonly environmentTextureLabel: string;
|
|
64
|
-
readonly brdfLutTextureLabel: string;
|
|
65
|
-
readonly sourceWidth: number;
|
|
66
|
-
readonly sourceHeight: number;
|
|
67
|
-
readonly resourceSet: "generated-local-linear-hdr-environment";
|
|
68
|
-
readonly validation: {
|
|
69
|
-
readonly environmentTexture: boolean;
|
|
70
|
-
readonly brdfLutTexture: boolean;
|
|
71
|
-
readonly specularMipLevels: boolean;
|
|
72
|
-
readonly diffuseIrradiance: boolean;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface ExternalParityLdrPostprocessSummary {
|
|
78
|
-
readonly source: "webgl2-backbuffer-readback";
|
|
79
|
-
readonly path: "ExternalParityRenderPreset.toneMapPixels.bloomPixels.fxaaPixels";
|
|
80
|
-
readonly width: number;
|
|
81
|
-
readonly height: number;
|
|
82
|
-
readonly inputNonDarkPixels: number;
|
|
83
|
-
readonly outputNonDarkPixels: number;
|
|
84
|
-
readonly inputColorBuckets: number;
|
|
85
|
-
readonly outputColorBuckets: number;
|
|
86
|
-
readonly toneMapper: ToneMappingOperator;
|
|
87
|
-
readonly exposure: number;
|
|
88
|
-
readonly whitePoint: number;
|
|
89
|
-
readonly inputColorSpace: PostProcessColorSpace;
|
|
90
|
-
readonly outputColorSpace: PostProcessColorSpace;
|
|
91
|
-
readonly colorCalibrationMonotonic: boolean;
|
|
92
|
-
readonly bloomBrightPixelCount: number;
|
|
93
|
-
readonly bloomBrightEnergy: number;
|
|
94
|
-
readonly bloomMaxNeighborBoost: number;
|
|
95
|
-
readonly fxaaEdgePixels: number;
|
|
96
|
-
readonly changedPixels: number;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface ExternalParityDirectionalShadowEvidence {
|
|
100
|
-
readonly mode: "bounded-directional-shadow-map" | "renderer-owned-directional-shadow-map";
|
|
101
|
-
readonly presetId: "aura3d-external-parity-visual-quality-preset";
|
|
102
|
-
readonly exampleId: string;
|
|
103
|
-
readonly cascadeCount: number;
|
|
104
|
-
readonly mapSize: number;
|
|
105
|
-
readonly bias: number;
|
|
106
|
-
readonly pcfSamples: number;
|
|
107
|
-
readonly lightDirection: readonly [number, number, number];
|
|
108
|
-
readonly casterCount: number;
|
|
109
|
-
readonly receiverCount: number;
|
|
110
|
-
readonly stableTexelSnapping: true;
|
|
111
|
-
readonly visibleReceiverDarkening: boolean;
|
|
112
|
-
readonly productionShadowSamplingClaimed: boolean;
|
|
113
|
-
readonly knownLimit: "directional-shadow-map-fit-and-visible-receiver-evidence-without-production-forward-shadow-sampling" | "renderer-owned-forward-shadow-map-sampling-evidence";
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface ExternalParityReadbackDevice {
|
|
117
|
-
readPixels(x: number, y: number, width: number, height: number): Uint8Array;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const externalParityEnvironmentLightingCache = new Map<ExternalParityEnvironmentPreset, ExternalParityEnvironmentLightingBundle>();
|
|
121
|
-
|
|
122
|
-
export interface ExternalParityRenderPresetEvidenceOptions {
|
|
123
|
-
readonly exampleId: string;
|
|
124
|
-
readonly screenshotPath: string;
|
|
125
|
-
readonly toneMapper?: ExternalParityRenderPresetEvidence["colorManagement"]["toneMapper"];
|
|
126
|
-
readonly inputColorSpace?: PostProcessColorSpace;
|
|
127
|
-
readonly outputColorSpace?: PostProcessColorSpace;
|
|
128
|
-
readonly exposure?: number;
|
|
129
|
-
readonly whitePoint?: number;
|
|
130
|
-
readonly features: readonly ExternalParityRenderPresetFeatureStatus[];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export function createExternalParityEnvironmentLighting(preset: ExternalParityEnvironmentPreset): ExternalParityEnvironmentLightingBundle {
|
|
134
|
-
const cached = externalParityEnvironmentLightingCache.get(preset);
|
|
135
|
-
if (cached) return cached;
|
|
136
|
-
const descriptor = externalParityEnvironmentDescriptor(preset);
|
|
137
|
-
const source = createExternalParityGeneratedHdrEnvironmentMapSource(preset, 128, 64);
|
|
138
|
-
const resources = createEnvironmentMapResourceSet({
|
|
139
|
-
...source,
|
|
140
|
-
encoding: "linear-hdr"
|
|
141
|
-
}, {
|
|
142
|
-
outputColorSpace: "srgb",
|
|
143
|
-
exposure: descriptor.hdrExposure,
|
|
144
|
-
toneMapping: "reinhard",
|
|
145
|
-
specularLevels: 5,
|
|
146
|
-
specularBlurRadius: 3,
|
|
147
|
-
irradianceWidth: 16,
|
|
148
|
-
irradianceHeight: 8,
|
|
149
|
-
irradianceBlurRadius: 8,
|
|
150
|
-
brdfLutSize: 32
|
|
151
|
-
});
|
|
152
|
-
const environmentTexture = new Texture({
|
|
153
|
-
width: resources.base.width,
|
|
154
|
-
height: resources.base.height,
|
|
155
|
-
colorSpace: "srgb",
|
|
156
|
-
label: `external-parity-${preset}-generated-environment-map`,
|
|
157
|
-
mipLevels: resources.specularMipLevels
|
|
158
|
-
});
|
|
159
|
-
const brdfLutTexture = new Texture({
|
|
160
|
-
width: resources.brdfLut.width,
|
|
161
|
-
height: resources.brdfLut.height,
|
|
162
|
-
colorSpace: "linear",
|
|
163
|
-
label: `external-parity-${preset}-brdf-lut`,
|
|
164
|
-
data: resources.brdfLut.data
|
|
165
|
-
});
|
|
166
|
-
const environmentMapTexture = new TextureBinding({
|
|
167
|
-
name: "u_environmentMapTexture",
|
|
168
|
-
texture: environmentTexture,
|
|
169
|
-
sampler: new Sampler({ minFilter: "linear", magFilter: "linear", addressU: "repeat", addressV: "clamp-to-edge" }),
|
|
170
|
-
expectedColorSpace: "srgb",
|
|
171
|
-
required: true
|
|
172
|
-
});
|
|
173
|
-
const environmentBrdfLutTexture = new TextureBinding({
|
|
174
|
-
name: "u_environmentBrdfLutTexture",
|
|
175
|
-
texture: brdfLutTexture,
|
|
176
|
-
sampler: new Sampler({ minFilter: "linear", magFilter: "linear", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
177
|
-
expectedColorSpace: "linear",
|
|
178
|
-
required: true
|
|
179
|
-
});
|
|
180
|
-
const environmentValidation = environmentMapTexture.validate();
|
|
181
|
-
const brdfValidation = environmentBrdfLutTexture.validate();
|
|
182
|
-
const bundle: ExternalParityEnvironmentLightingBundle = {
|
|
183
|
-
presetId: "aura3d-external-parity-visual-quality-preset",
|
|
184
|
-
manifestPath: "fixtures/environment-corpus/manifest.json",
|
|
185
|
-
preset,
|
|
186
|
-
lighting: {
|
|
187
|
-
color: descriptor.ambientColor,
|
|
188
|
-
intensity: descriptor.ambientIntensity,
|
|
189
|
-
proceduralMap: {
|
|
190
|
-
skyColor: descriptor.skyColor,
|
|
191
|
-
horizonColor: descriptor.horizonColor,
|
|
192
|
-
groundColor: descriptor.groundColor,
|
|
193
|
-
specularColor: descriptor.specularColor,
|
|
194
|
-
intensity: descriptor.environmentMapIntensity,
|
|
195
|
-
specularIntensity: descriptor.environmentSpecularIntensity
|
|
196
|
-
},
|
|
197
|
-
environmentMapTexture,
|
|
198
|
-
environmentMapIntensity: descriptor.environmentTextureIntensity,
|
|
199
|
-
environmentMapSpecularIntensity: descriptor.environmentTextureSpecularIntensity,
|
|
200
|
-
environmentMapRotation: descriptor.rotation,
|
|
201
|
-
environmentMapMipCount: resources.specularMipLevels.length,
|
|
202
|
-
environmentBrdfLutTexture
|
|
203
|
-
},
|
|
204
|
-
resources: {
|
|
205
|
-
...resources.diagnostics,
|
|
206
|
-
environmentTextureLabel: environmentTexture.label,
|
|
207
|
-
brdfLutTextureLabel: brdfLutTexture.label,
|
|
208
|
-
sourceWidth: source.width,
|
|
209
|
-
sourceHeight: source.height,
|
|
210
|
-
resourceSet: "generated-local-linear-hdr-environment",
|
|
211
|
-
validation: {
|
|
212
|
-
environmentTexture: environmentValidation.ok,
|
|
213
|
-
brdfLutTexture: brdfValidation.ok,
|
|
214
|
-
specularMipLevels: resources.specularMipLevels.length >= 4,
|
|
215
|
-
diffuseIrradiance: resources.diffuseIrradiance.width > 0 && resources.diffuseIrradiance.height > 0
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
externalParityEnvironmentLightingCache.set(preset, bundle);
|
|
220
|
-
return bundle;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export function createExternalParityGeneratedHdrEnvironmentMapSource(
|
|
224
|
-
preset: ExternalParityEnvironmentPreset,
|
|
225
|
-
width = 128,
|
|
226
|
-
height = 64
|
|
227
|
-
): { readonly width: number; readonly height: number; readonly data: Float32Array } {
|
|
228
|
-
if (!Number.isInteger(width) || width < 8 || !Number.isInteger(height) || height < 4) {
|
|
229
|
-
throw new RangeError("ExternalParity generated HDR environment map dimensions must be at least 8x4.");
|
|
230
|
-
}
|
|
231
|
-
const descriptor = externalParityEnvironmentDescriptor(preset);
|
|
232
|
-
const data = new Float32Array(width * height * 4);
|
|
233
|
-
for (let y = 0; y < height; y += 1) {
|
|
234
|
-
const vertical = y / Math.max(1, height - 1);
|
|
235
|
-
const skyMix = 1 - vertical;
|
|
236
|
-
const horizonMix = Math.max(0, 1 - Math.abs(vertical - 0.52) * 3.2);
|
|
237
|
-
const groundMix = Math.max(0, (vertical - 0.52) / 0.48);
|
|
238
|
-
const denominator = skyMix + horizonMix + groundMix + 0.001;
|
|
239
|
-
for (let x = 0; x < width; x += 1) {
|
|
240
|
-
const horizontal = x / Math.max(1, width - 1);
|
|
241
|
-
const stripe = 0.5 + 0.5 * Math.sin(horizontal * Math.PI * 2 + descriptor.rotation * Math.PI * 2);
|
|
242
|
-
const softbox = Math.pow(Math.max(0, 1 - Math.abs(horizontal - descriptor.highlightU) * 4.8), 4)
|
|
243
|
-
* Math.pow(Math.max(0, 1 - Math.abs(vertical - descriptor.highlightV) * 6.2), 3);
|
|
244
|
-
const r = descriptor.skyColor[0] * skyMix + descriptor.horizonColor[0] * horizonMix + descriptor.groundColor[0] * groundMix;
|
|
245
|
-
const g = descriptor.skyColor[1] * skyMix + descriptor.horizonColor[1] * horizonMix + descriptor.groundColor[1] * groundMix;
|
|
246
|
-
const b = descriptor.skyColor[2] * skyMix + descriptor.horizonColor[2] * horizonMix + descriptor.groundColor[2] * groundMix;
|
|
247
|
-
const highlight = softbox * descriptor.hdrHighlightIntensity;
|
|
248
|
-
const index = (y * width + x) * 4;
|
|
249
|
-
data[index] = Math.max(0, (r + descriptor.specularColor[0] * highlight + stripe * descriptor.textureVariation) / denominator);
|
|
250
|
-
data[index + 1] = Math.max(0, (g + descriptor.specularColor[1] * highlight + stripe * descriptor.textureVariation) / denominator);
|
|
251
|
-
data[index + 2] = Math.max(0, (b + descriptor.specularColor[2] * highlight + stripe * descriptor.textureVariation) / denominator);
|
|
252
|
-
data[index + 3] = 1;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return { width, height, data };
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export function createExternalParityGeneratedEnvironmentMapSource(
|
|
259
|
-
preset: ExternalParityEnvironmentPreset,
|
|
260
|
-
width = 128,
|
|
261
|
-
height = 64
|
|
262
|
-
): { readonly width: number; readonly height: number; readonly data: Uint8Array } {
|
|
263
|
-
if (!Number.isInteger(width) || width < 8 || !Number.isInteger(height) || height < 4) {
|
|
264
|
-
throw new RangeError("ExternalParity generated environment map dimensions must be at least 8x4.");
|
|
265
|
-
}
|
|
266
|
-
const descriptor = externalParityEnvironmentDescriptor(preset);
|
|
267
|
-
const data = new Uint8Array(width * height * 4);
|
|
268
|
-
for (let y = 0; y < height; y += 1) {
|
|
269
|
-
const vertical = y / Math.max(1, height - 1);
|
|
270
|
-
const skyMix = 1 - vertical;
|
|
271
|
-
const horizonMix = Math.max(0, 1 - Math.abs(vertical - 0.52) * 3.2);
|
|
272
|
-
const groundMix = Math.max(0, (vertical - 0.52) / 0.48);
|
|
273
|
-
for (let x = 0; x < width; x += 1) {
|
|
274
|
-
const horizontal = x / Math.max(1, width - 1);
|
|
275
|
-
const stripe = 0.5 + 0.5 * Math.sin(horizontal * Math.PI * 2 + descriptor.rotation * Math.PI * 2);
|
|
276
|
-
const softbox = Math.pow(Math.max(0, 1 - Math.abs(horizontal - descriptor.highlightU) * 4.8), 4)
|
|
277
|
-
* Math.pow(Math.max(0, 1 - Math.abs(vertical - descriptor.highlightV) * 6.2), 3);
|
|
278
|
-
const r = descriptor.skyColor[0] * skyMix + descriptor.horizonColor[0] * horizonMix + descriptor.groundColor[0] * groundMix;
|
|
279
|
-
const g = descriptor.skyColor[1] * skyMix + descriptor.horizonColor[1] * horizonMix + descriptor.groundColor[1] * groundMix;
|
|
280
|
-
const b = descriptor.skyColor[2] * skyMix + descriptor.horizonColor[2] * horizonMix + descriptor.groundColor[2] * groundMix;
|
|
281
|
-
const index = (y * width + x) * 4;
|
|
282
|
-
data[index] = toByte((r + descriptor.specularColor[0] * softbox + stripe * descriptor.textureVariation) / (skyMix + horizonMix + groundMix + 0.001));
|
|
283
|
-
data[index + 1] = toByte((g + descriptor.specularColor[1] * softbox + stripe * descriptor.textureVariation) / (skyMix + horizonMix + groundMix + 0.001));
|
|
284
|
-
data[index + 2] = toByte((b + descriptor.specularColor[2] * softbox + stripe * descriptor.textureVariation) / (skyMix + horizonMix + groundMix + 0.001));
|
|
285
|
-
data[index + 3] = 255;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return { width, height, data };
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export function createExternalParityFlagshipRenderPresetEvidence(options: {
|
|
292
|
-
readonly exampleId: string;
|
|
293
|
-
readonly screenshotPath: string;
|
|
294
|
-
readonly exposure?: number;
|
|
295
|
-
readonly whitePoint?: number;
|
|
296
|
-
readonly productionPbrEvidence?: boolean;
|
|
297
|
-
readonly directionalShadowEvidence?: boolean;
|
|
298
|
-
readonly productionShadowSamplingEvidence?: boolean;
|
|
299
|
-
readonly postprocessEvidence?: boolean;
|
|
300
|
-
readonly depthTextureEvidence?: boolean;
|
|
301
|
-
readonly hdrRenderTargetEvidence?: boolean;
|
|
302
|
-
readonly lodEvidence?: boolean;
|
|
303
|
-
}): ExternalParityRenderPresetEvidence {
|
|
304
|
-
const postprocessPathEvidence = options.hdrRenderTargetEvidence
|
|
305
|
-
? "renderer-owned HDR render-target postprocess path"
|
|
306
|
-
: "shared ExternalParity LDR readback path";
|
|
307
|
-
return createExternalParityRenderPresetEvidence({
|
|
308
|
-
exampleId: options.exampleId,
|
|
309
|
-
screenshotPath: options.screenshotPath,
|
|
310
|
-
toneMapper: "reinhard",
|
|
311
|
-
exposure: options.exposure ?? 1,
|
|
312
|
-
whitePoint: options.whitePoint ?? 1,
|
|
313
|
-
features: [
|
|
314
|
-
externalParityActiveFeature("color-management", "ExternalParity preset records linear input and sRGB framebuffer output for this browser scene."),
|
|
315
|
-
externalParityActiveFeature(
|
|
316
|
-
"tone-mapping",
|
|
317
|
-
options.hdrRenderTargetEvidence
|
|
318
|
-
? "ExternalParity preset publishes renderer-owned HDR render-target tone mapping evidence for this real scene."
|
|
319
|
-
: "ExternalParity preset applies bounded Reinhard LDR postprocess readback metrics for this real scene."
|
|
320
|
-
),
|
|
321
|
-
externalParityActiveFeature("exposure", "ExternalParity preset exposes finite exposure and white-point values in runtime state."),
|
|
322
|
-
options.productionPbrEvidence
|
|
323
|
-
? externalParityActiveFeature("pbr", "Scene publishes root renderer material/shader PBR evidence with lit material response and environment reflection metrics.")
|
|
324
|
-
: externalParityActiveFeature("bounded-pbr", "Scene uses Aura3D lit PBR materials and WebGL2 shader lighting while full external physical PBR parity remains separately gated."),
|
|
325
|
-
externalParityActiveFeature("environment-reflections", "Scene uses generated local environment map, specular mip resources, diffuse irradiance, and BRDF LUT bindings."),
|
|
326
|
-
options.directionalShadowEvidence
|
|
327
|
-
? externalParityActiveFeature(
|
|
328
|
-
"directional-shadows",
|
|
329
|
-
options.productionShadowSamplingEvidence
|
|
330
|
-
? "Scene publishes renderer-owned directional shadow-map sampling evidence in the forward path."
|
|
331
|
-
: "Scene publishes visible directional-shadow-map evidence while production sampling remains separately gated."
|
|
332
|
-
)
|
|
333
|
-
: externalParityBlockedFeature("directional-shadows", "Flagship scene still uses bounded contact-shadow/proxy evidence; production shadow maps are not claimed."),
|
|
334
|
-
externalParityActiveFeature(
|
|
335
|
-
"contact-shadows",
|
|
336
|
-
options.productionShadowSamplingEvidence
|
|
337
|
-
? "Scene may publish contact-shadow helper evidence as an auxiliary cue; renderer-owned shadow-map sampling is the primary shadow path."
|
|
338
|
-
: "Scene publishes visible contact-shadow/proxy evidence while shadow maps remain blocked."
|
|
339
|
-
),
|
|
340
|
-
options.postprocessEvidence
|
|
341
|
-
? externalParityActiveFeature("postprocess-bloom", `Scene runs bloom through the ${postprocessPathEvidence} on real scene pixels.`)
|
|
342
|
-
: externalParityBlockedFeature("postprocess-bloom", "Postprocess readback evidence was not available for this scene."),
|
|
343
|
-
options.postprocessEvidence
|
|
344
|
-
? externalParityActiveFeature("postprocess-fxaa", `Scene runs FXAA through the ${postprocessPathEvidence} on real scene pixels.`)
|
|
345
|
-
: externalParityBlockedFeature("postprocess-fxaa", "FXAA readback evidence was not available for this scene."),
|
|
346
|
-
options.depthTextureEvidence
|
|
347
|
-
? externalParityActiveFeature("depth-textures", "Scene publishes renderer-owned sampleable depth texture evidence for depth-aware postprocess.")
|
|
348
|
-
: externalParityBlockedFeature("depth-textures", "Flagship scene did not publish sampleable depth texture evidence for depth-aware postprocess."),
|
|
349
|
-
options.lodEvidence
|
|
350
|
-
? externalParityActiveFeature("lod", "Scene reports real LOD selection metrics for render items.")
|
|
351
|
-
: externalParityBlockedFeature("lod", "This scene does not publish real LOD selection evidence."),
|
|
352
|
-
externalParityBlockedFeature("gpu-timing", "GPU timer query evidence is not required for this ExternalParity flagship preset; CPU fallback timing is reported."),
|
|
353
|
-
options.hdrRenderTargetEvidence
|
|
354
|
-
? externalParityActiveFeature("hdr", "Scene publishes renderer-owned HDR render-target evidence with tone-mapped presentation.")
|
|
355
|
-
: externalParityBlockedFeature("hdr", "Flagship scene did not publish renderer-owned HDR render-target evidence.")
|
|
356
|
-
]
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export function createExternalParityDirectionalShadowEvidence(options: {
|
|
361
|
-
readonly exampleId: string;
|
|
362
|
-
readonly casterCount: number;
|
|
363
|
-
readonly receiverCount: number;
|
|
364
|
-
readonly visibleReceiverDarkening: boolean;
|
|
365
|
-
readonly cascadeCount?: number;
|
|
366
|
-
readonly mapSize?: number;
|
|
367
|
-
readonly bias?: number;
|
|
368
|
-
readonly pcfSamples?: number;
|
|
369
|
-
readonly lightDirection?: readonly [number, number, number];
|
|
370
|
-
readonly productionShadowSamplingClaimed?: boolean;
|
|
371
|
-
}): ExternalParityDirectionalShadowEvidence {
|
|
372
|
-
const productionShadowSamplingClaimed = options.productionShadowSamplingClaimed === true;
|
|
373
|
-
return {
|
|
374
|
-
mode: productionShadowSamplingClaimed ? "renderer-owned-directional-shadow-map" : "bounded-directional-shadow-map",
|
|
375
|
-
presetId: "aura3d-external-parity-visual-quality-preset",
|
|
376
|
-
exampleId: options.exampleId,
|
|
377
|
-
cascadeCount: options.cascadeCount ?? 3,
|
|
378
|
-
mapSize: options.mapSize ?? 512,
|
|
379
|
-
bias: Number((options.bias ?? 0.003).toFixed(5)),
|
|
380
|
-
pcfSamples: options.pcfSamples ?? 9,
|
|
381
|
-
lightDirection: options.lightDirection ?? [-0.42, -0.82, -0.38],
|
|
382
|
-
casterCount: Math.max(0, Math.floor(options.casterCount)),
|
|
383
|
-
receiverCount: Math.max(0, Math.floor(options.receiverCount)),
|
|
384
|
-
stableTexelSnapping: true,
|
|
385
|
-
visibleReceiverDarkening: options.visibleReceiverDarkening,
|
|
386
|
-
productionShadowSamplingClaimed,
|
|
387
|
-
knownLimit: productionShadowSamplingClaimed
|
|
388
|
-
? "renderer-owned-forward-shadow-map-sampling-evidence"
|
|
389
|
-
: "directional-shadow-map-fit-and-visible-receiver-evidence-without-production-forward-shadow-sampling"
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
export function sampleExternalParityLdrPostprocessReadback(options: {
|
|
394
|
-
readonly device: ExternalParityReadbackDevice;
|
|
395
|
-
readonly framebufferWidth: number;
|
|
396
|
-
readonly framebufferHeight: number;
|
|
397
|
-
readonly exposure?: number;
|
|
398
|
-
readonly whitePoint?: number;
|
|
399
|
-
readonly toneMapper?: ToneMappingOperator;
|
|
400
|
-
readonly inputColorSpace?: PostProcessColorSpace;
|
|
401
|
-
readonly outputColorSpace?: PostProcessColorSpace;
|
|
402
|
-
readonly maxWidth?: number;
|
|
403
|
-
readonly maxHeight?: number;
|
|
404
|
-
}): ExternalParityLdrPostprocessSummary {
|
|
405
|
-
const width = Math.max(8, Math.min(options.maxWidth ?? 96, options.framebufferWidth));
|
|
406
|
-
const height = Math.max(8, Math.min(options.maxHeight ?? 54, options.framebufferHeight));
|
|
407
|
-
const x = Math.max(0, Math.floor(options.framebufferWidth / 2 - width / 2));
|
|
408
|
-
const y = Math.max(0, Math.floor(options.framebufferHeight / 2 - height / 2));
|
|
409
|
-
const input = options.device.readPixels(x, y, width, height);
|
|
410
|
-
const exposure = options.exposure ?? 1;
|
|
411
|
-
const whitePoint = options.whitePoint ?? 1;
|
|
412
|
-
const toneMapper = options.toneMapper ?? "reinhard";
|
|
413
|
-
const inputColorSpace = options.inputColorSpace ?? "srgb";
|
|
414
|
-
const outputColorSpace = options.outputColorSpace ?? "srgb";
|
|
415
|
-
const toneMapped = toneMapPixels(input, width, height, {
|
|
416
|
-
exposure,
|
|
417
|
-
whitePoint,
|
|
418
|
-
gamma: 2.2,
|
|
419
|
-
operator: toneMapper,
|
|
420
|
-
inputColorSpace,
|
|
421
|
-
outputColorSpace
|
|
422
|
-
});
|
|
423
|
-
const bloomed = bloomPixels(toneMapped.pixels, width, height, { threshold: 0.62, intensity: 0.28, radius: 1 });
|
|
424
|
-
const fxaa = fxaaPixels(bloomed.pixels, width, height, { edgeThreshold: 0.08, subpixelBlend: 0.55 });
|
|
425
|
-
return {
|
|
426
|
-
source: "webgl2-backbuffer-readback",
|
|
427
|
-
path: "ExternalParityRenderPreset.toneMapPixels.bloomPixels.fxaaPixels",
|
|
428
|
-
width,
|
|
429
|
-
height,
|
|
430
|
-
inputNonDarkPixels: countNonDarkPixels(input),
|
|
431
|
-
outputNonDarkPixels: countNonDarkPixels(fxaa.pixels),
|
|
432
|
-
inputColorBuckets: countColorBuckets(input),
|
|
433
|
-
outputColorBuckets: countColorBuckets(fxaa.pixels),
|
|
434
|
-
toneMapper,
|
|
435
|
-
exposure: Number(exposure.toFixed(4)),
|
|
436
|
-
whitePoint: Number(whitePoint.toFixed(4)),
|
|
437
|
-
inputColorSpace,
|
|
438
|
-
outputColorSpace,
|
|
439
|
-
colorCalibrationMonotonic: toneMapped.calibration.monotonic,
|
|
440
|
-
bloomBrightPixelCount: bloomed.brightPixelCount,
|
|
441
|
-
bloomBrightEnergy: Number(bloomed.brightEnergy.toFixed(4)),
|
|
442
|
-
bloomMaxNeighborBoost: Number(bloomed.maxNeighborBoost.toFixed(4)),
|
|
443
|
-
fxaaEdgePixels: countMaskPixels(fxaa.edgeMask),
|
|
444
|
-
changedPixels: countChangedPixels(input, fxaa.pixels)
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
export function createExternalParityRenderPresetEvidence(options: ExternalParityRenderPresetEvidenceOptions): ExternalParityRenderPresetEvidence {
|
|
449
|
-
if (!options.exampleId.trim()) {
|
|
450
|
-
throw new Error("ExternalParity render preset evidence requires an example id.");
|
|
451
|
-
}
|
|
452
|
-
if (!options.screenshotPath.trim()) {
|
|
453
|
-
throw new Error("ExternalParity render preset evidence requires a screenshot path.");
|
|
454
|
-
}
|
|
455
|
-
const features = normalizeFeatureStatuses(options.features);
|
|
456
|
-
return {
|
|
457
|
-
presetId: "aura3d-external-parity-visual-quality-preset",
|
|
458
|
-
presetVersion: 1,
|
|
459
|
-
exampleId: options.exampleId,
|
|
460
|
-
screenshotPath: options.screenshotPath,
|
|
461
|
-
colorManagement: {
|
|
462
|
-
inputColorSpace: options.inputColorSpace ?? "linear",
|
|
463
|
-
outputColorSpace: options.outputColorSpace ?? "srgb",
|
|
464
|
-
toneMapper: options.toneMapper ?? "bounded-direct",
|
|
465
|
-
exposure: finitePositive(options.exposure ?? 1, "exposure"),
|
|
466
|
-
whitePoint: finitePositive(options.whitePoint ?? 1, "whitePoint")
|
|
467
|
-
},
|
|
468
|
-
activeFeatures: features.filter((feature) => feature.state === "active").map((feature) => feature.feature),
|
|
469
|
-
blockedFeatures: features.filter((feature) => feature.state !== "active"),
|
|
470
|
-
features
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
function externalParityEnvironmentDescriptor(preset: ExternalParityEnvironmentPreset): {
|
|
475
|
-
readonly ambientColor: readonly [number, number, number];
|
|
476
|
-
readonly ambientIntensity: number;
|
|
477
|
-
readonly skyColor: readonly [number, number, number];
|
|
478
|
-
readonly horizonColor: readonly [number, number, number];
|
|
479
|
-
readonly groundColor: readonly [number, number, number];
|
|
480
|
-
readonly specularColor: readonly [number, number, number];
|
|
481
|
-
readonly environmentMapIntensity: number;
|
|
482
|
-
readonly environmentSpecularIntensity: number;
|
|
483
|
-
readonly environmentTextureIntensity: number;
|
|
484
|
-
readonly environmentTextureSpecularIntensity: number;
|
|
485
|
-
readonly rotation: number;
|
|
486
|
-
readonly highlightU: number;
|
|
487
|
-
readonly highlightV: number;
|
|
488
|
-
readonly textureVariation: number;
|
|
489
|
-
readonly hdrHighlightIntensity: number;
|
|
490
|
-
readonly hdrExposure: number;
|
|
491
|
-
} {
|
|
492
|
-
switch (preset) {
|
|
493
|
-
case "softbox":
|
|
494
|
-
return {
|
|
495
|
-
ambientColor: [0.48, 0.52, 0.58],
|
|
496
|
-
ambientIntensity: 0.18,
|
|
497
|
-
skyColor: [0.72, 0.82, 0.94],
|
|
498
|
-
horizonColor: [0.94, 0.88, 0.78],
|
|
499
|
-
groundColor: [0.18, 0.2, 0.22],
|
|
500
|
-
specularColor: [1, 0.95, 0.84],
|
|
501
|
-
environmentMapIntensity: 0.52,
|
|
502
|
-
environmentSpecularIntensity: 0.9,
|
|
503
|
-
environmentTextureIntensity: 0.42,
|
|
504
|
-
environmentTextureSpecularIntensity: 0.95,
|
|
505
|
-
rotation: 0.08,
|
|
506
|
-
highlightU: 0.28,
|
|
507
|
-
highlightV: 0.36,
|
|
508
|
-
textureVariation: 0.035,
|
|
509
|
-
hdrHighlightIntensity: 2.8,
|
|
510
|
-
hdrExposure: 0.86
|
|
511
|
-
};
|
|
512
|
-
case "inspection":
|
|
513
|
-
return {
|
|
514
|
-
ambientColor: [0.42, 0.5, 0.62],
|
|
515
|
-
ambientIntensity: 0.16,
|
|
516
|
-
skyColor: [0.48, 0.7, 0.96],
|
|
517
|
-
horizonColor: [0.78, 0.84, 0.88],
|
|
518
|
-
groundColor: [0.12, 0.13, 0.15],
|
|
519
|
-
specularColor: [0.72, 0.9, 1],
|
|
520
|
-
environmentMapIntensity: 0.55,
|
|
521
|
-
environmentSpecularIntensity: 0.82,
|
|
522
|
-
environmentTextureIntensity: 0.46,
|
|
523
|
-
environmentTextureSpecularIntensity: 0.84,
|
|
524
|
-
rotation: -0.04,
|
|
525
|
-
highlightU: 0.64,
|
|
526
|
-
highlightV: 0.42,
|
|
527
|
-
textureVariation: 0.028,
|
|
528
|
-
hdrHighlightIntensity: 2.35,
|
|
529
|
-
hdrExposure: 0.9
|
|
530
|
-
};
|
|
531
|
-
case "daylight":
|
|
532
|
-
return {
|
|
533
|
-
ambientColor: [0.5, 0.56, 0.62],
|
|
534
|
-
ambientIntensity: 0.2,
|
|
535
|
-
skyColor: [0.42, 0.66, 0.92],
|
|
536
|
-
horizonColor: [0.88, 0.82, 0.68],
|
|
537
|
-
groundColor: [0.26, 0.25, 0.22],
|
|
538
|
-
specularColor: [1, 0.9, 0.66],
|
|
539
|
-
environmentMapIntensity: 0.48,
|
|
540
|
-
environmentSpecularIntensity: 0.7,
|
|
541
|
-
environmentTextureIntensity: 0.4,
|
|
542
|
-
environmentTextureSpecularIntensity: 0.72,
|
|
543
|
-
rotation: 0.12,
|
|
544
|
-
highlightU: 0.18,
|
|
545
|
-
highlightV: 0.32,
|
|
546
|
-
textureVariation: 0.024,
|
|
547
|
-
hdrHighlightIntensity: 3.15,
|
|
548
|
-
hdrExposure: 0.82
|
|
549
|
-
};
|
|
550
|
-
case "exhibit":
|
|
551
|
-
return {
|
|
552
|
-
ambientColor: [0.34, 0.38, 0.44],
|
|
553
|
-
ambientIntensity: 0.16,
|
|
554
|
-
skyColor: [0.12, 0.16, 0.22],
|
|
555
|
-
horizonColor: [0.78, 0.64, 0.42],
|
|
556
|
-
groundColor: [0.08, 0.08, 0.09],
|
|
557
|
-
specularColor: [1, 0.72, 0.36],
|
|
558
|
-
environmentMapIntensity: 0.42,
|
|
559
|
-
environmentSpecularIntensity: 0.76,
|
|
560
|
-
environmentTextureIntensity: 0.38,
|
|
561
|
-
environmentTextureSpecularIntensity: 0.8,
|
|
562
|
-
rotation: 0.2,
|
|
563
|
-
highlightU: 0.48,
|
|
564
|
-
highlightV: 0.3,
|
|
565
|
-
textureVariation: 0.02,
|
|
566
|
-
hdrHighlightIntensity: 2.65,
|
|
567
|
-
hdrExposure: 0.88
|
|
568
|
-
};
|
|
569
|
-
case "evening":
|
|
570
|
-
return {
|
|
571
|
-
ambientColor: [0.28, 0.32, 0.48],
|
|
572
|
-
ambientIntensity: 0.18,
|
|
573
|
-
skyColor: [0.16, 0.2, 0.42],
|
|
574
|
-
horizonColor: [0.95, 0.48, 0.22],
|
|
575
|
-
groundColor: [0.09, 0.08, 0.12],
|
|
576
|
-
specularColor: [1, 0.54, 0.3],
|
|
577
|
-
environmentMapIntensity: 0.44,
|
|
578
|
-
environmentSpecularIntensity: 0.78,
|
|
579
|
-
environmentTextureIntensity: 0.36,
|
|
580
|
-
environmentTextureSpecularIntensity: 0.82,
|
|
581
|
-
rotation: -0.14,
|
|
582
|
-
highlightU: 0.72,
|
|
583
|
-
highlightV: 0.38,
|
|
584
|
-
textureVariation: 0.03,
|
|
585
|
-
hdrHighlightIntensity: 3,
|
|
586
|
-
hdrExposure: 0.84
|
|
587
|
-
};
|
|
588
|
-
case "gameplay":
|
|
589
|
-
return {
|
|
590
|
-
ambientColor: [0.34, 0.42, 0.5],
|
|
591
|
-
ambientIntensity: 0.18,
|
|
592
|
-
skyColor: [0.16, 0.38, 0.6],
|
|
593
|
-
horizonColor: [0.1, 0.72, 0.7],
|
|
594
|
-
groundColor: [0.08, 0.12, 0.18],
|
|
595
|
-
specularColor: [0.2, 0.96, 1],
|
|
596
|
-
environmentMapIntensity: 0.46,
|
|
597
|
-
environmentSpecularIntensity: 0.74,
|
|
598
|
-
environmentTextureIntensity: 0.34,
|
|
599
|
-
environmentTextureSpecularIntensity: 0.76,
|
|
600
|
-
rotation: 0.32,
|
|
601
|
-
highlightU: 0.54,
|
|
602
|
-
highlightV: 0.34,
|
|
603
|
-
textureVariation: 0.04,
|
|
604
|
-
hdrHighlightIntensity: 2.5,
|
|
605
|
-
hdrExposure: 0.9
|
|
606
|
-
};
|
|
607
|
-
case "studio":
|
|
608
|
-
return {
|
|
609
|
-
ambientColor: [0.44, 0.48, 0.54],
|
|
610
|
-
ambientIntensity: 0.18,
|
|
611
|
-
skyColor: [0.54, 0.66, 0.86],
|
|
612
|
-
horizonColor: [0.9, 0.82, 0.68],
|
|
613
|
-
groundColor: [0.12, 0.14, 0.16],
|
|
614
|
-
specularColor: [1, 0.92, 0.78],
|
|
615
|
-
environmentMapIntensity: 0.5,
|
|
616
|
-
environmentSpecularIntensity: 0.86,
|
|
617
|
-
environmentTextureIntensity: 0.44,
|
|
618
|
-
environmentTextureSpecularIntensity: 0.92,
|
|
619
|
-
rotation: 0.06,
|
|
620
|
-
highlightU: 0.36,
|
|
621
|
-
highlightV: 0.34,
|
|
622
|
-
textureVariation: 0.032,
|
|
623
|
-
hdrHighlightIntensity: 2.7,
|
|
624
|
-
hdrExposure: 0.86
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
function countNonDarkPixels(pixels: Uint8Array): number {
|
|
630
|
-
let count = 0;
|
|
631
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
632
|
-
if ((pixels[index] ?? 0) > 10 || (pixels[index + 1] ?? 0) > 10 || (pixels[index + 2] ?? 0) > 10) count += 1;
|
|
633
|
-
}
|
|
634
|
-
return count;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
function countColorBuckets(pixels: Uint8Array): number {
|
|
638
|
-
const buckets = new Set<string>();
|
|
639
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
640
|
-
const r = (pixels[index] ?? 0) >> 5;
|
|
641
|
-
const g = (pixels[index + 1] ?? 0) >> 5;
|
|
642
|
-
const b = (pixels[index + 2] ?? 0) >> 5;
|
|
643
|
-
if (r !== 0 || g !== 0 || b !== 0) buckets.add(`${r}:${g}:${b}`);
|
|
644
|
-
}
|
|
645
|
-
return buckets.size;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
function countMaskPixels(mask: Uint8Array): number {
|
|
649
|
-
let count = 0;
|
|
650
|
-
for (const value of mask) {
|
|
651
|
-
if (value > 0) count += 1;
|
|
652
|
-
}
|
|
653
|
-
return count;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
function countChangedPixels(before: Uint8Array, after: Uint8Array): number {
|
|
657
|
-
let count = 0;
|
|
658
|
-
for (let index = 0; index < before.length; index += 4) {
|
|
659
|
-
const delta = Math.abs((before[index] ?? 0) - (after[index] ?? 0))
|
|
660
|
-
+ Math.abs((before[index + 1] ?? 0) - (after[index + 1] ?? 0))
|
|
661
|
-
+ Math.abs((before[index + 2] ?? 0) - (after[index + 2] ?? 0));
|
|
662
|
-
if (delta > 8) count += 1;
|
|
663
|
-
}
|
|
664
|
-
return count;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
function toByte(value: number): number {
|
|
668
|
-
return Math.max(0, Math.min(255, Math.round(value * 255)));
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
export function externalParityActiveFeature(feature: ExternalParityRenderPresetFeature, evidence: string): ExternalParityRenderPresetFeatureStatus {
|
|
672
|
-
return {
|
|
673
|
-
feature,
|
|
674
|
-
state: "active",
|
|
675
|
-
evidence: requireMessage(evidence, "active feature evidence")
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
export function externalParityBlockedFeature(feature: ExternalParityRenderPresetFeature, reason: string): ExternalParityRenderPresetFeatureStatus {
|
|
680
|
-
return {
|
|
681
|
-
feature,
|
|
682
|
-
state: "blocked",
|
|
683
|
-
reason: requireMessage(reason, "blocked feature reason")
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
export function externalParityUnsupportedFeature(feature: ExternalParityRenderPresetFeature, reason: string): ExternalParityRenderPresetFeatureStatus {
|
|
688
|
-
return {
|
|
689
|
-
feature,
|
|
690
|
-
state: "unsupported",
|
|
691
|
-
reason: requireMessage(reason, "unsupported feature reason")
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
function normalizeFeatureStatuses(features: readonly ExternalParityRenderPresetFeatureStatus[]): readonly ExternalParityRenderPresetFeatureStatus[] {
|
|
696
|
-
const seen = new Set<ExternalParityRenderPresetFeature>();
|
|
697
|
-
return features.map((feature) => {
|
|
698
|
-
if (seen.has(feature.feature)) {
|
|
699
|
-
throw new Error(`Duplicate ExternalParity render preset feature: ${feature.feature}`);
|
|
700
|
-
}
|
|
701
|
-
seen.add(feature.feature);
|
|
702
|
-
if (feature.state === "active") {
|
|
703
|
-
return externalParityActiveFeature(feature.feature, feature.evidence ?? "");
|
|
704
|
-
}
|
|
705
|
-
if (feature.state === "blocked") {
|
|
706
|
-
return externalParityBlockedFeature(feature.feature, feature.reason ?? "");
|
|
707
|
-
}
|
|
708
|
-
return externalParityUnsupportedFeature(feature.feature, feature.reason ?? "");
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
function finitePositive(value: number, label: string): number {
|
|
713
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
714
|
-
throw new RangeError(`ExternalParity render preset ${label} must be a finite positive number.`);
|
|
715
|
-
}
|
|
716
|
-
return Number(value.toFixed(4));
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
function requireMessage(value: string, label: string): string {
|
|
720
|
-
const trimmed = value.trim();
|
|
721
|
-
if (!trimmed) {
|
|
722
|
-
throw new Error(`ExternalParity render preset ${label} is required.`);
|
|
723
|
-
}
|
|
724
|
-
return trimmed;
|
|
725
|
-
}
|