Skip to content
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
2 changes: 1 addition & 1 deletion editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Strings } from './Strings.js';
import { Storage as _Storage } from './Storage.js';
import { Selector } from './Selector.js';

var _DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.01, 1000 );
var _DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.001, 1e10 );
_DEFAULT_CAMERA.name = 'Camera';
_DEFAULT_CAMERA.position.set( 0, 5, 10 );
_DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
Expand Down
2 changes: 1 addition & 1 deletion editor/js/Menubar.Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class RenderImageDialog {

const scene = await loader.parseAsync( json.scene );

const renderer = new THREE.WebGLRenderer( { antialias: true } );
const renderer = new THREE.WebGLRenderer( { antialias: true, logarithmicDepthBuffer: true } );
renderer.setSize( imageWidth.getValue(), imageHeight.getValue() );

if ( project.shadows !== undefined ) renderer.shadowMap.enabled = project.shadows;
Expand Down
2 changes: 1 addition & 1 deletion editor/js/Sidebar.Project.Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function SidebarProjectRenderer( editor ) {

function createRenderer() {

currentRenderer = new THREE.WebGLRenderer( { antialias: antialiasBoolean.getValue() } );
currentRenderer = new THREE.WebGLRenderer( { antialias: antialiasBoolean.getValue(), logarithmicDepthBuffer: true } );
currentRenderer.shadowMap.enabled = shadowsBoolean.getValue();
currentRenderer.shadowMap.type = parseFloat( shadowTypeSelect.getValue() );
currentRenderer.toneMapping = parseFloat( toneMappingSelect.getValue() );
Expand Down
2 changes: 1 addition & 1 deletion editor/js/libs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const APP = {

Player: function () {

const renderer = new THREE.WebGLRenderer( { antialias: true } );
const renderer = new THREE.WebGLRenderer( { antialias: true, logarithmicDepthBuffer: true } );
renderer.setPixelRatio( window.devicePixelRatio ); // TODO: Use player.setPixelRatio()

const loader = new THREE.ObjectLoader();
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/CameraHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const _camera = /*@__PURE__*/ new Camera();
*
* `CameraHelper` must be a child of the scene.
*
* When the camera is transformed or its projection matrix is changed, it's necessary
* to call the `update()` method of the respective helper.
*
* ```js
* const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
* const helper = new THREE.CameraHelper( camera );
Expand Down
5 changes: 4 additions & 1 deletion src/helpers/DirectionalLightHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ const _v3 = /*@__PURE__*/ new Vector3();

/**
* Helper object to assist with visualizing a {@link DirectionalLight}'s
* effect on the scene. This consists of plane and a line representing the
* effect on the scene. This consists of a plane and a line representing the
* light's position and direction.
*
* When the directional light or its target are transformed or light properties
* are changed, it's necessary to call the `update()` method of the respective helper.
*
* ```js
* const light = new THREE.DirectionalLight( 0xFFFFFF );
* scene.add( light );
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/HemisphereLightHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const _color2 = /*@__PURE__*/ new Color();
* Creates a visual aid consisting of a spherical mesh for a
* given {@link HemisphereLight}.
*
* When the hemisphere light is transformed or its light properties are changed,
* it's necessary to call the `update()` method of the respective helper.
*
* ```js
* const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
* const helper = new THREE.HemisphereLightHelper( light, 5 );
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/SpotLightHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const _vector = /*@__PURE__*/ new Vector3();
/**
* This displays a cone shaped helper object for a {@link SpotLight}.
*
* When the spot light or its target are transformed or light properties are
* changed, it's necessary to call the `update()` method of the respective helper.
*
* ```js
* const spotLight = new THREE.SpotLight( 0xffffff );
* spotLight.position.set( 10, 10, 10 );
Expand Down
16 changes: 10 additions & 6 deletions src/renderers/webgpu/utils/WebGPUUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@ class WebGPUUtils {

let format;

if ( renderContext.depthTexture !== null ) {
if ( renderContext.depth ) {

format = this.getTextureFormatGPU( renderContext.depthTexture );
if ( renderContext.depthTexture !== null ) {

} else if ( renderContext.depth && renderContext.stencil ) {
format = this.getTextureFormatGPU( renderContext.depthTexture );

format = GPUTextureFormat.Depth24PlusStencil8;
} else if ( renderContext.stencil ) {

} else if ( renderContext.depth ) {
format = GPUTextureFormat.Depth24PlusStencil8;

format = GPUTextureFormat.Depth24Plus;
} else {

format = GPUTextureFormat.Depth24Plus;

}

}

Expand Down