three-gpu-pathtracer 0.0.14 → 0.0.16

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.
Files changed (76) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1004 -981
  3. package/build/index.module.js +7413 -6902
  4. package/build/index.module.js.map +1 -1
  5. package/build/index.umd.cjs +7446 -6933
  6. package/build/index.umd.cjs.map +1 -1
  7. package/package.json +73 -73
  8. package/src/core/DynamicPathTracingSceneGenerator.js +119 -119
  9. package/src/core/MaterialReducer.js +256 -256
  10. package/src/core/PathTracingRenderer.js +346 -346
  11. package/src/core/PathTracingSceneGenerator.js +69 -69
  12. package/src/core/QuiltPathTracingRenderer.js +223 -223
  13. package/src/detectors/CompatibilityDetector.js +38 -0
  14. package/src/detectors/MaterialCompileDetector.js +50 -0
  15. package/src/detectors/PrecisionDetector.js +85 -0
  16. package/src/detectors/PrecisionMaterial.js +160 -0
  17. package/src/index.js +40 -36
  18. package/src/materials/MaterialBase.js +56 -56
  19. package/src/materials/debug/GraphMaterial.js +243 -243
  20. package/src/materials/fullscreen/AlphaDisplayMaterial.js +50 -48
  21. package/src/materials/fullscreen/BlendMaterial.js +67 -67
  22. package/src/materials/fullscreen/DenoiseMaterial.js +142 -142
  23. package/src/materials/fullscreen/GradientMapMaterial.js +82 -0
  24. package/src/materials/pathtracing/LambertPathTracingMaterial.js +296 -296
  25. package/src/materials/pathtracing/PhysicalPathTracingMaterial.js +118 -196
  26. package/src/materials/pathtracing/glsl/attenuateHit.glsl.js +177 -179
  27. package/src/materials/pathtracing/glsl/cameraUtils.glsl.js +84 -81
  28. package/src/materials/pathtracing/glsl/directLightContribution.glsl.js +93 -0
  29. package/src/materials/pathtracing/glsl/getSurfaceRecord.glsl.js +323 -317
  30. package/src/materials/pathtracing/glsl/renderStructs.glsl.js +50 -0
  31. package/src/materials/pathtracing/glsl/traceScene.glsl.js +52 -54
  32. package/src/materials/surface/AmbientOcclusionMaterial.js +207 -207
  33. package/src/materials/surface/FogVolumeMaterial.js +23 -23
  34. package/src/objects/EquirectCamera.js +13 -13
  35. package/src/objects/PhysicalCamera.js +42 -28
  36. package/src/objects/PhysicalSpotLight.js +25 -14
  37. package/src/objects/ShapedAreaLight.js +22 -12
  38. package/src/shader/bsdf/bsdfSampling.glsl.js +499 -490
  39. package/src/shader/bsdf/fog.glsl.js +22 -23
  40. package/src/shader/bsdf/ggx.glsl.js +102 -102
  41. package/src/shader/bsdf/iridescence.glsl.js +135 -135
  42. package/src/shader/bsdf/sheen.glsl.js +98 -98
  43. package/src/shader/common/arraySamplerTexelFetch.glsl.js +25 -25
  44. package/src/shader/common/bvhAnyHit.glsl.js +76 -76
  45. package/src/shader/common/fresnel.glsl.js +98 -98
  46. package/src/shader/common/intersectShapes.glsl.js +62 -62
  47. package/src/shader/common/math.glsl.js +81 -81
  48. package/src/shader/common/utils.glsl.js +116 -116
  49. package/src/shader/rand/pcg.glsl.js +57 -57
  50. package/src/shader/rand/sobol.glsl.js +256 -256
  51. package/src/shader/sampling/equirectSampling.glsl.js +62 -62
  52. package/src/shader/sampling/lightSampling.glsl.js +223 -223
  53. package/src/shader/sampling/shapeSampling.glsl.js +86 -86
  54. package/src/shader/structs/cameraStruct.glsl.js +13 -13
  55. package/src/shader/structs/equirectStruct.glsl.js +13 -14
  56. package/src/shader/structs/fogMaterialBvh.glsl.js +62 -62
  57. package/src/shader/structs/lightsStruct.glsl.js +78 -78
  58. package/src/shader/structs/materialStruct.glsl.js +207 -207
  59. package/src/textures/GradientEquirectTexture.js +35 -35
  60. package/src/textures/ProceduralEquirectTexture.js +75 -75
  61. package/src/uniforms/AttributesTextureArray.js +35 -35
  62. package/src/uniforms/EquirectHdrInfoUniform.js +269 -277
  63. package/src/uniforms/FloatAttributeTextureArray.js +169 -169
  64. package/src/uniforms/IESProfilesTexture.js +100 -100
  65. package/src/uniforms/LightsInfoUniformStruct.js +212 -212
  66. package/src/uniforms/MaterialsTexture.js +503 -503
  67. package/src/uniforms/PhysicalCameraUniform.js +36 -36
  68. package/src/uniforms/RenderTarget2DArray.js +97 -97
  69. package/src/uniforms/utils.js +30 -30
  70. package/src/utils/BlurredEnvMapGenerator.js +116 -116
  71. package/src/utils/GeometryPreparationUtils.js +214 -214
  72. package/src/utils/IESLoader.js +325 -325
  73. package/src/utils/SobolNumberMapGenerator.js +80 -80
  74. package/src/utils/UVUnwrapper.js +101 -101
  75. package/src/utils/macroify.js +9 -9
  76. package/src/workers/PathTracingSceneWorker.js +42 -42
