Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Examples: GTAOPass - distance dependent horizon search #710

Merged
merged 5 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10938,7 +10938,7 @@ index 47e89f6..4329bfe 100644
renderer.setRenderTarget(null);
renderer.clear();
diff --git a/examples-testing/examples/webgl_postprocessing_gtao.ts b/examples-testing/examples/webgl_postprocessing_gtao.ts
index 8993081..67c578c 100644
index e004cea..d4483b3 100644
--- a/examples-testing/examples/webgl_postprocessing_gtao.ts
+++ b/examples-testing/examples/webgl_postprocessing_gtao.ts
@@ -10,7 +10,14 @@ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
Expand Down Expand Up @@ -12205,10 +12205,10 @@ index 122fa84..e539bef 100644
if (morph.position.x > 2000) {
morph.position.x = -1000 - Math.random() * 500;
diff --git a/examples-testing/examples/webgl_shadowmap_csm.ts b/examples-testing/examples/webgl_shadowmap_csm.ts
index f9df4ab..d2646fa 100644
index bdcd49f..0fc8a64 100644
--- a/examples-testing/examples/webgl_shadowmap_csm.ts
+++ b/examples-testing/examples/webgl_shadowmap_csm.ts
@@ -2,12 +2,31 @@ import * as THREE from 'three';
@@ -2,12 +2,32 @@ import * as THREE from 'three';

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
Expand All @@ -12230,6 +12230,7 @@ index f9df4ab..d2646fa 100644
+const params: {
+ orthographic: boolean;
+ fade: boolean;
+ shadows: boolean;
+ far: number;
+ mode: CSMMode;
+ lightX: number;
Expand All @@ -12243,7 +12244,18 @@ index f9df4ab..d2646fa 100644
+} = {
orthographic: false,
fade: false,
far: 1000,
shadows: true,
@@ -133,8 +153,8 @@ function init() {
renderer.shadowMap.enabled = value;

scene.traverse(function (child) {
- if (child.material) {
- child.material.needsUpdate = true;
+ if ((child as THREE.Mesh<THREE.BufferGeometry, THREE.Material>).material) {
+ (child as THREE.Mesh<THREE.BufferGeometry, THREE.Material>).material.needsUpdate = true;
}
});
});
diff --git a/examples-testing/examples/webgl_shadowmap_pcss.ts b/examples-testing/examples/webgl_shadowmap_pcss.ts
index 91ba360..230059a 100644
--- a/examples-testing/examples/webgl_shadowmap_pcss.ts
Expand Down
2 changes: 2 additions & 0 deletions examples-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,10 @@ const files = {
'webgpu_loader_gltf_compressed',
'webgpu_loader_gltf_iridescence',
'webgpu_loader_gltf_sheen',
// 'webgpu_loader_materialx',
// 'webgpu_materials',
'webgpu_materials_video',
// 'webgpu_materialx_noise',
// 'webgpu_multiple_rendertargets',
'webgpu_morphtargets',
'webgpu_morphtargets_face',
Expand Down
1 change: 1 addition & 0 deletions types/three/examples/jsm/postprocessing/GTAOPass.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class GTAOPass extends Pass {
radius?: number | undefined;
distanceExponent?: number | undefined;
thickness?: number | undefined;
distanceFallOff?: number | undefined;
scale?: number | undefined;
samples?: number | undefined;
screenSpaceRadius?: boolean | undefined;
Expand Down
2 changes: 2 additions & 0 deletions types/three/examples/jsm/shaders/GTAOShader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const GTAOShader: {
cameraProjectionMatrixInverse: IUniform<Matrix4>;
radius: IUniform<number>;
distanceExponent: IUniform<number>;
thickness: IUniform<number>;
distanceFallOff: IUniform<number>;
scale: IUniform<number>;
sceneBoxMin: IUniform<Vector3>;
sceneBoxMax: IUniform<Vector3>;
Expand Down