@rings-webgpu/core 1.0.10 → 1.0.12
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/rings.es.js +626 -415
- package/dist/rings.es.js.map +3 -3
- package/dist/rings.es.max.js +1190 -520
- package/dist/rings.umd.js +554 -343
- package/dist/rings.umd.js.map +3 -3
- package/dist/rings.umd.max.js +1193 -519
- package/dist/types/assets/shader/core/base/Common_frag.d.ts +3 -0
- package/dist/types/assets/shader/core/struct/VertexAttributes.d.ts +3 -0
- package/dist/types/assets/shader/lines/FatLineShader.d.ts +5 -0
- package/dist/types/assets/shader/materials/program/ShadowMapping_frag.d.ts +3 -0
- package/dist/types/components/renderer/FatLineRenderer.d.ts +38 -0
- package/dist/types/core/geometry/FatLineGeometry.d.ts +48 -0
- package/dist/types/index.d.ts +7 -1
- package/dist/types/loader/parser/prefab/mats/shader/FatLineShader.d.ts +11 -0
- package/dist/types/loader/parser/prefab/mats/shader/GSplatShader.d.ts +12 -0
- package/dist/types/materials/FatLineMaterial.d.ts +57 -0
- package/dist/types/materials/GSplatMaterial.d.ts +5 -0
- package/package.json +1 -1
- /package/dist/types/assets/shader/{materials → gsplat}/GSplatShader.d.ts +0 -0
package/dist/rings.umd.max.js
CHANGED
|
@@ -2120,7 +2120,7 @@
|
|
|
2120
2120
|
}
|
|
2121
2121
|
|
|
2122
2122
|
var __defProp$2 = Object.defineProperty;
|
|
2123
|
-
var __decorateClass$
|
|
2123
|
+
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
2124
2124
|
var result = void 0 ;
|
|
2125
2125
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2126
2126
|
if (decorator = decorators[i])
|
|
@@ -2223,10 +2223,10 @@
|
|
|
2223
2223
|
return struct.__size;
|
|
2224
2224
|
}
|
|
2225
2225
|
};
|
|
2226
|
-
__decorateClass$
|
|
2226
|
+
__decorateClass$m([
|
|
2227
2227
|
NonSerialize
|
|
2228
2228
|
], _Struct.prototype, "__refection");
|
|
2229
|
-
__decorateClass$
|
|
2229
|
+
__decorateClass$m([
|
|
2230
2230
|
NonSerialize
|
|
2231
2231
|
], _Struct.prototype, "__size");
|
|
2232
2232
|
let Struct = _Struct;
|
|
@@ -5032,18 +5032,20 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
|
|
|
5032
5032
|
}
|
|
5033
5033
|
}
|
|
5034
5034
|
|
|
5035
|
-
let VertexAttributes_vert =
|
|
5035
|
+
let VertexAttributes_vert = (
|
|
5036
|
+
/*wgsl*/
|
|
5037
|
+
`
|
|
5036
5038
|
var<private> PI: f32 = 3.14159265359;
|
|
5037
5039
|
#if USE_METAHUMAN
|
|
5038
5040
|
${MorphTarget_shader.getMorphTargetShaderBinding(3, 0)}
|
|
5039
|
-
${SkeletonAnimation_shader.groupBindingAndFunctions(3, 2)}
|
|
5041
|
+
${SkeletonAnimation_shader.groupBindingAndFunctions(3, 2)}
|
|
5040
5042
|
#else
|
|
5041
5043
|
#if USE_MORPHTARGETS
|
|
5042
5044
|
${MorphTarget_shader.getMorphTargetShaderBinding(3, 0)}
|
|
5043
5045
|
#endif
|
|
5044
5046
|
|
|
5045
5047
|
#if USE_SKELETON
|
|
5046
|
-
${SkeletonAnimation_shader.groupBindingAndFunctions(3, 0)}
|
|
5048
|
+
${SkeletonAnimation_shader.groupBindingAndFunctions(3, 0)}
|
|
5047
5049
|
#endif
|
|
5048
5050
|
#endif
|
|
5049
5051
|
|
|
@@ -5078,6 +5080,10 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
|
|
|
5078
5080
|
#endif
|
|
5079
5081
|
#endif
|
|
5080
5082
|
#else
|
|
5083
|
+
#if USE_TANGENT
|
|
5084
|
+
@location(auto) TANGENT: vec4<f32>,
|
|
5085
|
+
#endif
|
|
5086
|
+
|
|
5081
5087
|
#if USE_SKELETON
|
|
5082
5088
|
#if USE_TANGENT
|
|
5083
5089
|
@location(auto) joints0: vec4<f32>,
|
|
@@ -5124,6 +5130,7 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
|
|
|
5124
5130
|
#if USE_TANGENT
|
|
5125
5131
|
@location(auto) varying_Tangent: vec4<f32>,
|
|
5126
5132
|
#endif
|
|
5133
|
+
|
|
5127
5134
|
|
|
5128
5135
|
@builtin(position) member: vec4<f32>
|
|
5129
5136
|
};
|
|
@@ -5173,23 +5180,24 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
|
|
|
5173
5180
|
clipPosition.z = log2Depth(clipPosition.w, globalUniform.near, globalUniform.far);
|
|
5174
5181
|
#endif
|
|
5175
5182
|
|
|
5176
|
-
ORI_CameraWorldDir = normalize(ORI_CAMERAMATRIX[3].xyz - worldPos.xyz);
|
|
5183
|
+
ORI_CameraWorldDir = normalize(ORI_CAMERAMATRIX[3].xyz - worldPos.xyz) ;
|
|
5177
5184
|
|
|
5178
|
-
ORI_VertexOut.index = f32(vertex.index);
|
|
5185
|
+
ORI_VertexOut.index = f32(vertex.index) ;
|
|
5179
5186
|
|
|
5180
|
-
ORI_VertexOut.varying_UV0 = vertex.uv.xy;
|
|
5187
|
+
ORI_VertexOut.varying_UV0 = vertex.uv.xy ;
|
|
5181
5188
|
|
|
5182
5189
|
ORI_VertexOut.varying_UV1 = vertex.TEXCOORD_1.xy;
|
|
5183
5190
|
|
|
5184
|
-
ORI_VertexOut.varying_ViewPos = viewPosition;
|
|
5185
|
-
ORI_VertexOut.varying_Clip = clipPosition;
|
|
5186
|
-
ORI_VertexOut.varying_WPos = worldPos;
|
|
5191
|
+
ORI_VertexOut.varying_ViewPos = viewPosition ;
|
|
5192
|
+
ORI_VertexOut.varying_Clip = clipPosition ;
|
|
5193
|
+
ORI_VertexOut.varying_WPos = worldPos ;
|
|
5187
5194
|
ORI_VertexOut.varying_WPos.w = f32(vertex.index);
|
|
5188
|
-
ORI_VertexOut.varying_WNormal = normalize(ORI_NORMALMATRIX * vertexNormal.xyz);
|
|
5195
|
+
ORI_VertexOut.varying_WNormal = normalize(ORI_NORMALMATRIX * vertexNormal.xyz) ;
|
|
5189
5196
|
|
|
5190
|
-
ORI_VertexOut.member = clipPosition;
|
|
5197
|
+
ORI_VertexOut.member = clipPosition ;
|
|
5191
5198
|
}
|
|
5192
|
-
|
|
5199
|
+
`
|
|
5200
|
+
);
|
|
5193
5201
|
|
|
5194
5202
|
let VideoUniform_frag = `
|
|
5195
5203
|
struct MaterialUniform {
|
|
@@ -5308,68 +5316,90 @@ var<uniform> materialUniform: MaterialUniform;
|
|
|
5308
5316
|
`
|
|
5309
5317
|
);
|
|
5310
5318
|
|
|
5311
|
-
let Common_frag =
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
var<private> ORI_VertexVarying: FragmentVarying;
|
|
5321
|
-
var<private> ORI_ShadingInput: ShadingInput;
|
|
5322
|
-
var<private> viewDir:vec3<f32>;
|
|
5323
|
-
var<private> modelIndex:u32;
|
|
5319
|
+
let Common_frag = (
|
|
5320
|
+
/*wgsl*/
|
|
5321
|
+
`
|
|
5322
|
+
#include "GlobalUniform"
|
|
5323
|
+
#include "FragmentVarying"
|
|
5324
|
+
#include "FragmentOutput"
|
|
5325
|
+
#include "ShadingInput"
|
|
5326
|
+
#include "ColorUtil_frag"
|
|
5327
|
+
#include "BitUtil"
|
|
5324
5328
|
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5329
|
+
var<private> ORI_FragmentOutput: FragmentOutput;
|
|
5330
|
+
var<private> ORI_VertexVarying: FragmentVarying;
|
|
5331
|
+
var<private> ORI_ShadingInput: ShadingInput;
|
|
5332
|
+
var<private> viewDir:vec3<f32>;
|
|
5333
|
+
var<private> modelIndex:u32;
|
|
5334
|
+
|
|
5335
|
+
@fragment
|
|
5336
|
+
fn FragMain( vertex_varying:FragmentVarying ) -> FragmentOutput {
|
|
5330
5337
|
ORI_FragmentOutput.color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
|
5331
|
-
|
|
5332
|
-
|
|
5338
|
+
ORI_VertexVarying = vertex_varying;
|
|
5339
|
+
ORI_VertexVarying.vWorldNormal = normalize(vertex_varying.vWorldNormal);
|
|
5340
|
+
ORI_FragmentOutput.color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
|
5341
|
+
viewDir = normalize(globalUniform.CameraPos.xyz - ORI_VertexVarying.vWorldPos.xyz) ;
|
|
5333
5342
|
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5343
|
+
frag();
|
|
5344
|
+
|
|
5345
|
+
#if USE_DEBUG
|
|
5346
|
+
debugFragmentOut();
|
|
5347
|
+
#endif
|
|
5337
5348
|
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5349
|
+
#if USE_DEFAULTFRAGOUT
|
|
5350
|
+
// let finalMatrix = globalUniform.projMat * globalUniform.viewMat ;
|
|
5351
|
+
// let nMat = mat3x3<f32>(finalMatrix[0].xyz,finalMatrix[1].xyz,finalMatrix[2].xyz) ;
|
|
5352
|
+
// let ORI_NORMALMATRIX = transpose(inverse( nMat ));
|
|
5353
|
+
// var vNormal = normalize(ORI_NORMALMATRIX * (ORI_VertexVarying.vWorldNormal));
|
|
5354
|
+
|
|
5355
|
+
// let gBuffer = packNHMDGBuffer(
|
|
5356
|
+
// ORI_VertexVarying.fragCoord.z,
|
|
5357
|
+
// ORI_ShadingInput.BaseColor.rgb,
|
|
5358
|
+
// ORI_ShadingInput.BaseColor.rgb,
|
|
5359
|
+
// vec3f(ORI_ShadingInput.Roughness,ORI_ShadingInput.Metallic,ORI_ShadingInput.AmbientOcclusion),
|
|
5360
|
+
// ORI_ShadingInput.Normal,
|
|
5361
|
+
// ORI_ShadingInput.Opacity
|
|
5362
|
+
// ) ;
|
|
5363
|
+
#endif
|
|
5345
5364
|
|
|
5346
|
-
|
|
5347
|
-
|
|
5365
|
+
#if USE_OUTDEPTH
|
|
5366
|
+
#if USE_LOGDEPTH
|
|
5367
|
+
ORI_FragmentOutput.out_depth = log2DepthFixPersp(ORI_VertexVarying.fragPosition.w, globalUniform.near, globalUniform.far);
|
|
5368
|
+
#else
|
|
5369
|
+
ORI_FragmentOutput.out_depth = ORI_ShadingInput.FragDepth ;
|
|
5370
|
+
#endif
|
|
5371
|
+
#endif
|
|
5348
5372
|
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
var octUVNormal = (octEncode(normalize( (normal) )) + 1.0) * 0.5;
|
|
5352
|
-
var yc = f32(r11g11b9_to_float(vec3f(octUVNormal,rmao.r)));
|
|
5353
|
-
#if USE_CASTREFLECTION
|
|
5354
|
-
var rgbm = EncodeRGBM(hdrLighting);
|
|
5355
|
-
var zc = f32(pack4x8unorm(vec4f(rgbm.rgb,0.0))) ;
|
|
5356
|
-
var wc = f32(pack4x8unorm(vec4f(rmao.rg,rgbm.a,0.0)));
|
|
5357
|
-
#else
|
|
5358
|
-
var zc = f32(vec4fToFloat_7bits(vec4f(albedo.rgb,alpha)));
|
|
5359
|
-
var wc = f32(r22g8_to_float(vec2f(f32(modelIndex)/f_r22g8.r,rmao.g)));
|
|
5360
|
-
#endif
|
|
5373
|
+
return ORI_FragmentOutput ;
|
|
5374
|
+
}
|
|
5361
5375
|
|
|
5362
|
-
gBuffer.x = depth ;
|
|
5363
|
-
gBuffer.y = yc;
|
|
5364
|
-
gBuffer.z = zc;
|
|
5365
|
-
gBuffer.w = wc;
|
|
5366
|
-
return gBuffer;
|
|
5367
|
-
}
|
|
5368
5376
|
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5377
|
+
fn packNHMDGBuffer(depth:f32, albedo:vec3f,hdrLighting:vec3f,rmao:vec3f,normal:vec3f,alpha:f32) -> vec4f {
|
|
5378
|
+
var gBuffer : vec4f ;
|
|
5379
|
+
var octUVNormal = (octEncode(normalize( (normal) )) + 1.0) * 0.5 ;
|
|
5380
|
+
var yc = f32(r11g11b9_to_float(vec3f(octUVNormal,rmao.r))) ;
|
|
5381
|
+
#if USE_CASTREFLECTION
|
|
5382
|
+
var rgbm = EncodeRGBM(hdrLighting);
|
|
5383
|
+
var zc = f32(pack4x8unorm(vec4f(rgbm.rgb,0.0))) ;
|
|
5384
|
+
var wc = f32(pack4x8unorm(vec4f(rmao.rg,rgbm.a,0.0)));
|
|
5385
|
+
#else
|
|
5386
|
+
var zc = f32(vec4fToFloat_7bits(vec4f(albedo.rgb,alpha)));
|
|
5387
|
+
var wc = f32(r22g8_to_float(vec2f(f32(modelIndex)/f_r22g8.r,rmao.g)));
|
|
5388
|
+
#endif
|
|
5389
|
+
|
|
5390
|
+
gBuffer.x = depth ;
|
|
5391
|
+
gBuffer.y = yc ;
|
|
5392
|
+
gBuffer.z = zc ;
|
|
5393
|
+
gBuffer.w = wc ;
|
|
5394
|
+
return gBuffer ;
|
|
5395
|
+
}
|
|
5396
|
+
|
|
5397
|
+
fn transformUV( uv:vec2f , offsetScale:vec4f ) -> vec2f{
|
|
5398
|
+
return uv * offsetScale.zw + offsetScale.xy ;
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5401
|
+
`
|
|
5402
|
+
);
|
|
5373
5403
|
|
|
5374
5404
|
let Common_vert = (
|
|
5375
5405
|
/*wgsl*/
|
|
@@ -5739,6 +5769,7 @@ var<uniform> materialUniform: MaterialUniform;
|
|
|
5739
5769
|
let FragmentOutput = `
|
|
5740
5770
|
#if USE_CASTREFLECTION
|
|
5741
5771
|
struct FragmentOutput {
|
|
5772
|
+
@location(auto) color: vec4<f32>,
|
|
5742
5773
|
@location(auto) gBuffer: vec4<f32>,
|
|
5743
5774
|
#if USE_OUTDEPTH
|
|
5744
5775
|
@builtin(frag_depth) out_depth: f32
|
|
@@ -5811,202 +5842,219 @@ var<uniform> materialUniform: MaterialUniform;
|
|
|
5811
5842
|
}
|
|
5812
5843
|
`;
|
|
5813
5844
|
|
|
5814
|
-
let ShadowMapping_frag =
|
|
5815
|
-
|
|
5845
|
+
let ShadowMapping_frag = (
|
|
5846
|
+
/*wgsl*/
|
|
5847
|
+
`
|
|
5848
|
+
@group(1) @binding(auto) var shadowMapSampler: sampler_comparison;
|
|
5816
5849
|
@group(1) @binding(auto) var shadowMap: texture_depth_2d_array;
|
|
5817
|
-
@group(1) @binding(auto) var pointShadowMapSampler:
|
|
5850
|
+
@group(1) @binding(auto) var pointShadowMapSampler: sampler_comparison;
|
|
5818
5851
|
@group(1) @binding(auto) var pointShadowMap: texture_depth_cube_array;
|
|
5819
5852
|
|
|
5820
5853
|
var<private> directShadowVisibility: array<f32, 8>;
|
|
5821
5854
|
var<private> pointShadows: array<f32, 8>;
|
|
5822
|
-
var<private> shadowWeight: f32 = 1.0;
|
|
5855
|
+
var<private> shadowWeight: f32 = 1.0 ;
|
|
5823
5856
|
|
|
5824
5857
|
fn useShadow(){
|
|
5825
|
-
directShadowVisibility = array<f32, 8>(1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0);
|
|
5858
|
+
directShadowVisibility = array<f32, 8>( 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0) ;
|
|
5826
5859
|
pointShadows = array<f32, 8>(1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0) ;
|
|
5827
5860
|
directShadowMaping(globalUniform.shadowBias);
|
|
5828
5861
|
pointShadowMapCompare(globalUniform.pointShadowBias);
|
|
5829
5862
|
}
|
|
5830
5863
|
|
|
5831
5864
|
fn calcBasicBias(shadowWorldSize:f32, shadowDepthTexSize:f32, near:f32, far:f32) -> f32{
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5865
|
+
var bias = shadowWorldSize / shadowDepthTexSize;
|
|
5866
|
+
bias = bias / (far - near);
|
|
5867
|
+
return bias * 2.0;
|
|
5835
5868
|
}
|
|
5836
5869
|
|
|
5837
|
-
const dirCount:i32 = 8;
|
|
5838
|
-
const pointCount:i32 = 8;
|
|
5839
|
-
const csmCount:i32 = ${CSM.Cascades};
|
|
5870
|
+
const dirCount:i32 = 8 ;
|
|
5871
|
+
const pointCount:i32 = 8 ;
|
|
5872
|
+
const csmCount:i32 = ${CSM.Cascades} ;
|
|
5840
5873
|
var<private> csmLevel:i32 = -1;
|
|
5874
|
+
fn directShadowMaping(shadowBias: f32) {
|
|
5841
5875
|
|
|
5842
|
-
fn directShadowMaping(shadowBias: f32) {
|
|
5843
5876
|
let enableCSM:bool = globalUniform.enableCSM > 0.5;
|
|
5844
|
-
for(var i:i32 = 0; i < dirCount; i = i+1){
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
if(validCount >= 2 || totalWeight >= 0.99){
|
|
5878
|
-
csmLevel = csm;
|
|
5879
|
-
break;
|
|
5880
|
-
};
|
|
5881
|
-
}
|
|
5882
|
-
}
|
|
5883
|
-
|
|
5884
|
-
totalWeight += 0.0001;
|
|
5885
|
-
if(validCount == 0){
|
|
5886
|
-
visibility = 1.0;
|
|
5887
|
-
}else{
|
|
5888
|
-
visibility = visibility / totalWeight ;
|
|
5889
|
-
};
|
|
5890
|
-
} else {
|
|
5891
|
-
shadowMatrix = globalUniform.shadowMatrix[shadowIndex];
|
|
5892
|
-
if(enableCSM) {
|
|
5893
|
-
shadowIndex += csmCount - 1;
|
|
5894
|
-
}
|
|
5895
|
-
visibility = directShadowMapingIndex(light, shadowMatrix, shadowIndex, shadowBias).x;
|
|
5877
|
+
for (var i: i32 = 0; i < dirCount ; i = i + 1) {
|
|
5878
|
+
if( i >= globalUniform.nDirShadowStart && i < globalUniform.nDirShadowEnd ){
|
|
5879
|
+
let ldx = globalUniform.shadowLights[u32(i) / 4u][u32(i) % 4u];
|
|
5880
|
+
let light = lightBuffer[u32(ldx)] ;
|
|
5881
|
+
var shadowIndex = i32(light.castShadow);
|
|
5882
|
+
var visibility = 1.0;
|
|
5883
|
+
var shadowMatrix:mat4x4<f32>;
|
|
5884
|
+
#if USE_CSM
|
|
5885
|
+
if(enableCSM && shadowIndex == 0){
|
|
5886
|
+
var totalWeight = 0.0;
|
|
5887
|
+
visibility = 0.0;
|
|
5888
|
+
var validCount = 0;
|
|
5889
|
+
for(var csm:i32 = 0; csm < csmCount; csm ++){
|
|
5890
|
+
var csmShadowBias = globalUniform.csmShadowBias[csm] * shadowBias;
|
|
5891
|
+
shadowMatrix = globalUniform.csmMatrix[csm];
|
|
5892
|
+
let csmShadowResult = directShadowMapingIndex(light, shadowMatrix, csm, csmShadowBias);
|
|
5893
|
+
if(csmShadowResult.y < 0.5){
|
|
5894
|
+
validCount ++;
|
|
5895
|
+
|
|
5896
|
+
var uv = 2.0 * csmShadowResult.zw - vec2<f32>(1.0);
|
|
5897
|
+
uv = saturate(vec2<f32>(1.0) - abs(uv));
|
|
5898
|
+
uv /= clamp(globalUniform.csmMargin, 0.01, 0.5);
|
|
5899
|
+
var weight:f32 = min(uv.x, 1.0);
|
|
5900
|
+
weight = min(weight, uv.y);
|
|
5901
|
+
|
|
5902
|
+
if(validCount == 1 && csm == csmCount - 1){
|
|
5903
|
+
visibility = 1.0 - weight + csmShadowResult.x * weight;
|
|
5904
|
+
totalWeight = 1.0;
|
|
5905
|
+
}else{
|
|
5906
|
+
weight *= 1.0 - totalWeight;
|
|
5907
|
+
visibility += csmShadowResult.x * weight;
|
|
5908
|
+
totalWeight += weight;
|
|
5896
5909
|
}
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5910
|
+
// if(weight < 1.0){
|
|
5911
|
+
// visibility += 0.1;
|
|
5912
|
+
// }
|
|
5913
|
+
if(validCount >= 2 || totalWeight >= 0.99){
|
|
5914
|
+
csmLevel = csm;
|
|
5915
|
+
break;
|
|
5916
|
+
}
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5919
|
+
totalWeight += 0.0001;
|
|
5920
|
+
if(validCount == 0){
|
|
5921
|
+
visibility = 1.0;
|
|
5922
|
+
}else{
|
|
5923
|
+
visibility = visibility / totalWeight ;
|
|
5924
|
+
}
|
|
5925
|
+
}else{
|
|
5926
|
+
shadowMatrix = globalUniform.shadowMatrix[shadowIndex];
|
|
5927
|
+
if(enableCSM) {
|
|
5928
|
+
shadowIndex += csmCount - 1;
|
|
5929
|
+
}
|
|
5930
|
+
visibility = directShadowMapingIndex(light, shadowMatrix, shadowIndex, shadowBias).x;
|
|
5931
|
+
}
|
|
5932
|
+
#else
|
|
5933
|
+
shadowMatrix = globalUniform.shadowMatrix[shadowIndex];
|
|
5934
|
+
visibility = directShadowMapingIndex(light, shadowMatrix, shadowIndex, shadowBias).x;
|
|
5935
|
+
#endif
|
|
5936
|
+
directShadowVisibility[i] = visibility;
|
|
5937
|
+
}
|
|
5903
5938
|
}
|
|
5939
|
+
|
|
5904
5940
|
}
|
|
5905
5941
|
|
|
5906
|
-
fn directShadowMapingIndex(light:LightData, matrix:mat4x4<f32>, depthTexIndex:i32, shadowBias:f32) -> vec4<f32>
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5942
|
+
fn directShadowMapingIndex(light:LightData, matrix:mat4x4<f32>, depthTexIndex:i32, shadowBias:f32) -> vec4<f32>
|
|
5943
|
+
{
|
|
5944
|
+
var visibility = 1.0;
|
|
5945
|
+
var isOutSideArea:f32 = 1.0;
|
|
5946
|
+
var varying_shadowUV:vec2<f32> = vec2<f32>(0.0);
|
|
5947
|
+
#if USE_SHADOWMAPING
|
|
5948
|
+
var shadowPosTmp = matrix * vec4<f32>(ORI_VertexVarying.vWorldPos.xyz, 1.0);
|
|
5949
|
+
var shadowPos = shadowPosTmp.xyz / shadowPosTmp.w;
|
|
5950
|
+
varying_shadowUV = shadowPos.xy * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5, 0.5);
|
|
5951
|
+
if (varying_shadowUV.x <= 1.0
|
|
5952
|
+
&& varying_shadowUV.x >= 0.0
|
|
5953
|
+
&& varying_shadowUV.y <= 1.0
|
|
5954
|
+
&& varying_shadowUV.y >= 0.0
|
|
5955
|
+
&& shadowPosTmp.z <= 1.0
|
|
5956
|
+
&& shadowPosTmp.z >= 0.0)
|
|
5957
|
+
{
|
|
5958
|
+
visibility = 0.0;
|
|
5959
|
+
isOutSideArea = 0.0;
|
|
5960
|
+
var uvOnePixel = 1.0 / vec2<f32>(globalUniform.shadowMapSize) ;
|
|
5961
|
+
var totalWeight = 0.0;
|
|
5962
|
+
// var NoL = (dot(normalize(ORI_VertexVarying.vWorldNormal), normalize(-light.direction)));
|
|
5963
|
+
// let v = max(NoL, 0.0) ;
|
|
5964
|
+
// var bias = max(0.05 * (dot(normalize(fragData.N), normalize(-light.direction)) ), -shadowBias);
|
|
5965
|
+
var bias = -0.005 * max(dot(fragData.N, -light.direction) , 0.0 );
|
|
5966
|
+
bias = clamp(bias, 0, 0.01) + -shadowBias;
|
|
5967
|
+
|
|
5968
|
+
// var bias = shadowBias / v;
|
|
5969
|
+
let bound = 1 ;
|
|
5970
|
+
for (var y = -bound; y <= bound; y++) {
|
|
5971
|
+
for (var x = -bound; x <= bound; x++) {
|
|
5972
|
+
var offset = vec2<f32>(f32(x), f32(y)) ;
|
|
5973
|
+
var offsetUV = offset * uvOnePixel ;
|
|
5974
|
+
var weight = min(length(offset),1.0) ;
|
|
5975
|
+
var depth = textureSampleCompareLevel(shadowMap, shadowMapSampler, varying_shadowUV + offsetUV , depthTexIndex, shadowPos.z - bias);
|
|
5976
|
+
if (depth < 0.5) {
|
|
5977
|
+
totalWeight += 1.0;
|
|
5978
|
+
}else{
|
|
5979
|
+
visibility += weight;
|
|
5980
|
+
totalWeight += weight;
|
|
5940
5981
|
}
|
|
5941
|
-
visibility /= totalWeight;
|
|
5942
5982
|
}
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
let offset = 0.1;
|
|
5950
|
-
for(var i: i32 = 0; i < pointCount ; i = i + 1){
|
|
5951
|
-
if( i >= globalUniform.nPointShadowStart && i < globalUniform.nPointShadowEnd ){
|
|
5952
|
-
let ldx = globalUniform.shadowLights[u32(i) / 4u][u32(i) % 4u];
|
|
5953
|
-
let light = lightBuffer[u32(ldx)];
|
|
5954
|
-
|
|
5955
|
-
#if USE_SHADOWMAPING
|
|
5956
|
-
let lightPos = light.position.xyz;
|
|
5957
|
-
var shadow = 0.0;
|
|
5958
|
-
let frgToLight = worldPos - lightPos.xyz;
|
|
5959
|
-
var dir: vec3<f32> = normalize(frgToLight);
|
|
5960
|
-
var len = length(frgToLight);
|
|
5961
|
-
var bias = max(shadowBias * globalUniform.far * (1.0 - dot(ORI_ShadingInput.Normal, dir)), 0.005);
|
|
5962
|
-
|
|
5963
|
-
#if USE_PCF_SHADOW
|
|
5964
|
-
let samples = 4.0;
|
|
5965
|
-
let sampleOffset = offset / (samples * 0.5);
|
|
5966
|
-
for (var x: f32 = -offset; x < offset; x += sampleOffset) {
|
|
5967
|
-
for (var y: f32 = -offset; y < offset; y += sampleOffset) {
|
|
5968
|
-
for (var z: f32 = -offset; z < offset; z += sampleOffset) {
|
|
5969
|
-
let offsetDir = normalize(dir.xyz + vec3<f32>(x, y, z));
|
|
5970
|
-
var depth = textureSampleLevel(pointShadowMap, pointShadowMapSampler, offsetDir, light.castShadow, 0);
|
|
5971
|
-
depth *= globalUniform.far;
|
|
5972
|
-
if ((len - bias) > depth) {
|
|
5973
|
-
shadow += 1.0 * dot(offsetDir, dir.xyz);
|
|
5974
|
-
}
|
|
5975
|
-
}
|
|
5976
|
-
}
|
|
5977
|
-
}
|
|
5978
|
-
shadow = min(max(shadow / (samples * samples * samples), 0.0), 1.0);
|
|
5979
|
-
#endif
|
|
5983
|
+
}
|
|
5984
|
+
visibility /= totalWeight;
|
|
5985
|
+
}
|
|
5986
|
+
#endif
|
|
5987
|
+
return vec4<f32>(visibility, isOutSideArea, varying_shadowUV);
|
|
5988
|
+
}
|
|
5980
5989
|
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5990
|
+
fn pointShadowMapCompare(shadowBias: f32){
|
|
5991
|
+
let worldPos = ORI_VertexVarying.vWorldPos.xyz;
|
|
5992
|
+
let offset = 0.1;
|
|
5993
|
+
|
|
5994
|
+
for (var i: i32 = 0; i < pointCount ; i = i + 1) {
|
|
5995
|
+
if( i >= globalUniform.nPointShadowStart && i < globalUniform.nPointShadowEnd ){
|
|
5996
|
+
let ldx = globalUniform.shadowLights[u32(i) / 4u][u32(i) % 4u];
|
|
5997
|
+
let light = lightBuffer[u32(ldx)] ;
|
|
5998
|
+
|
|
5999
|
+
#if USE_SHADOWMAPING
|
|
6000
|
+
let lightPos = light.position.xyz;
|
|
6001
|
+
var shadow = 0.0;
|
|
6002
|
+
let frgToLight = worldPos - lightPos.xyz;
|
|
6003
|
+
var dir: vec3<f32> = normalize(frgToLight);
|
|
6004
|
+
var len = length(frgToLight);
|
|
6005
|
+
var bias = max(shadowBias * globalUniform.far * (1.0 - dot(ORI_ShadingInput.Normal, dir)), 0.005);
|
|
6006
|
+
|
|
6007
|
+
#if USE_PCF_SHADOW
|
|
6008
|
+
let samples = 4.0;
|
|
6009
|
+
let sampleOffset = offset / (samples * 0.5);
|
|
6010
|
+
for (var x: f32 = -offset; x < offset; x += sampleOffset) {
|
|
6011
|
+
for (var y: f32 = -offset; y < offset; y += sampleOffset) {
|
|
6012
|
+
for (var z: f32 = -offset; z < offset; z += sampleOffset) {
|
|
6013
|
+
let compareZ = (len - bias) / globalUniform.far;
|
|
6014
|
+
var depth = textureSampleCompareLevel(pointShadowMap, pointShadowMapSampler, dir.xyz, light.castShadow, compareZ);
|
|
6015
|
+
if (depth < 0.5) {
|
|
6016
|
+
shadow = 1.0;
|
|
5991
6017
|
}
|
|
6018
|
+
for (var j = 0; j < pointCount ; j+=1 ){
|
|
6019
|
+
if(i32(light.castShadow) == j){
|
|
6020
|
+
pointShadows[j] = 1.0 - shadow;
|
|
6021
|
+
}
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
5992
6024
|
}
|
|
5993
|
-
|
|
6025
|
+
}
|
|
6026
|
+
shadow = min(max(shadow / (samples * samples * samples), 0.0), 1.0);
|
|
5994
6027
|
#endif
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
6028
|
+
|
|
6029
|
+
#if USE_SOFT_SHADOW
|
|
6030
|
+
let vDis = length(globalUniform.CameraPos.xyz - worldPos.xyz);
|
|
6031
|
+
let sampleRadies = globalUniform.shadowSoft;
|
|
6032
|
+
let samples = 20;
|
|
6033
|
+
for (var j: i32 = 0; j < samples; j += 1) {
|
|
6034
|
+
let offsetDir = normalize(dir.xyz + sampleOffsetDir[j] * sampleRadies);
|
|
6035
|
+
var depth = textureSampleCompareLevel(pointShadowMap, pointShadowMapSampler, offsetDir, light.castShadow, 0);
|
|
5998
6036
|
depth *= globalUniform.far;
|
|
5999
6037
|
if ((len - bias) > depth) {
|
|
6000
|
-
|
|
6001
|
-
}
|
|
6002
|
-
#endif
|
|
6003
|
-
for (var j=0; j < pointCount; j+=1) {
|
|
6004
|
-
if(i32(light.castShadow) == j){
|
|
6005
|
-
pointShadows[j] = 1.0 - shadow;
|
|
6006
|
-
}
|
|
6038
|
+
shadow += 1.0 * dot(offsetDir, dir.xyz);
|
|
6007
6039
|
}
|
|
6008
|
-
|
|
6009
|
-
|
|
6040
|
+
}
|
|
6041
|
+
shadow = min(max(shadow / f32(samples), 0.0), 1.0);
|
|
6042
|
+
#endif
|
|
6043
|
+
|
|
6044
|
+
#if USE_HARD_SHADOW
|
|
6045
|
+
var depth = textureSampleCompareLevel(pointShadowMap, pointShadowMapSampler, dir.xyz, light.castShadow, 0);
|
|
6046
|
+
depth *= globalUniform.far;
|
|
6047
|
+
if ((len - bias) > depth) {
|
|
6048
|
+
shadow = 1.0;
|
|
6049
|
+
}
|
|
6050
|
+
#endif
|
|
6051
|
+
for (var j = 0; j < pointCount ; j+=1 ) {
|
|
6052
|
+
if(i32(light.castShadow) == j){
|
|
6053
|
+
pointShadows[j] = 1.0 - shadow ;
|
|
6054
|
+
}
|
|
6055
|
+
}
|
|
6056
|
+
#endif
|
|
6057
|
+
}
|
|
6010
6058
|
}
|
|
6011
6059
|
}
|
|
6012
6060
|
|
|
@@ -6019,7 +6067,8 @@ var<uniform> materialUniform: MaterialUniform;
|
|
|
6019
6067
|
vec3<f32>(0.0, 1.0, 1.0), vec3<f32>(0.0, -1.0, 1.0), vec3<f32>(0.0, -1.0, -1.0), vec3<f32>(0.0, 1.0, -1.0),
|
|
6020
6068
|
);
|
|
6021
6069
|
#endif
|
|
6022
|
-
|
|
6070
|
+
`
|
|
6071
|
+
);
|
|
6023
6072
|
|
|
6024
6073
|
let Irradiance_frag = `
|
|
6025
6074
|
#include "IrradianceVolumeData_frag"
|
|
@@ -9514,6 +9563,186 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
9514
9563
|
}
|
|
9515
9564
|
`;
|
|
9516
9565
|
|
|
9566
|
+
const FatLine_VS = (
|
|
9567
|
+
/* wgsl */
|
|
9568
|
+
`
|
|
9569
|
+
#include "GlobalUniform"
|
|
9570
|
+
|
|
9571
|
+
// Instance attributes stored in storage buffer
|
|
9572
|
+
// Extended with prevDir and nextDir for Line Join support
|
|
9573
|
+
struct InstanceData {
|
|
9574
|
+
start: vec3<f32>,
|
|
9575
|
+
_padding1: f32,
|
|
9576
|
+
end: vec3<f32>,
|
|
9577
|
+
_padding2: f32,
|
|
9578
|
+
colorStart: vec3<f32>,
|
|
9579
|
+
_padding3: f32,
|
|
9580
|
+
colorEnd: vec3<f32>,
|
|
9581
|
+
_padding4: f32,
|
|
9582
|
+
};
|
|
9583
|
+
|
|
9584
|
+
struct VertexInput {
|
|
9585
|
+
@builtin(instance_index) instanceIndex: u32,
|
|
9586
|
+
@location(0) position: vec3<f32>, // Quad vertices
|
|
9587
|
+
@location(1) uv: vec2<f32>, // UV coordinates
|
|
9588
|
+
};
|
|
9589
|
+
|
|
9590
|
+
struct VertexOutput {
|
|
9591
|
+
@builtin(position) position: vec4<f32>,
|
|
9592
|
+
@location(0) vUv: vec2<f32>,
|
|
9593
|
+
@location(1) vColor: vec3<f32>,
|
|
9594
|
+
};
|
|
9595
|
+
|
|
9596
|
+
struct MaterialUniform {
|
|
9597
|
+
baseColor: vec4<f32>,
|
|
9598
|
+
lineWidth: f32,
|
|
9599
|
+
opacity: f32,
|
|
9600
|
+
resolution: vec2<f32>,
|
|
9601
|
+
modelMatrix: mat4x4<f32>,
|
|
9602
|
+
};
|
|
9603
|
+
|
|
9604
|
+
@group(1) @binding(0) var<uniform> materialUniform: MaterialUniform;
|
|
9605
|
+
@group(1) @binding(1) var<storage, read> instances: array<InstanceData>;
|
|
9606
|
+
|
|
9607
|
+
@vertex
|
|
9608
|
+
fn VertMain(input: VertexInput) -> VertexOutput {
|
|
9609
|
+
var output: VertexOutput;
|
|
9610
|
+
|
|
9611
|
+
let instance = instances[input.instanceIndex];
|
|
9612
|
+
|
|
9613
|
+
// Transform from local space to world space, then to view space
|
|
9614
|
+
let start_world = materialUniform.modelMatrix * vec4<f32>(instance.start, 1.0);
|
|
9615
|
+
let end_world = materialUniform.modelMatrix * vec4<f32>(instance.end, 1.0);
|
|
9616
|
+
|
|
9617
|
+
let start_view = globalUniform.viewMat * start_world;
|
|
9618
|
+
let end_view = globalUniform.viewMat * end_world;
|
|
9619
|
+
|
|
9620
|
+
// Project to clip space
|
|
9621
|
+
var clip_start = globalUniform.projMat * start_view;
|
|
9622
|
+
var clip_end = globalUniform.projMat * end_view;
|
|
9623
|
+
|
|
9624
|
+
// Perspective division to NDC space
|
|
9625
|
+
let ndc_start = clip_start.xyz / clip_start.w;
|
|
9626
|
+
let ndc_end = clip_end.xyz / clip_end.w;
|
|
9627
|
+
|
|
9628
|
+
// Calculate screen-space direction
|
|
9629
|
+
var dir = ndc_end.xy - ndc_start.xy;
|
|
9630
|
+
|
|
9631
|
+
// Account for aspect ratio
|
|
9632
|
+
let aspect = materialUniform.resolution.x / materialUniform.resolution.y;
|
|
9633
|
+
dir.x *= aspect;
|
|
9634
|
+
dir = normalize(dir);
|
|
9635
|
+
|
|
9636
|
+
// Calculate perpendicular offset
|
|
9637
|
+
var offset = vec2<f32>(dir.y, -dir.x);
|
|
9638
|
+
|
|
9639
|
+
// Undo aspect ratio adjustment for both dir and offset
|
|
9640
|
+
dir.x /= aspect;
|
|
9641
|
+
offset.x /= aspect;
|
|
9642
|
+
|
|
9643
|
+
// Flip offset direction based on position.x
|
|
9644
|
+
if (input.position.x < 0.0) {
|
|
9645
|
+
offset *= -1.0;
|
|
9646
|
+
}
|
|
9647
|
+
|
|
9648
|
+
// Handle endcaps
|
|
9649
|
+
if (input.position.y < 0.0) {
|
|
9650
|
+
offset += -dir;
|
|
9651
|
+
} else if (input.position.y > 1.0) {
|
|
9652
|
+
offset += dir;
|
|
9653
|
+
}
|
|
9654
|
+
|
|
9655
|
+
// Apply line width
|
|
9656
|
+
offset *= materialUniform.lineWidth;
|
|
9657
|
+
offset /= materialUniform.resolution.y; // Convert to clip space
|
|
9658
|
+
|
|
9659
|
+
// Select start or end point
|
|
9660
|
+
var clip = select(clip_end, clip_start, input.position.y < 0.5);
|
|
9661
|
+
|
|
9662
|
+
// Shift the depth of the projected points so the line segments
|
|
9663
|
+
// overlap neatly and face the camera properly (billboard effect)
|
|
9664
|
+
let clipPose = select(ndc_end, ndc_start, input.position.y < 0.5);
|
|
9665
|
+
clip.z = clipPose.z * clip.w;
|
|
9666
|
+
|
|
9667
|
+
// Perspective correction
|
|
9668
|
+
offset *= clip.w;
|
|
9669
|
+
clip.x += offset.x;
|
|
9670
|
+
clip.y += offset.y;
|
|
9671
|
+
|
|
9672
|
+
output.position = clip;
|
|
9673
|
+
output.vUv = input.uv;
|
|
9674
|
+
output.vColor = select(instance.colorEnd, instance.colorStart, input.position.y < 0.5);
|
|
9675
|
+
|
|
9676
|
+
return output;
|
|
9677
|
+
}
|
|
9678
|
+
`
|
|
9679
|
+
);
|
|
9680
|
+
const FatLine_FS = (
|
|
9681
|
+
/* wgsl */
|
|
9682
|
+
`
|
|
9683
|
+
struct FragmentOutput {
|
|
9684
|
+
@location(0) color: vec4<f32>,
|
|
9685
|
+
@location(1) gBuffer: vec4<f32>,
|
|
9686
|
+
};
|
|
9687
|
+
|
|
9688
|
+
struct VertexOutput {
|
|
9689
|
+
@builtin(position) position: vec4<f32>,
|
|
9690
|
+
@location(0) vUv: vec2<f32>,
|
|
9691
|
+
@location(1) vColor: vec3<f32>,
|
|
9692
|
+
};
|
|
9693
|
+
|
|
9694
|
+
struct MaterialUniform {
|
|
9695
|
+
baseColor: vec4<f32>,
|
|
9696
|
+
lineWidth: f32,
|
|
9697
|
+
opacity: f32,
|
|
9698
|
+
resolution: vec2<f32>,
|
|
9699
|
+
modelMatrix: mat4x4<f32>,
|
|
9700
|
+
};
|
|
9701
|
+
|
|
9702
|
+
@group(1) @binding(0) var<uniform> materialUniform: MaterialUniform;
|
|
9703
|
+
|
|
9704
|
+
@fragment
|
|
9705
|
+
fn FragMain(input: VertexOutput) -> FragmentOutput {
|
|
9706
|
+
var output: FragmentOutput;
|
|
9707
|
+
|
|
9708
|
+
var alpha = materialUniform.opacity;
|
|
9709
|
+
|
|
9710
|
+
// Round endcap rendering with anti-aliasing
|
|
9711
|
+
let a = input.vUv.x;
|
|
9712
|
+
let b = select(input.vUv.y - 1.0, input.vUv.y + 1.0, input.vUv.y > 0.0);
|
|
9713
|
+
let len2 = a * a + b * b;
|
|
9714
|
+
|
|
9715
|
+
// Calculate derivative (must be in uniform control flow)
|
|
9716
|
+
let dlen = fwidth(len2);
|
|
9717
|
+
|
|
9718
|
+
// Round endcap rendering - simple approach
|
|
9719
|
+
if (abs(input.vUv.y) > 1.0) {
|
|
9720
|
+
// Determine circle center: (0, 1) for top, (0, -1) for bottom
|
|
9721
|
+
var basePoint = select(
|
|
9722
|
+
vec2<f32>(0.0, -1.0), // Bottom endcap
|
|
9723
|
+
vec2<f32>(0.0, 1.0), // Top endcap
|
|
9724
|
+
input.vUv.y > 0.0
|
|
9725
|
+
);
|
|
9726
|
+
|
|
9727
|
+
// Distance from UV to circle center
|
|
9728
|
+
// var dist = length(input.vUv - basePoint);
|
|
9729
|
+
var dist2 = (input.vUv.x - basePoint.x) * (input.vUv.x - basePoint.x) + (input.vUv.y - basePoint.y) * (input.vUv.y - basePoint.y);
|
|
9730
|
+
|
|
9731
|
+
// Discard pixels outside circle (radius = 1.0)
|
|
9732
|
+
if (dist2 > 1.0) {
|
|
9733
|
+
discard;
|
|
9734
|
+
}
|
|
9735
|
+
}
|
|
9736
|
+
|
|
9737
|
+
let color = input.vColor * materialUniform.baseColor.rgb;
|
|
9738
|
+
output.color = vec4<f32>(color, alpha);
|
|
9739
|
+
output.gBuffer = vec4<f32>(0.0, 0.0, 0.0, 0.0); // No GBuffer data for lines
|
|
9740
|
+
|
|
9741
|
+
return output;
|
|
9742
|
+
}
|
|
9743
|
+
`
|
|
9744
|
+
);
|
|
9745
|
+
|
|
9517
9746
|
class ShaderLib {
|
|
9518
9747
|
static init() {
|
|
9519
9748
|
ShaderLib.register("MathShader", MathShader);
|
|
@@ -9583,6 +9812,8 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
9583
9812
|
);
|
|
9584
9813
|
ShaderLib.register("ZPass_shader_vs", ZPassShader_vs);
|
|
9585
9814
|
ShaderLib.register("ZPass_shader_fs", ZPassShader_fs);
|
|
9815
|
+
ShaderLib.register("FatLine_VS", FatLine_VS);
|
|
9816
|
+
ShaderLib.register("FatLine_FS", FatLine_FS);
|
|
9586
9817
|
}
|
|
9587
9818
|
static register(keyName, code) {
|
|
9588
9819
|
if (!ShaderLib[keyName.toLowerCase()]) {
|
|
@@ -21669,9 +21900,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
21669
21900
|
}
|
|
21670
21901
|
|
|
21671
21902
|
var __defProp$1 = Object.defineProperty;
|
|
21672
|
-
var __getOwnPropDesc$
|
|
21673
|
-
var __decorateClass$
|
|
21674
|
-
var result = __getOwnPropDesc$
|
|
21903
|
+
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
21904
|
+
var __decorateClass$l = (decorators, target, key, kind) => {
|
|
21905
|
+
var result = __getOwnPropDesc$l(target, key) ;
|
|
21675
21906
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21676
21907
|
if (decorator = decorators[i])
|
|
21677
21908
|
result = (decorator(target, key, result) ) || result;
|
|
@@ -22256,221 +22487,16 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
22256
22487
|
this._combineShaderRefection = void 0;
|
|
22257
22488
|
}
|
|
22258
22489
|
}
|
|
22259
|
-
__decorateClass$
|
|
22490
|
+
__decorateClass$l([
|
|
22260
22491
|
EditorInspector
|
|
22261
22492
|
], RenderNode.prototype, "materials");
|
|
22262
|
-
__decorateClass$
|
|
22493
|
+
__decorateClass$l([
|
|
22263
22494
|
EditorInspector
|
|
22264
22495
|
], RenderNode.prototype, "castShadow");
|
|
22265
|
-
__decorateClass$
|
|
22496
|
+
__decorateClass$l([
|
|
22266
22497
|
EditorInspector
|
|
22267
22498
|
], RenderNode.prototype, "castGI");
|
|
22268
22499
|
|
|
22269
|
-
class Shader {
|
|
22270
|
-
computes;
|
|
22271
|
-
passShader;
|
|
22272
|
-
constructor() {
|
|
22273
|
-
this.computes = [];
|
|
22274
|
-
this.passShader = /* @__PURE__ */ new Map();
|
|
22275
|
-
}
|
|
22276
|
-
addRenderPass(renderShader, index = -1) {
|
|
22277
|
-
let subShader = this.passShader.get(renderShader.passType) || [];
|
|
22278
|
-
if (index == -1) {
|
|
22279
|
-
subShader.push(renderShader);
|
|
22280
|
-
} else {
|
|
22281
|
-
subShader.splice(index, -1, renderShader);
|
|
22282
|
-
}
|
|
22283
|
-
this.passShader.set(renderShader.passType, subShader);
|
|
22284
|
-
}
|
|
22285
|
-
removeShader(renderShader, index = -1) {
|
|
22286
|
-
let subShader = this.passShader.get(
|
|
22287
|
-
renderShader.passType
|
|
22288
|
-
);
|
|
22289
|
-
if (subShader) {
|
|
22290
|
-
if (index == -1) {
|
|
22291
|
-
let index2 = subShader.indexOf(renderShader);
|
|
22292
|
-
if (index2 != -1) {
|
|
22293
|
-
subShader.splice(index2);
|
|
22294
|
-
}
|
|
22295
|
-
} else {
|
|
22296
|
-
subShader.splice(index, 1);
|
|
22297
|
-
}
|
|
22298
|
-
}
|
|
22299
|
-
}
|
|
22300
|
-
removeShaderByIndex(passType, index = -1) {
|
|
22301
|
-
let subShader = this.passShader.get(passType);
|
|
22302
|
-
if (subShader) {
|
|
22303
|
-
if (index == -1) {
|
|
22304
|
-
this.passShader.delete(passType);
|
|
22305
|
-
} else {
|
|
22306
|
-
subShader.splice(index, 1);
|
|
22307
|
-
}
|
|
22308
|
-
}
|
|
22309
|
-
}
|
|
22310
|
-
getSubShaders(passType) {
|
|
22311
|
-
return this.passShader.get(passType) || [];
|
|
22312
|
-
}
|
|
22313
|
-
hasSubShaders(passType) {
|
|
22314
|
-
let subs = this.passShader.get(passType);
|
|
22315
|
-
return subs.length > 0;
|
|
22316
|
-
}
|
|
22317
|
-
getDefaultShaders() {
|
|
22318
|
-
return this.passShader.get(PassType.COLOR);
|
|
22319
|
-
}
|
|
22320
|
-
getDefaultColorShader() {
|
|
22321
|
-
return this.passShader.get(PassType.COLOR)[0];
|
|
22322
|
-
}
|
|
22323
|
-
setDefine(arg0, arg1) {
|
|
22324
|
-
for (const pass of this.passShader) {
|
|
22325
|
-
for (const rd of pass[1]) {
|
|
22326
|
-
rd.setDefine(arg0, arg1);
|
|
22327
|
-
}
|
|
22328
|
-
}
|
|
22329
|
-
}
|
|
22330
|
-
hasDefine(arg0) {
|
|
22331
|
-
for (const pass of this.passShader) {
|
|
22332
|
-
for (const rd of pass[1]) {
|
|
22333
|
-
let has = rd.hasDefine(arg0);
|
|
22334
|
-
if (has) return has;
|
|
22335
|
-
}
|
|
22336
|
-
}
|
|
22337
|
-
return false;
|
|
22338
|
-
}
|
|
22339
|
-
deleteDefine(arg0) {
|
|
22340
|
-
for (const pass of this.passShader) {
|
|
22341
|
-
for (const rd of pass[1]) {
|
|
22342
|
-
rd.deleteDefine(arg0);
|
|
22343
|
-
}
|
|
22344
|
-
}
|
|
22345
|
-
}
|
|
22346
|
-
setUniform(arg0, arg1) {
|
|
22347
|
-
for (const pass of this.passShader) {
|
|
22348
|
-
for (const rd of pass[1]) {
|
|
22349
|
-
rd.setUniform(arg0, arg1);
|
|
22350
|
-
}
|
|
22351
|
-
}
|
|
22352
|
-
}
|
|
22353
|
-
setUniformFloat(arg0, arg1) {
|
|
22354
|
-
for (const pass of this.passShader) {
|
|
22355
|
-
for (const rd of pass[1]) {
|
|
22356
|
-
rd.setUniformFloat(arg0, arg1);
|
|
22357
|
-
}
|
|
22358
|
-
}
|
|
22359
|
-
}
|
|
22360
|
-
setUniformVector2(arg0, arg1) {
|
|
22361
|
-
for (const pass of this.passShader) {
|
|
22362
|
-
for (const rd of pass[1]) {
|
|
22363
|
-
rd.setUniformVector2(arg0, arg1);
|
|
22364
|
-
}
|
|
22365
|
-
}
|
|
22366
|
-
}
|
|
22367
|
-
setUniformVector3(arg0, arg1) {
|
|
22368
|
-
for (const pass of this.passShader) {
|
|
22369
|
-
for (const rd of pass[1]) {
|
|
22370
|
-
rd.setUniformVector3(arg0, arg1);
|
|
22371
|
-
}
|
|
22372
|
-
}
|
|
22373
|
-
}
|
|
22374
|
-
setUniformVector4(arg0, arg1) {
|
|
22375
|
-
for (const pass of this.passShader) {
|
|
22376
|
-
for (const rd of pass[1]) {
|
|
22377
|
-
rd.setUniformVector4(arg0, arg1);
|
|
22378
|
-
}
|
|
22379
|
-
}
|
|
22380
|
-
}
|
|
22381
|
-
setUniformColor(arg0, arg1) {
|
|
22382
|
-
for (const pass of this.passShader) {
|
|
22383
|
-
for (const rd of pass[1]) {
|
|
22384
|
-
rd.setUniformColor(arg0, arg1);
|
|
22385
|
-
}
|
|
22386
|
-
}
|
|
22387
|
-
}
|
|
22388
|
-
getUniform(arg0) {
|
|
22389
|
-
return this.getDefaultColorShader().getUniform(arg0);
|
|
22390
|
-
}
|
|
22391
|
-
getUniformFloat(arg0) {
|
|
22392
|
-
return this.getDefaultColorShader().getUniformFloat(arg0);
|
|
22393
|
-
}
|
|
22394
|
-
getUniformVector2(arg0) {
|
|
22395
|
-
return this.getDefaultColorShader().getUniformVector2(arg0);
|
|
22396
|
-
}
|
|
22397
|
-
getUniformVector3(arg0) {
|
|
22398
|
-
return this.getDefaultColorShader().getUniformVector3(arg0);
|
|
22399
|
-
}
|
|
22400
|
-
getUniformVector4(arg0) {
|
|
22401
|
-
return this.getDefaultColorShader().getUniformVector4(arg0);
|
|
22402
|
-
}
|
|
22403
|
-
getUniformColor(arg0) {
|
|
22404
|
-
return this.getDefaultColorShader().getUniformColor(arg0);
|
|
22405
|
-
}
|
|
22406
|
-
setTexture(arg0, arg1) {
|
|
22407
|
-
for (const pass of this.passShader) {
|
|
22408
|
-
for (const rd of pass[1]) {
|
|
22409
|
-
rd.setTexture(arg0, arg1);
|
|
22410
|
-
}
|
|
22411
|
-
}
|
|
22412
|
-
this.setDefine(`USE_${arg0.toLocaleUpperCase()}`, true);
|
|
22413
|
-
}
|
|
22414
|
-
getTexture(arg0) {
|
|
22415
|
-
return this.getDefaultColorShader().textures[arg0];
|
|
22416
|
-
}
|
|
22417
|
-
setUniformBuffer(arg0, arg1) {
|
|
22418
|
-
for (const pass of this.passShader) {
|
|
22419
|
-
for (const rd of pass[1]) {
|
|
22420
|
-
rd.setUniformBuffer(arg0, arg1);
|
|
22421
|
-
}
|
|
22422
|
-
}
|
|
22423
|
-
}
|
|
22424
|
-
getUniformBuffer(arg0) {
|
|
22425
|
-
return this.getDefaultColorShader().getBuffer(arg0);
|
|
22426
|
-
}
|
|
22427
|
-
setStorageBuffer(arg0, arg1) {
|
|
22428
|
-
for (const pass of this.passShader) {
|
|
22429
|
-
for (const rd of pass[1]) {
|
|
22430
|
-
rd.setStorageBuffer(arg0, arg1);
|
|
22431
|
-
}
|
|
22432
|
-
}
|
|
22433
|
-
}
|
|
22434
|
-
getStorageBuffer(arg0) {
|
|
22435
|
-
return this.getDefaultColorShader().getBuffer(arg0);
|
|
22436
|
-
}
|
|
22437
|
-
setStructStorageBuffer(arg0, arg1) {
|
|
22438
|
-
for (const pass of this.passShader) {
|
|
22439
|
-
for (const rd of pass[1]) {
|
|
22440
|
-
rd.setStructStorageBuffer(arg0, arg1);
|
|
22441
|
-
}
|
|
22442
|
-
}
|
|
22443
|
-
}
|
|
22444
|
-
getStructStorageBuffer(arg0) {
|
|
22445
|
-
return this.getDefaultColorShader().getBuffer(arg0);
|
|
22446
|
-
}
|
|
22447
|
-
noticeValueChange() {
|
|
22448
|
-
for (const pass of this.passShader) {
|
|
22449
|
-
for (const rd of pass[1]) {
|
|
22450
|
-
rd.noticeValueChange();
|
|
22451
|
-
}
|
|
22452
|
-
}
|
|
22453
|
-
}
|
|
22454
|
-
destroy() {
|
|
22455
|
-
this.getDefaultColorShader().destroy();
|
|
22456
|
-
}
|
|
22457
|
-
clone() {
|
|
22458
|
-
let newShader = new Shader();
|
|
22459
|
-
let sourceShaderPassList = this.getDefaultShaders();
|
|
22460
|
-
for (const shadePass of sourceShaderPassList) {
|
|
22461
|
-
newShader.addRenderPass(shadePass);
|
|
22462
|
-
}
|
|
22463
|
-
return newShader;
|
|
22464
|
-
}
|
|
22465
|
-
applyUniform() {
|
|
22466
|
-
for (const pass of this.passShader) {
|
|
22467
|
-
for (const rd of pass[1]) {
|
|
22468
|
-
rd.applyUniform();
|
|
22469
|
-
}
|
|
22470
|
-
}
|
|
22471
|
-
}
|
|
22472
|
-
}
|
|
22473
|
-
|
|
22474
22500
|
class Material {
|
|
22475
22501
|
instanceID;
|
|
22476
22502
|
name;
|
|
@@ -22954,11 +22980,222 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
22954
22980
|
`
|
|
22955
22981
|
);
|
|
22956
22982
|
|
|
22957
|
-
class
|
|
22983
|
+
class Shader {
|
|
22984
|
+
computes;
|
|
22985
|
+
passShader;
|
|
22986
|
+
constructor() {
|
|
22987
|
+
this.computes = [];
|
|
22988
|
+
this.passShader = /* @__PURE__ */ new Map();
|
|
22989
|
+
}
|
|
22990
|
+
addRenderPass(renderShader, index = -1) {
|
|
22991
|
+
let subShader = this.passShader.get(renderShader.passType) || [];
|
|
22992
|
+
if (index == -1) {
|
|
22993
|
+
subShader.push(renderShader);
|
|
22994
|
+
} else {
|
|
22995
|
+
subShader.splice(index, -1, renderShader);
|
|
22996
|
+
}
|
|
22997
|
+
this.passShader.set(renderShader.passType, subShader);
|
|
22998
|
+
}
|
|
22999
|
+
removeShader(renderShader, index = -1) {
|
|
23000
|
+
let subShader = this.passShader.get(
|
|
23001
|
+
renderShader.passType
|
|
23002
|
+
);
|
|
23003
|
+
if (subShader) {
|
|
23004
|
+
if (index == -1) {
|
|
23005
|
+
let index2 = subShader.indexOf(renderShader);
|
|
23006
|
+
if (index2 != -1) {
|
|
23007
|
+
subShader.splice(index2);
|
|
23008
|
+
}
|
|
23009
|
+
} else {
|
|
23010
|
+
subShader.splice(index, 1);
|
|
23011
|
+
}
|
|
23012
|
+
}
|
|
23013
|
+
}
|
|
23014
|
+
removeShaderByIndex(passType, index = -1) {
|
|
23015
|
+
let subShader = this.passShader.get(passType);
|
|
23016
|
+
if (subShader) {
|
|
23017
|
+
if (index == -1) {
|
|
23018
|
+
this.passShader.delete(passType);
|
|
23019
|
+
} else {
|
|
23020
|
+
subShader.splice(index, 1);
|
|
23021
|
+
}
|
|
23022
|
+
}
|
|
23023
|
+
}
|
|
23024
|
+
getSubShaders(passType) {
|
|
23025
|
+
return this.passShader.get(passType) || [];
|
|
23026
|
+
}
|
|
23027
|
+
hasSubShaders(passType) {
|
|
23028
|
+
let subs = this.passShader.get(passType);
|
|
23029
|
+
return subs.length > 0;
|
|
23030
|
+
}
|
|
23031
|
+
getDefaultShaders() {
|
|
23032
|
+
return this.passShader.get(PassType.COLOR);
|
|
23033
|
+
}
|
|
23034
|
+
getDefaultColorShader() {
|
|
23035
|
+
return this.passShader.get(PassType.COLOR)[0];
|
|
23036
|
+
}
|
|
23037
|
+
setDefine(arg0, arg1) {
|
|
23038
|
+
for (const pass of this.passShader) {
|
|
23039
|
+
for (const rd of pass[1]) {
|
|
23040
|
+
rd.setDefine(arg0, arg1);
|
|
23041
|
+
}
|
|
23042
|
+
}
|
|
23043
|
+
}
|
|
23044
|
+
hasDefine(arg0) {
|
|
23045
|
+
for (const pass of this.passShader) {
|
|
23046
|
+
for (const rd of pass[1]) {
|
|
23047
|
+
let has = rd.hasDefine(arg0);
|
|
23048
|
+
if (has) return has;
|
|
23049
|
+
}
|
|
23050
|
+
}
|
|
23051
|
+
return false;
|
|
23052
|
+
}
|
|
23053
|
+
deleteDefine(arg0) {
|
|
23054
|
+
for (const pass of this.passShader) {
|
|
23055
|
+
for (const rd of pass[1]) {
|
|
23056
|
+
rd.deleteDefine(arg0);
|
|
23057
|
+
}
|
|
23058
|
+
}
|
|
23059
|
+
}
|
|
23060
|
+
setUniform(arg0, arg1) {
|
|
23061
|
+
for (const pass of this.passShader) {
|
|
23062
|
+
for (const rd of pass[1]) {
|
|
23063
|
+
rd.setUniform(arg0, arg1);
|
|
23064
|
+
}
|
|
23065
|
+
}
|
|
23066
|
+
}
|
|
23067
|
+
setUniformFloat(arg0, arg1) {
|
|
23068
|
+
for (const pass of this.passShader) {
|
|
23069
|
+
for (const rd of pass[1]) {
|
|
23070
|
+
rd.setUniformFloat(arg0, arg1);
|
|
23071
|
+
}
|
|
23072
|
+
}
|
|
23073
|
+
}
|
|
23074
|
+
setUniformVector2(arg0, arg1) {
|
|
23075
|
+
for (const pass of this.passShader) {
|
|
23076
|
+
for (const rd of pass[1]) {
|
|
23077
|
+
rd.setUniformVector2(arg0, arg1);
|
|
23078
|
+
}
|
|
23079
|
+
}
|
|
23080
|
+
}
|
|
23081
|
+
setUniformVector3(arg0, arg1) {
|
|
23082
|
+
for (const pass of this.passShader) {
|
|
23083
|
+
for (const rd of pass[1]) {
|
|
23084
|
+
rd.setUniformVector3(arg0, arg1);
|
|
23085
|
+
}
|
|
23086
|
+
}
|
|
23087
|
+
}
|
|
23088
|
+
setUniformVector4(arg0, arg1) {
|
|
23089
|
+
for (const pass of this.passShader) {
|
|
23090
|
+
for (const rd of pass[1]) {
|
|
23091
|
+
rd.setUniformVector4(arg0, arg1);
|
|
23092
|
+
}
|
|
23093
|
+
}
|
|
23094
|
+
}
|
|
23095
|
+
setUniformColor(arg0, arg1) {
|
|
23096
|
+
for (const pass of this.passShader) {
|
|
23097
|
+
for (const rd of pass[1]) {
|
|
23098
|
+
rd.setUniformColor(arg0, arg1);
|
|
23099
|
+
}
|
|
23100
|
+
}
|
|
23101
|
+
}
|
|
23102
|
+
getUniform(arg0) {
|
|
23103
|
+
return this.getDefaultColorShader().getUniform(arg0);
|
|
23104
|
+
}
|
|
23105
|
+
getUniformFloat(arg0) {
|
|
23106
|
+
return this.getDefaultColorShader().getUniformFloat(arg0);
|
|
23107
|
+
}
|
|
23108
|
+
getUniformVector2(arg0) {
|
|
23109
|
+
return this.getDefaultColorShader().getUniformVector2(arg0);
|
|
23110
|
+
}
|
|
23111
|
+
getUniformVector3(arg0) {
|
|
23112
|
+
return this.getDefaultColorShader().getUniformVector3(arg0);
|
|
23113
|
+
}
|
|
23114
|
+
getUniformVector4(arg0) {
|
|
23115
|
+
return this.getDefaultColorShader().getUniformVector4(arg0);
|
|
23116
|
+
}
|
|
23117
|
+
getUniformColor(arg0) {
|
|
23118
|
+
return this.getDefaultColorShader().getUniformColor(arg0);
|
|
23119
|
+
}
|
|
23120
|
+
setTexture(arg0, arg1) {
|
|
23121
|
+
for (const pass of this.passShader) {
|
|
23122
|
+
for (const rd of pass[1]) {
|
|
23123
|
+
rd.setTexture(arg0, arg1);
|
|
23124
|
+
}
|
|
23125
|
+
}
|
|
23126
|
+
this.setDefine(`USE_${arg0.toLocaleUpperCase()}`, true);
|
|
23127
|
+
}
|
|
23128
|
+
getTexture(arg0) {
|
|
23129
|
+
return this.getDefaultColorShader().textures[arg0];
|
|
23130
|
+
}
|
|
23131
|
+
setUniformBuffer(arg0, arg1) {
|
|
23132
|
+
for (const pass of this.passShader) {
|
|
23133
|
+
for (const rd of pass[1]) {
|
|
23134
|
+
rd.setUniformBuffer(arg0, arg1);
|
|
23135
|
+
}
|
|
23136
|
+
}
|
|
23137
|
+
}
|
|
23138
|
+
getUniformBuffer(arg0) {
|
|
23139
|
+
return this.getDefaultColorShader().getBuffer(arg0);
|
|
23140
|
+
}
|
|
23141
|
+
setStorageBuffer(arg0, arg1) {
|
|
23142
|
+
for (const pass of this.passShader) {
|
|
23143
|
+
for (const rd of pass[1]) {
|
|
23144
|
+
rd.setStorageBuffer(arg0, arg1);
|
|
23145
|
+
}
|
|
23146
|
+
}
|
|
23147
|
+
}
|
|
23148
|
+
getStorageBuffer(arg0) {
|
|
23149
|
+
return this.getDefaultColorShader().getBuffer(arg0);
|
|
23150
|
+
}
|
|
23151
|
+
setStructStorageBuffer(arg0, arg1) {
|
|
23152
|
+
for (const pass of this.passShader) {
|
|
23153
|
+
for (const rd of pass[1]) {
|
|
23154
|
+
rd.setStructStorageBuffer(arg0, arg1);
|
|
23155
|
+
}
|
|
23156
|
+
}
|
|
23157
|
+
}
|
|
23158
|
+
getStructStorageBuffer(arg0) {
|
|
23159
|
+
return this.getDefaultColorShader().getBuffer(arg0);
|
|
23160
|
+
}
|
|
23161
|
+
noticeValueChange() {
|
|
23162
|
+
for (const pass of this.passShader) {
|
|
23163
|
+
for (const rd of pass[1]) {
|
|
23164
|
+
rd.noticeValueChange();
|
|
23165
|
+
}
|
|
23166
|
+
}
|
|
23167
|
+
}
|
|
23168
|
+
destroy() {
|
|
23169
|
+
this.getDefaultColorShader().destroy();
|
|
23170
|
+
}
|
|
23171
|
+
clone() {
|
|
23172
|
+
let newShader = new Shader();
|
|
23173
|
+
let sourceShaderPassList = this.getDefaultShaders();
|
|
23174
|
+
for (const shadePass of sourceShaderPassList) {
|
|
23175
|
+
newShader.addRenderPass(shadePass);
|
|
23176
|
+
}
|
|
23177
|
+
return newShader;
|
|
23178
|
+
}
|
|
23179
|
+
applyUniform() {
|
|
23180
|
+
for (const pass of this.passShader) {
|
|
23181
|
+
for (const rd of pass[1]) {
|
|
23182
|
+
rd.applyUniform();
|
|
23183
|
+
}
|
|
23184
|
+
}
|
|
23185
|
+
}
|
|
23186
|
+
}
|
|
23187
|
+
|
|
23188
|
+
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
23189
|
+
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
23190
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
23191
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23192
|
+
if (decorator = decorators[i])
|
|
23193
|
+
result = (decorator(result)) || result;
|
|
23194
|
+
return result;
|
|
23195
|
+
};
|
|
23196
|
+
exports.GSplatShader = class GSplatShader extends Shader {
|
|
22958
23197
|
constructor() {
|
|
22959
23198
|
super();
|
|
22960
|
-
ShaderLib.register("gsplat_vs_dc", GSplat_VS);
|
|
22961
|
-
ShaderLib.register("gsplat_fs_dc", GSplat_FS);
|
|
22962
23199
|
const pass = new RenderShaderPass("gsplat_vs_dc", "gsplat_fs_dc");
|
|
22963
23200
|
pass.passType = PassType.COLOR;
|
|
22964
23201
|
pass.setShaderEntry("VertMain", "FragMain");
|
|
@@ -22968,9 +23205,29 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
22968
23205
|
pass.shaderState.transparent = true;
|
|
22969
23206
|
pass.shaderState.blendMode = BlendMode.NORMAL;
|
|
22970
23207
|
pass.shaderState.writeMasks = [15, 15];
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
23208
|
+
this.addRenderPass(pass);
|
|
23209
|
+
this.setDefault();
|
|
23210
|
+
}
|
|
23211
|
+
/**
|
|
23212
|
+
* Set default uniform values
|
|
23213
|
+
*/
|
|
23214
|
+
setDefault() {
|
|
23215
|
+
const pass = this.getDefaultColorShader();
|
|
23216
|
+
const identityMatrix = new Matrix4();
|
|
23217
|
+
pass.setUniform("modelMatrix", identityMatrix.rawData);
|
|
23218
|
+
pass.setUniform("pixelCull", new Float32Array([2, 0, 0, 0]));
|
|
23219
|
+
}
|
|
23220
|
+
};
|
|
23221
|
+
exports.GSplatShader = __decorateClass$k([
|
|
23222
|
+
RegisterShader(exports.GSplatShader, "GSplatShader")
|
|
23223
|
+
], exports.GSplatShader);
|
|
23224
|
+
|
|
23225
|
+
class GSplatMaterial extends Material {
|
|
23226
|
+
constructor() {
|
|
23227
|
+
super();
|
|
23228
|
+
ShaderLib.register("gsplat_vs_dc", GSplat_VS);
|
|
23229
|
+
ShaderLib.register("gsplat_fs_dc", GSplat_FS);
|
|
23230
|
+
this.shader = new exports.GSplatShader();
|
|
22974
23231
|
}
|
|
22975
23232
|
setSplatTextures(splatColor, transformA, transformB, texParams, splatOrder) {
|
|
22976
23233
|
const pass = this.shader.getDefaultColorShader();
|
|
@@ -23979,9 +24236,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
23979
24236
|
}
|
|
23980
24237
|
}
|
|
23981
24238
|
|
|
23982
|
-
var __getOwnPropDesc$
|
|
23983
|
-
var __decorateClass$
|
|
23984
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
24239
|
+
var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
|
|
24240
|
+
var __decorateClass$j = (decorators, target, key, kind) => {
|
|
24241
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
|
|
23985
24242
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23986
24243
|
if (decorator = decorators[i])
|
|
23987
24244
|
result = (decorator(result)) || result;
|
|
@@ -24734,7 +24991,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
24734
24991
|
super.destroy(force);
|
|
24735
24992
|
}
|
|
24736
24993
|
};
|
|
24737
|
-
exports.GSplatRenderer = __decorateClass$
|
|
24994
|
+
exports.GSplatRenderer = __decorateClass$j([
|
|
24738
24995
|
RegisterComponent(exports.GSplatRenderer, "GSplatRenderer")
|
|
24739
24996
|
], exports.GSplatRenderer);
|
|
24740
24997
|
|
|
@@ -25045,9 +25302,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
25045
25302
|
}
|
|
25046
25303
|
}
|
|
25047
25304
|
|
|
25048
|
-
var __getOwnPropDesc$
|
|
25049
|
-
var __decorateClass$
|
|
25050
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
25305
|
+
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
25306
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
25307
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
25051
25308
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
25052
25309
|
if (decorator = decorators[i])
|
|
25053
25310
|
result = (decorator(result)) || result;
|
|
@@ -25312,7 +25569,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
25312
25569
|
super.destroy(force);
|
|
25313
25570
|
}
|
|
25314
25571
|
};
|
|
25315
|
-
exports.Object3D = __decorateClass$
|
|
25572
|
+
exports.Object3D = __decorateClass$i([
|
|
25316
25573
|
DecorateObject3D
|
|
25317
25574
|
], exports.Object3D);
|
|
25318
25575
|
function DecorateObject3D(ctor, _) {
|
|
@@ -26641,9 +26898,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
26641
26898
|
}
|
|
26642
26899
|
|
|
26643
26900
|
var __defProp = Object.defineProperty;
|
|
26644
|
-
var __getOwnPropDesc$
|
|
26645
|
-
var __decorateClass$
|
|
26646
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
26901
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
26902
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
26903
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
26647
26904
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
26648
26905
|
if (decorator = decorators[i])
|
|
26649
26906
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
@@ -26752,13 +27009,13 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
26752
27009
|
super.destroy(force);
|
|
26753
27010
|
}
|
|
26754
27011
|
};
|
|
26755
|
-
__decorateClass$
|
|
27012
|
+
__decorateClass$h([
|
|
26756
27013
|
EditorInspector
|
|
26757
27014
|
], exports.MeshRenderer.prototype, "geometry", 1);
|
|
26758
|
-
__decorateClass$
|
|
27015
|
+
__decorateClass$h([
|
|
26759
27016
|
EditorInspector
|
|
26760
27017
|
], exports.MeshRenderer.prototype, "material", 1);
|
|
26761
|
-
exports.MeshRenderer = __decorateClass$
|
|
27018
|
+
exports.MeshRenderer = __decorateClass$h([
|
|
26762
27019
|
RegisterComponent(exports.MeshRenderer, "MeshRenderer")
|
|
26763
27020
|
], exports.MeshRenderer);
|
|
26764
27021
|
|
|
@@ -27255,9 +27512,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
27255
27512
|
}
|
|
27256
27513
|
}
|
|
27257
27514
|
|
|
27258
|
-
var __getOwnPropDesc$
|
|
27259
|
-
var __decorateClass$
|
|
27260
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
27515
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
27516
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
27517
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
27261
27518
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
27262
27519
|
if (decorator = decorators[i])
|
|
27263
27520
|
result = (decorator(result)) || result;
|
|
@@ -27281,7 +27538,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
|
|
|
27281
27538
|
this.setUniformFloat(`height`, 100);
|
|
27282
27539
|
}
|
|
27283
27540
|
};
|
|
27284
|
-
exports.QuadShader = __decorateClass$
|
|
27541
|
+
exports.QuadShader = __decorateClass$g([
|
|
27285
27542
|
RegisterShader(exports.QuadShader, "QuadShader")
|
|
27286
27543
|
], exports.QuadShader);
|
|
27287
27544
|
|
|
@@ -34555,9 +34812,9 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
34555
34812
|
}
|
|
34556
34813
|
}
|
|
34557
34814
|
|
|
34558
|
-
var __getOwnPropDesc$
|
|
34559
|
-
var __decorateClass$
|
|
34560
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
34815
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
34816
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
34817
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
34561
34818
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34562
34819
|
if (decorator = decorators[i])
|
|
34563
34820
|
result = (decorator(result)) || result;
|
|
@@ -34599,13 +34856,13 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
34599
34856
|
debug() {
|
|
34600
34857
|
}
|
|
34601
34858
|
};
|
|
34602
|
-
exports.DirectLight = __decorateClass$
|
|
34859
|
+
exports.DirectLight = __decorateClass$f([
|
|
34603
34860
|
RegisterComponent(exports.DirectLight, "DirectLight")
|
|
34604
34861
|
], exports.DirectLight);
|
|
34605
34862
|
|
|
34606
|
-
var __getOwnPropDesc$
|
|
34607
|
-
var __decorateClass$
|
|
34608
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
34863
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
34864
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
34865
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
34609
34866
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34610
34867
|
if (decorator = decorators[i])
|
|
34611
34868
|
result = (decorator(result)) || result;
|
|
@@ -34663,13 +34920,13 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
34663
34920
|
debugDraw(show) {
|
|
34664
34921
|
}
|
|
34665
34922
|
};
|
|
34666
|
-
exports.PointLight = __decorateClass$
|
|
34923
|
+
exports.PointLight = __decorateClass$e([
|
|
34667
34924
|
RegisterComponent(exports.PointLight, "PointLight")
|
|
34668
34925
|
], exports.PointLight);
|
|
34669
34926
|
|
|
34670
|
-
var __getOwnPropDesc$
|
|
34671
|
-
var __decorateClass$
|
|
34672
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
34927
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
34928
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
34929
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
34673
34930
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34674
34931
|
if (decorator = decorators[i])
|
|
34675
34932
|
result = (decorator(result)) || result;
|
|
@@ -34734,7 +34991,7 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
34734
34991
|
debugDraw(show) {
|
|
34735
34992
|
}
|
|
34736
34993
|
};
|
|
34737
|
-
exports.SpotLight = __decorateClass$
|
|
34994
|
+
exports.SpotLight = __decorateClass$d([
|
|
34738
34995
|
RegisterComponent(exports.SpotLight, "SpotLight")
|
|
34739
34996
|
], exports.SpotLight);
|
|
34740
34997
|
|
|
@@ -40534,7 +40791,7 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
40534
40791
|
}
|
|
40535
40792
|
}
|
|
40536
40793
|
|
|
40537
|
-
const version = "1.0.
|
|
40794
|
+
const version = "1.0.12";
|
|
40538
40795
|
|
|
40539
40796
|
class Engine3D {
|
|
40540
40797
|
/**
|
|
@@ -45047,9 +45304,9 @@ fn frag(){
|
|
|
45047
45304
|
}
|
|
45048
45305
|
}
|
|
45049
45306
|
|
|
45050
|
-
var __getOwnPropDesc$
|
|
45051
|
-
var __decorateClass$
|
|
45052
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
45307
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
45308
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
45309
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
45053
45310
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
45054
45311
|
if (decorator = decorators[i])
|
|
45055
45312
|
result = (decorator(result)) || result;
|
|
@@ -45073,7 +45330,7 @@ fn frag(){
|
|
|
45073
45330
|
shaderState.depthCompare = GPUCompareFunction.less;
|
|
45074
45331
|
}
|
|
45075
45332
|
};
|
|
45076
|
-
exports.SkyShader = __decorateClass$
|
|
45333
|
+
exports.SkyShader = __decorateClass$c([
|
|
45077
45334
|
RegisterShader(exports.SkyShader, "SkyShader")
|
|
45078
45335
|
], exports.SkyShader);
|
|
45079
45336
|
|
|
@@ -45871,9 +46128,9 @@ fn frag(){
|
|
|
45871
46128
|
}
|
|
45872
46129
|
}
|
|
45873
46130
|
|
|
45874
|
-
var __getOwnPropDesc$
|
|
45875
|
-
var __decorateClass$
|
|
45876
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
46131
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
46132
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
46133
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
45877
46134
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
45878
46135
|
if (decorator = decorators[i])
|
|
45879
46136
|
result = (decorator(result)) || result;
|
|
@@ -46077,7 +46334,7 @@ fn frag(){
|
|
|
46077
46334
|
this._currentClipState.weight = 1;
|
|
46078
46335
|
}
|
|
46079
46336
|
};
|
|
46080
|
-
exports.SkeletonAnimationComponent = __decorateClass$
|
|
46337
|
+
exports.SkeletonAnimationComponent = __decorateClass$b([
|
|
46081
46338
|
RegisterComponent(exports.SkeletonAnimationComponent, "SkeletonAnimationComponent")
|
|
46082
46339
|
], exports.SkeletonAnimationComponent);
|
|
46083
46340
|
class SkeletonAnimationCrossFadeState {
|
|
@@ -46113,9 +46370,9 @@ fn frag(){
|
|
|
46113
46370
|
}
|
|
46114
46371
|
}
|
|
46115
46372
|
|
|
46116
|
-
var __getOwnPropDesc$
|
|
46117
|
-
var __decorateClass$
|
|
46118
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
46373
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
46374
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
46375
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
46119
46376
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
46120
46377
|
if (decorator = decorators[i])
|
|
46121
46378
|
result = (decorator(result)) || result;
|
|
@@ -46526,7 +46783,7 @@ fn frag(){
|
|
|
46526
46783
|
return dst;
|
|
46527
46784
|
}
|
|
46528
46785
|
};
|
|
46529
|
-
exports.AnimatorComponent = __decorateClass$
|
|
46786
|
+
exports.AnimatorComponent = __decorateClass$a([
|
|
46530
46787
|
RegisterComponent(exports.AnimatorComponent, "AnimatorComponent")
|
|
46531
46788
|
], exports.AnimatorComponent);
|
|
46532
46789
|
class PropertyAnimationClipState {
|
|
@@ -47283,9 +47540,9 @@ fn frag(){
|
|
|
47283
47540
|
}
|
|
47284
47541
|
}
|
|
47285
47542
|
|
|
47286
|
-
var __getOwnPropDesc$
|
|
47287
|
-
var __decorateClass$
|
|
47288
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
47543
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
47544
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
47545
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
47289
47546
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
47290
47547
|
if (decorator = decorators[i])
|
|
47291
47548
|
result = (decorator(result)) || result;
|
|
@@ -47434,7 +47691,7 @@ fn frag(){
|
|
|
47434
47691
|
super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
|
|
47435
47692
|
}
|
|
47436
47693
|
};
|
|
47437
|
-
exports.SkinnedMeshRenderer2 = __decorateClass$
|
|
47694
|
+
exports.SkinnedMeshRenderer2 = __decorateClass$9([
|
|
47438
47695
|
RegisterComponent(exports.SkinnedMeshRenderer2, "SkinnedMeshRenderer2")
|
|
47439
47696
|
], exports.SkinnedMeshRenderer2);
|
|
47440
47697
|
|
|
@@ -52567,9 +52824,9 @@ fn frag(){
|
|
|
52567
52824
|
}
|
|
52568
52825
|
}
|
|
52569
52826
|
|
|
52570
|
-
var __getOwnPropDesc$
|
|
52571
|
-
var __decorateClass$
|
|
52572
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
52827
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
52828
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
52829
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
52573
52830
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
52574
52831
|
if (decorator = decorators[i])
|
|
52575
52832
|
result = (decorator(result)) || result;
|
|
@@ -52646,10 +52903,86 @@ fn frag(){
|
|
|
52646
52903
|
debugDraw(show) {
|
|
52647
52904
|
}
|
|
52648
52905
|
};
|
|
52649
|
-
exports.Light = __decorateClass$
|
|
52906
|
+
exports.Light = __decorateClass$8([
|
|
52650
52907
|
RegisterComponent(exports.Light, "Light")
|
|
52651
52908
|
], exports.Light);
|
|
52652
52909
|
|
|
52910
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
52911
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
52912
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
52913
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
52914
|
+
if (decorator = decorators[i])
|
|
52915
|
+
result = (decorator(result)) || result;
|
|
52916
|
+
return result;
|
|
52917
|
+
};
|
|
52918
|
+
exports.FatLineRenderer = class FatLineRenderer extends RenderNode {
|
|
52919
|
+
_fatLineMaterial = null;
|
|
52920
|
+
_fatLineGeometry = null;
|
|
52921
|
+
constructor() {
|
|
52922
|
+
super();
|
|
52923
|
+
}
|
|
52924
|
+
onEnable() {
|
|
52925
|
+
super.onEnable();
|
|
52926
|
+
}
|
|
52927
|
+
onDisable() {
|
|
52928
|
+
super.onDisable();
|
|
52929
|
+
}
|
|
52930
|
+
cloneTo(obj) {
|
|
52931
|
+
const component = obj.addComponent(exports.FatLineRenderer);
|
|
52932
|
+
component.copyComponent(this);
|
|
52933
|
+
}
|
|
52934
|
+
copyComponent(from) {
|
|
52935
|
+
super.copyComponent(from);
|
|
52936
|
+
return this;
|
|
52937
|
+
}
|
|
52938
|
+
/**
|
|
52939
|
+
* Set FatLine geometry
|
|
52940
|
+
*/
|
|
52941
|
+
set geometry(value) {
|
|
52942
|
+
super.geometry = value;
|
|
52943
|
+
this._fatLineGeometry = value;
|
|
52944
|
+
if (value) {
|
|
52945
|
+
this.instanceCount = value.instanceCount;
|
|
52946
|
+
if (this._fatLineMaterial && value.instanceBuffer) {
|
|
52947
|
+
this._fatLineMaterial.setInstanceBuffer(value.instanceBuffer);
|
|
52948
|
+
}
|
|
52949
|
+
}
|
|
52950
|
+
}
|
|
52951
|
+
get geometry() {
|
|
52952
|
+
return this._fatLineGeometry;
|
|
52953
|
+
}
|
|
52954
|
+
/**
|
|
52955
|
+
* Set FatLine material
|
|
52956
|
+
*/
|
|
52957
|
+
set material(value) {
|
|
52958
|
+
this.materials = [value];
|
|
52959
|
+
this._fatLineMaterial = value;
|
|
52960
|
+
if (this._fatLineGeometry && this._fatLineGeometry.instanceBuffer) {
|
|
52961
|
+
value.setInstanceBuffer(this._fatLineGeometry.instanceBuffer);
|
|
52962
|
+
}
|
|
52963
|
+
}
|
|
52964
|
+
get material() {
|
|
52965
|
+
return this._fatLineMaterial;
|
|
52966
|
+
}
|
|
52967
|
+
/**
|
|
52968
|
+
* Override nodeUpdate to automatically update FatLine-specific uniforms
|
|
52969
|
+
*/
|
|
52970
|
+
nodeUpdate(view, passType, renderPassState, clusterLightingBuffer) {
|
|
52971
|
+
if (this._fatLineMaterial && this.object3D) {
|
|
52972
|
+
this._fatLineMaterial.setModelMatrix(this.object3D.transform.worldMatrix);
|
|
52973
|
+
const width = webGPUContext.presentationSize[0];
|
|
52974
|
+
const height = webGPUContext.presentationSize[1];
|
|
52975
|
+
if (width > 0 && height > 0) {
|
|
52976
|
+
this._fatLineMaterial.resolution = new Vector2(width, height);
|
|
52977
|
+
}
|
|
52978
|
+
}
|
|
52979
|
+
super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
|
|
52980
|
+
}
|
|
52981
|
+
};
|
|
52982
|
+
exports.FatLineRenderer = __decorateClass$7([
|
|
52983
|
+
RegisterComponent(exports.FatLineRenderer, "FatLineRenderer")
|
|
52984
|
+
], exports.FatLineRenderer);
|
|
52985
|
+
|
|
52653
52986
|
class Probe extends exports.Object3D {
|
|
52654
52987
|
index = 0;
|
|
52655
52988
|
drawCallFrame = -1;
|
|
@@ -52948,9 +53281,9 @@ fn frag(){
|
|
|
52948
53281
|
}
|
|
52949
53282
|
}
|
|
52950
53283
|
|
|
52951
|
-
var __getOwnPropDesc$
|
|
52952
|
-
var __decorateClass$
|
|
52953
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
53284
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
53285
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
53286
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
52954
53287
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
52955
53288
|
if (decorator = decorators[i])
|
|
52956
53289
|
result = (decorator(result)) || result;
|
|
@@ -52976,13 +53309,13 @@ fn frag(){
|
|
|
52976
53309
|
}
|
|
52977
53310
|
}
|
|
52978
53311
|
};
|
|
52979
|
-
exports.MeshFilter = __decorateClass$
|
|
53312
|
+
exports.MeshFilter = __decorateClass$6([
|
|
52980
53313
|
RegisterComponent(exports.MeshFilter, "MeshFilter")
|
|
52981
53314
|
], exports.MeshFilter);
|
|
52982
53315
|
|
|
52983
|
-
var __getOwnPropDesc$
|
|
52984
|
-
var __decorateClass$
|
|
52985
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
53316
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
53317
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
53318
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
52986
53319
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
52987
53320
|
if (decorator = decorators[i])
|
|
52988
53321
|
result = (decorator(result)) || result;
|
|
@@ -53108,7 +53441,7 @@ fn frag(){
|
|
|
53108
53441
|
super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
|
|
53109
53442
|
}
|
|
53110
53443
|
};
|
|
53111
|
-
exports.SkinnedMeshRenderer = __decorateClass$
|
|
53444
|
+
exports.SkinnedMeshRenderer = __decorateClass$5([
|
|
53112
53445
|
RegisterComponent(exports.SkinnedMeshRenderer, "SkinnedMeshRenderer")
|
|
53113
53446
|
], exports.SkinnedMeshRenderer);
|
|
53114
53447
|
|
|
@@ -53940,6 +54273,230 @@ fn frag(){
|
|
|
53940
54273
|
}
|
|
53941
54274
|
}
|
|
53942
54275
|
|
|
54276
|
+
class FatLineGeometry extends GeometryBase {
|
|
54277
|
+
_instanceBuffer;
|
|
54278
|
+
_instanceData;
|
|
54279
|
+
_instanceCount = 0;
|
|
54280
|
+
constructor() {
|
|
54281
|
+
super();
|
|
54282
|
+
this.initBaseGeometry();
|
|
54283
|
+
}
|
|
54284
|
+
/**
|
|
54285
|
+
* Initialize base quad geometry (shared by all line segments)
|
|
54286
|
+
* This is similar to ThreeJS LineSegmentsGeometry base geometry
|
|
54287
|
+
*/
|
|
54288
|
+
initBaseGeometry() {
|
|
54289
|
+
const positions = new Float32Array([
|
|
54290
|
+
-1,
|
|
54291
|
+
2,
|
|
54292
|
+
0,
|
|
54293
|
+
1,
|
|
54294
|
+
2,
|
|
54295
|
+
0,
|
|
54296
|
+
// Top endcap
|
|
54297
|
+
-1,
|
|
54298
|
+
1,
|
|
54299
|
+
0,
|
|
54300
|
+
1,
|
|
54301
|
+
1,
|
|
54302
|
+
0,
|
|
54303
|
+
// Top of line segment
|
|
54304
|
+
-1,
|
|
54305
|
+
0,
|
|
54306
|
+
0,
|
|
54307
|
+
1,
|
|
54308
|
+
0,
|
|
54309
|
+
0,
|
|
54310
|
+
// Bottom of line segment
|
|
54311
|
+
-1,
|
|
54312
|
+
-1,
|
|
54313
|
+
0,
|
|
54314
|
+
1,
|
|
54315
|
+
-1,
|
|
54316
|
+
0
|
|
54317
|
+
// Bottom endcap
|
|
54318
|
+
]);
|
|
54319
|
+
const uvs = new Float32Array([
|
|
54320
|
+
-1,
|
|
54321
|
+
2,
|
|
54322
|
+
1,
|
|
54323
|
+
2,
|
|
54324
|
+
-1,
|
|
54325
|
+
1,
|
|
54326
|
+
1,
|
|
54327
|
+
1,
|
|
54328
|
+
-1,
|
|
54329
|
+
-1,
|
|
54330
|
+
1,
|
|
54331
|
+
-1,
|
|
54332
|
+
-1,
|
|
54333
|
+
-2,
|
|
54334
|
+
1,
|
|
54335
|
+
-2
|
|
54336
|
+
]);
|
|
54337
|
+
const indices = new Uint16Array([
|
|
54338
|
+
0,
|
|
54339
|
+
2,
|
|
54340
|
+
1,
|
|
54341
|
+
2,
|
|
54342
|
+
3,
|
|
54343
|
+
1,
|
|
54344
|
+
// First quad
|
|
54345
|
+
2,
|
|
54346
|
+
4,
|
|
54347
|
+
3,
|
|
54348
|
+
4,
|
|
54349
|
+
5,
|
|
54350
|
+
3,
|
|
54351
|
+
// Second quad
|
|
54352
|
+
4,
|
|
54353
|
+
6,
|
|
54354
|
+
5,
|
|
54355
|
+
6,
|
|
54356
|
+
7,
|
|
54357
|
+
5
|
|
54358
|
+
// Third quad
|
|
54359
|
+
]);
|
|
54360
|
+
this.setIndices(indices);
|
|
54361
|
+
this.setAttribute(VertexAttributeName.position, positions);
|
|
54362
|
+
this.setAttribute(VertexAttributeName.uv, uvs);
|
|
54363
|
+
this.addSubGeometry({
|
|
54364
|
+
indexStart: 0,
|
|
54365
|
+
indexCount: indices.length,
|
|
54366
|
+
vertexStart: 0,
|
|
54367
|
+
vertexCount: positions.length / 3,
|
|
54368
|
+
firstStart: 0,
|
|
54369
|
+
index: 0,
|
|
54370
|
+
topology: 0
|
|
54371
|
+
});
|
|
54372
|
+
}
|
|
54373
|
+
/**
|
|
54374
|
+
* Set line positions from continuous points array
|
|
54375
|
+
* @param positions Array of positions [x1,y1,z1, x2,y2,z2, ...]
|
|
54376
|
+
*/
|
|
54377
|
+
setPositions(positions) {
|
|
54378
|
+
const posArray = positions instanceof Float32Array ? positions : new Float32Array(positions);
|
|
54379
|
+
const numPoints = posArray.length / 3;
|
|
54380
|
+
const numSegments = numPoints - 1;
|
|
54381
|
+
if (numSegments <= 0) {
|
|
54382
|
+
console.warn("FatLineGeometry: Need at least 2 points");
|
|
54383
|
+
return this;
|
|
54384
|
+
}
|
|
54385
|
+
const instanceData = new Float32Array(numSegments * 16);
|
|
54386
|
+
for (let i = 0; i < numSegments; i++) {
|
|
54387
|
+
const i0 = i * 3;
|
|
54388
|
+
const i1 = (i + 1) * 3;
|
|
54389
|
+
instanceData[i * 16 + 0] = posArray[i0 + 0];
|
|
54390
|
+
instanceData[i * 16 + 1] = posArray[i0 + 1];
|
|
54391
|
+
instanceData[i * 16 + 2] = posArray[i0 + 2];
|
|
54392
|
+
instanceData[i * 16 + 3] = 0;
|
|
54393
|
+
instanceData[i * 16 + 4] = posArray[i1 + 0];
|
|
54394
|
+
instanceData[i * 16 + 5] = posArray[i1 + 1];
|
|
54395
|
+
instanceData[i * 16 + 6] = posArray[i1 + 2];
|
|
54396
|
+
instanceData[i * 16 + 7] = 0;
|
|
54397
|
+
instanceData[i * 16 + 8] = 1;
|
|
54398
|
+
instanceData[i * 16 + 9] = 1;
|
|
54399
|
+
instanceData[i * 16 + 10] = 1;
|
|
54400
|
+
instanceData[i * 16 + 11] = 0;
|
|
54401
|
+
instanceData[i * 16 + 12] = 1;
|
|
54402
|
+
instanceData[i * 16 + 13] = 1;
|
|
54403
|
+
instanceData[i * 16 + 14] = 1;
|
|
54404
|
+
instanceData[i * 16 + 15] = 0;
|
|
54405
|
+
}
|
|
54406
|
+
this._instanceData = instanceData;
|
|
54407
|
+
this._instanceCount = numSegments;
|
|
54408
|
+
this.computeBoundingBox(posArray);
|
|
54409
|
+
return this;
|
|
54410
|
+
}
|
|
54411
|
+
/**
|
|
54412
|
+
* Set colors for line segments
|
|
54413
|
+
* @param colors Array of colors [r1,g1,b1, r2,g2,b2, ...] for each point
|
|
54414
|
+
*/
|
|
54415
|
+
setColors(colors) {
|
|
54416
|
+
const colorArray = colors instanceof Float32Array ? colors : new Float32Array(colors);
|
|
54417
|
+
if (!this._instanceData) {
|
|
54418
|
+
console.warn(
|
|
54419
|
+
"FatLineGeometry: Must call setPositions() before setColors()"
|
|
54420
|
+
);
|
|
54421
|
+
return this;
|
|
54422
|
+
}
|
|
54423
|
+
const numPoints = colorArray.length / 3;
|
|
54424
|
+
const numSegments = numPoints - 1;
|
|
54425
|
+
if (numSegments !== this._instanceCount) {
|
|
54426
|
+
console.warn(
|
|
54427
|
+
"FatLineGeometry: Color array length doesn't match segment count"
|
|
54428
|
+
);
|
|
54429
|
+
return this;
|
|
54430
|
+
}
|
|
54431
|
+
for (let i = 0; i < numSegments; i++) {
|
|
54432
|
+
const i0 = i * 3;
|
|
54433
|
+
const i1 = (i + 1) * 3;
|
|
54434
|
+
this._instanceData[i * 16 + 8] = colorArray[i0 + 0];
|
|
54435
|
+
this._instanceData[i * 16 + 9] = colorArray[i0 + 1];
|
|
54436
|
+
this._instanceData[i * 16 + 10] = colorArray[i0 + 2];
|
|
54437
|
+
this._instanceData[i * 16 + 12] = colorArray[i1 + 0];
|
|
54438
|
+
this._instanceData[i * 16 + 13] = colorArray[i1 + 1];
|
|
54439
|
+
this._instanceData[i * 16 + 14] = colorArray[i1 + 2];
|
|
54440
|
+
}
|
|
54441
|
+
return this;
|
|
54442
|
+
}
|
|
54443
|
+
/**
|
|
54444
|
+
* Compute bounding box from positions
|
|
54445
|
+
*/
|
|
54446
|
+
computeBoundingBox(positions) {
|
|
54447
|
+
const min = new Vector3(Infinity, Infinity, Infinity);
|
|
54448
|
+
const max = new Vector3(-Infinity, -Infinity, -Infinity);
|
|
54449
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
54450
|
+
const x = positions[i];
|
|
54451
|
+
const y = positions[i + 1];
|
|
54452
|
+
const z = positions[i + 2];
|
|
54453
|
+
min.x = Math.min(min.x, x);
|
|
54454
|
+
min.y = Math.min(min.y, y);
|
|
54455
|
+
min.z = Math.min(min.z, z);
|
|
54456
|
+
max.x = Math.max(max.x, x);
|
|
54457
|
+
max.y = Math.max(max.y, y);
|
|
54458
|
+
max.z = Math.max(max.z, z);
|
|
54459
|
+
}
|
|
54460
|
+
const size = Vector3.sub(max, min);
|
|
54461
|
+
this.bounds = new BoundingBox(Vector3.ZERO.clone(), size);
|
|
54462
|
+
this.bounds.setFromMinMax(min, max);
|
|
54463
|
+
}
|
|
54464
|
+
/**
|
|
54465
|
+
* Get instance data for GPU upload
|
|
54466
|
+
*/
|
|
54467
|
+
get instanceData() {
|
|
54468
|
+
return this._instanceData;
|
|
54469
|
+
}
|
|
54470
|
+
/**
|
|
54471
|
+
* Get number of line segments (instances)
|
|
54472
|
+
*/
|
|
54473
|
+
get instanceCount() {
|
|
54474
|
+
return this._instanceCount;
|
|
54475
|
+
}
|
|
54476
|
+
/**
|
|
54477
|
+
* Get or create instance buffer
|
|
54478
|
+
*/
|
|
54479
|
+
get instanceBuffer() {
|
|
54480
|
+
if (!this._instanceBuffer && this._instanceData) {
|
|
54481
|
+
this._instanceBuffer = new StorageGPUBuffer(
|
|
54482
|
+
this._instanceData.byteLength
|
|
54483
|
+
);
|
|
54484
|
+
this._instanceBuffer.setFloat32Array("", this._instanceData);
|
|
54485
|
+
this._instanceBuffer.apply();
|
|
54486
|
+
}
|
|
54487
|
+
return this._instanceBuffer;
|
|
54488
|
+
}
|
|
54489
|
+
/**
|
|
54490
|
+
* Update instance buffer with new data
|
|
54491
|
+
*/
|
|
54492
|
+
updateInstanceBuffer() {
|
|
54493
|
+
if (this._instanceBuffer && this._instanceData) {
|
|
54494
|
+
this._instanceBuffer.setFloat32Array("", this._instanceData);
|
|
54495
|
+
this._instanceBuffer.apply();
|
|
54496
|
+
}
|
|
54497
|
+
}
|
|
54498
|
+
}
|
|
54499
|
+
|
|
53943
54500
|
class VertexBufferLayout {
|
|
53944
54501
|
name;
|
|
53945
54502
|
offset;
|
|
@@ -59210,9 +59767,9 @@ fn frag(){
|
|
|
59210
59767
|
}
|
|
59211
59768
|
}
|
|
59212
59769
|
|
|
59213
|
-
var __getOwnPropDesc$
|
|
59214
|
-
var __decorateClass$
|
|
59215
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
59770
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
59771
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
59772
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
59216
59773
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
59217
59774
|
if (decorator = decorators[i])
|
|
59218
59775
|
result = (decorator(result)) || result;
|
|
@@ -59331,13 +59888,13 @@ fn frag(){
|
|
|
59331
59888
|
}
|
|
59332
59889
|
}
|
|
59333
59890
|
};
|
|
59334
|
-
exports.LitSSSShader = __decorateClass$
|
|
59891
|
+
exports.LitSSSShader = __decorateClass$4([
|
|
59335
59892
|
RegisterShader(exports.LitSSSShader, "LitSSSShader")
|
|
59336
59893
|
], exports.LitSSSShader);
|
|
59337
59894
|
|
|
59338
|
-
var __getOwnPropDesc$
|
|
59339
|
-
var __decorateClass$
|
|
59340
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
59895
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
59896
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
59897
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
59341
59898
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
59342
59899
|
if (decorator = decorators[i])
|
|
59343
59900
|
result = (decorator(result)) || result;
|
|
@@ -59433,7 +59990,7 @@ fn frag(){
|
|
|
59433
59990
|
}
|
|
59434
59991
|
}
|
|
59435
59992
|
};
|
|
59436
|
-
exports.LitShader = __decorateClass$
|
|
59993
|
+
exports.LitShader = __decorateClass$3([
|
|
59437
59994
|
RegisterShader(exports.LitShader, "LitShader")
|
|
59438
59995
|
], exports.LitShader);
|
|
59439
59996
|
|
|
@@ -59592,6 +60149,47 @@ fn frag(){
|
|
|
59592
60149
|
}
|
|
59593
60150
|
}
|
|
59594
60151
|
|
|
60152
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
60153
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
60154
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
60155
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
60156
|
+
if (decorator = decorators[i])
|
|
60157
|
+
result = (decorator(result)) || result;
|
|
60158
|
+
return result;
|
|
60159
|
+
};
|
|
60160
|
+
exports.FatLineShader = class FatLineShader extends Shader {
|
|
60161
|
+
constructor() {
|
|
60162
|
+
super();
|
|
60163
|
+
const colorShader = new RenderShaderPass("FatLine_VS", "FatLine_FS");
|
|
60164
|
+
colorShader.setShaderEntry(`VertMain`, `FragMain`);
|
|
60165
|
+
this.addRenderPass(colorShader);
|
|
60166
|
+
const shaderState = colorShader.shaderState;
|
|
60167
|
+
shaderState.acceptShadow = false;
|
|
60168
|
+
shaderState.castShadow = false;
|
|
60169
|
+
shaderState.receiveEnv = false;
|
|
60170
|
+
shaderState.acceptGI = false;
|
|
60171
|
+
shaderState.useLight = false;
|
|
60172
|
+
shaderState.cullMode = GPUCullMode.none;
|
|
60173
|
+
shaderState.depthWriteEnabled = true;
|
|
60174
|
+
this.setDefault();
|
|
60175
|
+
}
|
|
60176
|
+
/**
|
|
60177
|
+
* Set default uniform values
|
|
60178
|
+
*/
|
|
60179
|
+
setDefault() {
|
|
60180
|
+
this.setUniformColor(`baseColor`, new Color(1, 1, 1, 1));
|
|
60181
|
+
this.setUniformFloat(`lineWidth`, 1);
|
|
60182
|
+
this.setUniformFloat(`opacity`, 1);
|
|
60183
|
+
this.setUniformVector2(`resolution`, new Vector2(1920, 1080));
|
|
60184
|
+
const identityMatrix = new Matrix4();
|
|
60185
|
+
const pass = this.getDefaultColorShader();
|
|
60186
|
+
pass.setUniform(`modelMatrix`, identityMatrix.rawData);
|
|
60187
|
+
}
|
|
60188
|
+
};
|
|
60189
|
+
exports.FatLineShader = __decorateClass$2([
|
|
60190
|
+
RegisterShader(exports.FatLineShader, "FatLineShader")
|
|
60191
|
+
], exports.FatLineShader);
|
|
60192
|
+
|
|
59595
60193
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
59596
60194
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
59597
60195
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
@@ -59928,6 +60526,78 @@ fn frag(){
|
|
|
59928
60526
|
}
|
|
59929
60527
|
}
|
|
59930
60528
|
|
|
60529
|
+
class FatLineMaterial extends Material {
|
|
60530
|
+
constructor() {
|
|
60531
|
+
super();
|
|
60532
|
+
this.shader = new exports.FatLineShader();
|
|
60533
|
+
this.transparent = true;
|
|
60534
|
+
}
|
|
60535
|
+
/**
|
|
60536
|
+
* Set instance buffer for line segments
|
|
60537
|
+
* This should be called after setting the geometry
|
|
60538
|
+
*/
|
|
60539
|
+
setInstanceBuffer(buffer) {
|
|
60540
|
+
this.shader.setStorageBuffer("instances", buffer);
|
|
60541
|
+
}
|
|
60542
|
+
/**
|
|
60543
|
+
* Set model matrix for transforming line segments
|
|
60544
|
+
* This should be updated each frame if the object moves
|
|
60545
|
+
*/
|
|
60546
|
+
setModelMatrix(matrix) {
|
|
60547
|
+
const pass = this.shader.getDefaultColorShader();
|
|
60548
|
+
pass.setUniform("modelMatrix", matrix.rawData);
|
|
60549
|
+
}
|
|
60550
|
+
/**
|
|
60551
|
+
* Set base color (tint color)
|
|
60552
|
+
*/
|
|
60553
|
+
set baseColor(color) {
|
|
60554
|
+
this.shader.setUniformColor(`baseColor`, color);
|
|
60555
|
+
}
|
|
60556
|
+
/**
|
|
60557
|
+
* Get base color (tint color)
|
|
60558
|
+
*/
|
|
60559
|
+
get baseColor() {
|
|
60560
|
+
return this.shader.getUniformColor("baseColor");
|
|
60561
|
+
}
|
|
60562
|
+
/**
|
|
60563
|
+
* Set line width in pixels
|
|
60564
|
+
*/
|
|
60565
|
+
set lineWidth(value) {
|
|
60566
|
+
this.shader.setUniformFloat(`lineWidth`, value);
|
|
60567
|
+
}
|
|
60568
|
+
/**
|
|
60569
|
+
* Get line width in pixels
|
|
60570
|
+
*/
|
|
60571
|
+
get lineWidth() {
|
|
60572
|
+
return this.shader.getUniformFloat("lineWidth");
|
|
60573
|
+
}
|
|
60574
|
+
/**
|
|
60575
|
+
* Set opacity (0-1)
|
|
60576
|
+
*/
|
|
60577
|
+
set opacity(value) {
|
|
60578
|
+
this.shader.setUniformFloat(`opacity`, value);
|
|
60579
|
+
}
|
|
60580
|
+
/**
|
|
60581
|
+
* Get opacity (0-1)
|
|
60582
|
+
*/
|
|
60583
|
+
get opacity() {
|
|
60584
|
+
return this.shader.getUniformFloat("opacity");
|
|
60585
|
+
}
|
|
60586
|
+
/**
|
|
60587
|
+
* Set viewport resolution for correct pixel-space calculations
|
|
60588
|
+
* This should be set automatically by the renderer
|
|
60589
|
+
*/
|
|
60590
|
+
set resolution(value) {
|
|
60591
|
+
this.shader.setUniformVector2(`resolution`, value);
|
|
60592
|
+
}
|
|
60593
|
+
/**
|
|
60594
|
+
* Get viewport resolution
|
|
60595
|
+
*/
|
|
60596
|
+
get resolution() {
|
|
60597
|
+
return this.shader.getUniformVector2("resolution");
|
|
60598
|
+
}
|
|
60599
|
+
}
|
|
60600
|
+
|
|
59931
60601
|
class LambertMaterial extends Material {
|
|
59932
60602
|
/**
|
|
59933
60603
|
* @constructor
|
|
@@ -65838,6 +66508,10 @@ fn frag(){
|
|
|
65838
66508
|
exports.FXAAPost = FXAAPost;
|
|
65839
66509
|
exports.FXAAShader = FXAAShader;
|
|
65840
66510
|
exports.FastMathShader = FastMathShader;
|
|
66511
|
+
exports.FatLineGeometry = FatLineGeometry;
|
|
66512
|
+
exports.FatLineMaterial = FatLineMaterial;
|
|
66513
|
+
exports.FatLine_FS = FatLine_FS;
|
|
66514
|
+
exports.FatLine_VS = FatLine_VS;
|
|
65841
66515
|
exports.FeatureTable = FeatureTable;
|
|
65842
66516
|
exports.FileLoader = FileLoader;
|
|
65843
66517
|
exports.FirstPersonCameraController = FirstPersonCameraController;
|