@@ -0,0 +1,50 @@
1
+ export const renderStructsGLSL = /* glsl */`
2
+
3
+ struct Ray {
4
+
5
+ vec3 origin;
6
+ vec3 direction;
7
+
8
+ };
9
+
10
+ struct SurfaceHit {
11
+
12
+ uvec4 faceIndices;
13
+ vec3 barycoord;
14
+ vec3 faceNormal;
15
+ float side;
16
+ float dist;
17
+
18
+ };
19
+
20
+ struct RenderState {
21
+
22
+ bool firstRay;
23
+ bool transmissiveRay;
24
+ bool isShadowRay;
25
+ float accumulatedRoughness;
26
+ int transmissiveTraversals;
27
+ int traversals;
28
+ uint depth;
29
+ vec3 throughputColor;
30
+ Material fogMaterial;
31
+
32
+ };
33
+
34
+ RenderState initRenderState() {
35
+
36
+ RenderState result;
37
+ result.firstRay = true;
38
+ result.transmissiveRay = true;
39
+ result.isShadowRay = false;
40
+ result.accumulatedRoughness = 0.0;
41
+ result.transmissiveTraversals = 0;
42
+ result.traversals = 0;
43
+ result.throughputColor = vec3( 1.0 );
44
+ result.depth = 0u;
45
+ result.fogMaterial.fogVolume = false;
46
+ return result;
47
+
48
+ }
49
+
50
+ `;
@@ -1,54 +1,52 @@
1
- export const traceSceneGLSL = /* glsl */`
2
-
3
- #define NO_HIT 0
4
- #define SURFACE_HIT 1
5
- #define LIGHT_HIT 2
6
- #define FOG_HIT 3
7
-
8
- int traceScene(
9
-
10
- vec3 rayOrigin, vec3 rayDirection,
11
- BVH bvh, LightsInfo lights, Material fogMaterial,
12
- out uvec4 faceIndices, out vec3 faceNormal, out vec3 barycoord, out float side, out float dist,
13
- out LightSampleRecord lightSampleRec
14
-
15
- ) {
16
-
17
- bool hit = bvhIntersectFirstHit( bvh, rayOrigin, rayDirection, faceIndices, faceNormal, barycoord, side, dist );
18
- bool lightHit = lightsClosestHit( lights.tex, lights.count, rayOrigin, rayDirection, lightSampleRec );
19
-
20
- #if FEATURE_FOG
21
-
22
- if ( fogMaterial.fogVolume ) {
23
-
24
- float particleDist = intersectFogVolume( fogMaterial, sobol( 1 ) );
25
- if ( particleDist + 1e-4 < dist && ( particleDist + 1e-4 < lightSampleRec.dist || ! lightHit ) ) {
26
-
27
- side = 1.0;
28
- faceNormal = normalize( - rayDirection );
29
- dist = particleDist;
30
- return FOG_HIT;
31
-
32
- }
33
-
34
- }
35
-
36
- #endif
37
-
38
- if ( lightHit && ( lightSampleRec.dist < dist || ! hit ) ) {
39
-
40
- return LIGHT_HIT;
41
-
42
- }
43
-
44
- if ( hit ) {
45
-
46
- return SURFACE_HIT;
47
-
48
- }
49
-
50
- return NO_HIT;
51
-
52
- }
53
-
54
- `;
1
+ export const traceSceneGLSL = /* glsl */`
2
+
3
+ #define NO_HIT 0
4
+ #define SURFACE_HIT 1
5
+ #define LIGHT_HIT 2
6
+ #define FOG_HIT 3
7
+
8
+ int traceScene(
9
+
10
+ Ray ray, BVH bvh, LightsInfo lights, Material fogMaterial,
11
+ out SurfaceHit surfaceHit, out LightRecord lightRec
12
+
13
+ ) {
14
+
15
+ bool hit = bvhIntersectFirstHit( bvh, ray.origin, ray.direction, surfaceHit.faceIndices, surfaceHit.faceNormal, surfaceHit.barycoord, surfaceHit.side, surfaceHit.dist );
16
+ bool lightHit = lightsClosestHit( lights.tex, lights.count, ray.origin, ray.direction, lightRec );
17
+
18
+ #if FEATURE_FOG
19
+
20
+ if ( fogMaterial.fogVolume ) {
21
+
22
+ float particleDist = intersectFogVolume( fogMaterial, sobol( 1 ) );
23
+ if ( particleDist + 1e-4 < surfaceHit.dist && ( particleDist + 1e-4 < lightRec.dist || ! lightHit ) ) {
24
+
25
+ surfaceHit.side = 1.0;
26
+ surfaceHit.faceNormal = normalize( - ray.direction );
27
+ surfaceHit.dist = particleDist;
28
+ return FOG_HIT;
29
+
30
+ }
31
+
32
+ }
33
+
34
+ #endif
35
+
36
+ if ( lightHit && ( lightRec.dist < surfaceHit.dist || ! hit ) ) {
37
+
38
+ return LIGHT_HIT;
39
+
40
+ }
41
+
42
+ if ( hit ) {
43
+
44
+ return SURFACE_HIT;
45
+
46
+ }
47
+
48
+ return NO_HIT;
49
+
50
+ }
51
+
52
+ `;
@@ -1,207 +1,207 @@
1
- import { TangentSpaceNormalMap, Vector2 } from 'three';
2
- import { MaterialBase } from '../MaterialBase.js';
3
- import { MeshBVHUniformStruct, shaderStructs, shaderIntersectFunction } from 'three-mesh-bvh';
4
-
5
- import { materialStructGLSL } from '../../shader/structs/materialStruct.glsl.js';
6
- import { shapeSamplingGLSL } from '../../shader/sampling/shapeSampling.glsl.js';
7
- import { pcgGLSL } from '../../shader/rand/pcg.glsl.js';
8
-
9
- export class AmbientOcclusionMaterial extends MaterialBase {
10
-
11
- get normalMap() {
12
-
13
- return this.uniforms.normalMap.value;
14
-
15
- }
16
-
17
- set normalMap( v ) {
18
-
19
- this.uniforms.normalMap.value = v;
20
- this.setDefine( 'USE_NORMALMAP', v ? null : '' );
21
-
22
- }
23
-
24
- get normalMapType() {
25
-
26
- return TangentSpaceNormalMap;
27
-
28
- }
29
-
30
- set normalMapType( v ) {
31
-
32
- if ( v !== TangentSpaceNormalMap ) {
33
-
34
- throw new Error( 'AmbientOcclusionMaterial: Only tangent space normal map are supported' );
35
-
36
- }
37
-
38
- }
39
-
40
- constructor( parameters ) {
41
-
42
- super( {
43
-
44
- defines: {
45
- SAMPLES: 10,
46
- },
47
-
48
- uniforms: {
49
- bvh: { value: new MeshBVHUniformStruct() },
50
- radius: { value: 1.0 },
51
- seed: { value: 0 },
52
-
53
- normalMap: { value: null },
54
- normalScale: { value: new Vector2( 1, 1 ) },
55
- },
56
-
57
- vertexShader: /* glsl */`
58
-
59
- varying vec3 vNorm;
60
- varying vec3 vPos;
61
-
62
- #if defined(USE_NORMALMAP) && defined(USE_TANGENT)
63
-
64
- varying vec2 vUv;
65
- varying vec4 vTan;
66
-
67
- #endif
68
-
69
- void main() {
70
-
71
- vec4 mvPosition = vec4( position, 1.0 );
72
- mvPosition = modelViewMatrix * mvPosition;
73
- gl_Position = projectionMatrix * mvPosition;
74
-
75
- mat3 modelNormalMatrix = transpose( inverse( mat3( modelMatrix ) ) );
76
- vNorm = normalize( modelNormalMatrix * normal );
77
- vPos = ( modelMatrix * vec4( position, 1.0 ) ).xyz;
78
-
79
- #if defined( USE_NORMALMAP ) && defined( USE_TANGENT )
80
-
81
- vUv = uv;
82
- vTan = tangent;
83
-
84
- #endif
85
-
86
- }
87
-
88
- `,
89
-
90
- fragmentShader: /* glsl */`
91
- #define RAY_OFFSET 1e-4
92
-
93
- precision highp isampler2D;
94
- precision highp usampler2D;
95
- precision highp sampler2DArray;
96
- #include <common>
97
- #include <cube_uv_reflection_fragment>
98
-
99
- // bvh
100
- ${ shaderStructs }
101
- ${ shaderIntersectFunction }
102
-
103
- // uniform structs
104
- ${ materialStructGLSL }
105
-
106
- // rand
107
- ${ pcgGLSL }
108
-
109
- // common
110
- ${ shapeSamplingGLSL }
111
-
112
- uniform BVH bvh;
113
- uniform int seed;
114
- uniform float radius;
115
-
116
- varying vec3 vNorm;
117
- varying vec3 vPos;
118
-
119
- #if defined(USE_NORMALMAP) && defined(USE_TANGENT)
120
-
121
- uniform sampler2D normalMap;
122
- uniform vec2 normalScale;
123
- varying vec2 vUv;
124
- varying vec4 vTan;
125
-
126
- #endif
127
-
128
- void main() {
129
-
130
- rng_initialize( gl_FragCoord.xy, seed );
131
-
132
- // compute the flat face surface normal
133
- vec3 fdx = vec3( dFdx( vPos.x ), dFdx( vPos.y ), dFdx( vPos.z ) );
134
- vec3 fdy = vec3( dFdy( vPos.x ), dFdy( vPos.y ), dFdy( vPos.z ) );
135
- vec3 faceNormal = normalize( cross( fdx, fdy ) );
136
-
137
- // find the max component to scale the offset to account for floating point error
138
- vec3 absPoint = abs( vPos );
139
- float maxPoint = max( absPoint.x, max( absPoint.y, absPoint.z ) );
140
- vec3 normal = vNorm;
141
-
142
- #if defined( USE_NORMALMAP ) && defined( USE_TANGENT )
143
-
144
- // some provided tangents can be malformed (0, 0, 0) causing the normal to be degenerate
145
- // resulting in NaNs and slow path tracing.
146
- if ( length( vTan.xyz ) > 0.0 ) {
147
-
148
- vec2 uv = vUv;
149
- vec3 tangent = normalize( vTan.xyz );
150
- vec3 bitangent = normalize( cross( normal, tangent ) * vTan.w );
151
- mat3 vTBN = mat3( tangent, bitangent, normal );
152
-
153
- vec3 texNormal = texture2D( normalMap, uv ).xyz * 2.0 - 1.0;
154
- texNormal.xy *= normalScale;
155
- normal = vTBN * texNormal;
156
-
157
- }
158
-
159
- #endif
160
-
161
- normal *= gl_FrontFacing ? 1.0 : - 1.0;
162
-
163
- vec3 rayOrigin = vPos + faceNormal * ( maxPoint + 1.0 ) * RAY_OFFSET;
164
- float accumulated = 0.0;
165
- for ( int i = 0; i < SAMPLES; i ++ ) {
166
-
167
- // sample the cosine weighted hemisphere and discard the sample if it's below
168
- // the geometric surface
169
- vec3 rayDirection = sampleHemisphere( normalize( normal ), rand4().xy );
170
-
171
- // check if we hit the mesh and its within the specified radius
172
- float side = 1.0;
173
- float dist = 0.0;
174
- vec3 barycoord = vec3( 0.0 );
175
- vec3 outNormal = vec3( 0.0 );
176
- uvec4 faceIndices = uvec4( 0u );
177
-
178
- // if the ray is above the geometry surface, and it doesn't hit another surface within the specified radius then
179
- // we consider it lit
180
- if (
181
- dot( rayDirection, faceNormal ) > 0.0 &&
182
- (
183
- ! bvhIntersectFirstHit( bvh, rayOrigin, rayDirection, faceIndices, outNormal, barycoord, side, dist ) ||
184
- dist > radius
185
- )
186
- ) {
187
-
188
- accumulated += 1.0;
189
-
190
- }
191
-
192
- }
193
-
194
- gl_FragColor.rgb = vec3( accumulated / float( SAMPLES ) );
195
- gl_FragColor.a = 1.0;
196
-
197
- }
198
-
199
- `
200
-
201
- } );
202
-
203
- this.setValues( parameters );
204
-
205
- }
206
-
207
- }
1
+ import { TangentSpaceNormalMap, Vector2 } from 'three';
2
+ import { MaterialBase } from '../MaterialBase.js';
3
+ import { MeshBVHUniformStruct, shaderStructs, shaderIntersectFunction } from 'three-mesh-bvh';
4
+
5
+ import { materialStructGLSL } from '../../shader/structs/materialStruct.glsl.js';
6
+ import { shapeSamplingGLSL } from '../../shader/sampling/shapeSampling.glsl.js';
7
+ import { pcgGLSL } from '../../shader/rand/pcg.glsl.js';
8
+
9
+ export class AmbientOcclusionMaterial extends MaterialBase {
10
+
11
+ get normalMap() {
12
+
13
+ return this.uniforms.normalMap.value;
14
+
15
+ }
16
+
17
+ set normalMap( v ) {
18
+
19
+ this.uniforms.normalMap.value = v;
20
+ this.setDefine( 'USE_NORMALMAP', v ? null : '' );
21
+
22
+ }
23
+
24
+ get normalMapType() {
25
+
26
+ return TangentSpaceNormalMap;
27
+
28
+ }
29
+
30
+ set normalMapType( v ) {
31
+
32
+ if ( v !== TangentSpaceNormalMap ) {
33
+
34
+ throw new Error( 'AmbientOcclusionMaterial: Only tangent space normal map are supported' );
35
+
36
+ }
37
+
38
+ }
39
+
40
+ constructor( parameters ) {
41
+
42
+ super( {
43
+
44
+ defines: {
45
+ SAMPLES: 10,
46
+ },
47
+
48
+ uniforms: {
49
+ bvh: { value: new MeshBVHUniformStruct() },
50
+ radius: { value: 1.0 },
51
+ seed: { value: 0 },
52
+
53
+ normalMap: { value: null },
54
+ normalScale: { value: new Vector2( 1, 1 ) },
55
+ },
56
+
57
+ vertexShader: /* glsl */`
58
+
59
+ varying vec3 vNorm;
60
+ varying vec3 vPos;
61
+
62
+ #if defined(USE_NORMALMAP) && defined(USE_TANGENT)
63
+
64
+ varying vec2 vUv;
65
+ varying vec4 vTan;
66
+
67
+ #endif
68
+
69
+ void main() {
70
+
71
+ vec4 mvPosition = vec4( position, 1.0 );
72
+ mvPosition = modelViewMatrix * mvPosition;
73
+ gl_Position = projectionMatrix * mvPosition;
74
+
75
+ mat3 modelNormalMatrix = transpose( inverse( mat3( modelMatrix ) ) );
76
+ vNorm = normalize( modelNormalMatrix * normal );
77
+ vPos = ( modelMatrix * vec4( position, 1.0 ) ).xyz;
78
+
79
+ #if defined( USE_NORMALMAP ) && defined( USE_TANGENT )
80
+
81
+ vUv = uv;
82
+ vTan = tangent;
83
+
84
+ #endif
85
+
86
+ }
87
+
88
+ `,
89
+
90
+ fragmentShader: /* glsl */`
91
+ #define RAY_OFFSET 1e-4
92
+
93
+ precision highp isampler2D;
94
+ precision highp usampler2D;
95
+ precision highp sampler2DArray;
96
+ #include <common>
97
+ #include <cube_uv_reflection_fragment>
98
+
99
+ // bvh
100
+ ${ shaderStructs }
101
+ ${ shaderIntersectFunction }
102
+
103
+ // uniform structs
104
+ ${ materialStructGLSL }
105
+
106
+ // rand
107
+ ${ pcgGLSL }
108
+
109
+ // common
110
+ ${ shapeSamplingGLSL }
111
+
112
+ uniform BVH bvh;
113
+ uniform int seed;
114
+ uniform float radius;
115
+
116
+ varying vec3 vNorm;
117
+ varying vec3 vPos;
118
+
119
+ #if defined(USE_NORMALMAP) && defined(USE_TANGENT)
120
+
121
+ uniform sampler2D normalMap;
122
+ uniform vec2 normalScale;
123
+ varying vec2 vUv;
124
+ varying vec4 vTan;
125
+
126
+ #endif
127
+
128
+ void main() {
129
+
130
+ rng_initialize( gl_FragCoord.xy, seed );
131
+
132
+ // compute the flat face surface normal
133
+ vec3 fdx = vec3( dFdx( vPos.x ), dFdx( vPos.y ), dFdx( vPos.z ) );
134
+ vec3 fdy = vec3( dFdy( vPos.x ), dFdy( vPos.y ), dFdy( vPos.z ) );
135
+ vec3 faceNormal = normalize( cross( fdx, fdy ) );
136
+
137
+ // find the max component to scale the offset to account for floating point error
138
+ vec3 absPoint = abs( vPos );
139
+ float maxPoint = max( absPoint.x, max( absPoint.y, absPoint.z ) );
140
+ vec3 normal = vNorm;
141
+
142
+ #if defined( USE_NORMALMAP ) && defined( USE_TANGENT )
143
+
144
+ // some provided tangents can be malformed (0, 0, 0) causing the normal to be degenerate
145
+ // resulting in NaNs and slow path tracing.
146
+ if ( length( vTan.xyz ) > 0.0 ) {
147
+
148
+ vec2 uv = vUv;
149
+ vec3 tangent = normalize( vTan.xyz );
150
+ vec3 bitangent = normalize( cross( normal, tangent ) * vTan.w );
151
+ mat3 vTBN = mat3( tangent, bitangent, normal );
152
+
153
+ vec3 texNormal = texture2D( normalMap, uv ).xyz * 2.0 - 1.0;
154
+ texNormal.xy *= normalScale;
155
+ normal = vTBN * texNormal;
156
+
157
+ }
158
+
159
+ #endif
160
+
161
+ normal *= gl_FrontFacing ? 1.0 : - 1.0;
162
+
163
+ vec3 rayOrigin = vPos + faceNormal * ( maxPoint + 1.0 ) * RAY_OFFSET;
164
+ float accumulated = 0.0;
165
+ for ( int i = 0; i < SAMPLES; i ++ ) {
166
+
167
+ // sample the cosine weighted hemisphere and discard the sample if it's below
168
+ // the geometric surface
169
+ vec3 rayDirection = sampleHemisphere( normalize( normal ), rand4().xy );
170
+
171
+ // check if we hit the mesh and its within the specified radius
172
+ float side = 1.0;
173
+ float dist = 0.0;
174
+ vec3 barycoord = vec3( 0.0 );
175
+ vec3 outNormal = vec3( 0.0 );
176
+ uvec4 faceIndices = uvec4( 0u );
177
+
178
+ // if the ray is above the geometry surface, and it doesn't hit another surface within the specified radius then
179
+ // we consider it lit
180
+ if (
181
+ dot( rayDirection, faceNormal ) > 0.0 &&
182
+ (
183
+ ! bvhIntersectFirstHit( bvh, rayOrigin, rayDirection, faceIndices, outNormal, barycoord, side, dist ) ||
184
+ dist >= radius
185
+ )
186
+ ) {
187
+
188
+ accumulated += 1.0;
189
+
190
+ }
191
+
192
+ }
193
+
194
+ gl_FragColor.rgb = vec3( accumulated / float( SAMPLES ) );
195
+ gl_FragColor.a = 1.0;
196
+
197
+ }
198
+
199
+ `
200
+
201
+ } );
202
+
203
+ this.setValues( parameters );
204
+
205
+ }
206
+
207
+ }
@@ -1,23 +1,23 @@
1
- import { Color, MeshStandardMaterial } from 'three';
2
-
3
- export class FogVolumeMaterial extends MeshStandardMaterial {
4
-
5
- constructor( params ) {
6
-
7
- super( params );
8
-
9
- this.isFogVolumeMaterial = true;
10
-
11
- this.density = 0.015;
12
- this.emissive = new Color();
13
- this.emissiveIntensity = 0.0;
14
- this.opacity = 0.15;
15
- this.transparent = true;
16
- this.roughness = 1.0;
17
- this.metalness = 0.0;
18
-
19
- this.setValues( params );
20
-
21
- }
22
-
23
- }
1
+ import { Color, MeshStandardMaterial } from 'three';
2
+
3
+ export class FogVolumeMaterial extends MeshStandardMaterial {
4
+
5
+ constructor( params ) {
6
+
7
+ super( params );
8
+
9
+ this.isFogVolumeMaterial = true;
10
+
11
+ this.density = 0.015;
12
+ this.emissive = new Color();
13
+ this.emissiveIntensity = 0.0;
14
+ this.opacity = 0.15;
15
+ this.transparent = true;
16
+ this.roughness = 1.0;
17
+ this.metalness = 0.0;
18
+
19
+ this.setValues( params );
20
+
21
+ }
22
+
23
+ }
@@ -1,13 +1,13 @@
1
- import { Camera } from 'three';
2
-
3
- export class EquirectCamera extends Camera {
4
-
5
- constructor() {
6
-
7
- super();
8
-
9
- this.isEquirectCamera = true;
10
-
11
- }
12
-
13
- }
1
+ import { Camera } from 'three';
2
+
3
+ export class EquirectCamera extends Camera {
4
+
5
+ constructor() {
6
+
7
+ super();
8
+
9
+ this.isEquirectCamera = true;
10
+
11
+ }
12
+
13
+ }