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

Optimize non 3d webpages from rendering canvas #10421

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
40d9a0c
initial work to separate engine canvas as requirement
HexaField Jun 20, 2024
b41efdd
studio works
HexaField Jun 20, 2024
b1b42ea
fixes
HexaField Jun 20, 2024
70d9619
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 20, 2024
1ea319c
studio fixes
HexaField Jun 20, 2024
dd9aefd
fix cache busting for admin panel
HexaField Jun 20, 2024
70daa18
license
HexaField Jun 20, 2024
e2fcc45
fix preview panels, various bug fixes
HexaField Jun 21, 2024
c6f0005
fix checks and tests
HexaField Jun 21, 2024
23b927e
visual script, particles
HexaField Jun 21, 2024
fba15eb
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 21, 2024
7354e1d
fix
HexaField Jun 21, 2024
7237bbd
add dispose to mock renderer
HexaField Jun 21, 2024
2e88d02
skip visual script tests
HexaField Jun 21, 2024
1737abc
console log
HexaField Jun 21, 2024
084285f
add note
HexaField Jun 21, 2024
7ae328a
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 21, 2024
2dd466e
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 24, 2024
45662dc
fix error with renderer system test, don't start time for tests
HexaField Jun 25, 2024
2c54141
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 25, 2024
4131f8f
format
HexaField Jun 25, 2024
4d6ec2d
fix regressions
HexaField Jun 25, 2024
3e5da7d
fix destroying spatial entities
HexaField Jun 25, 2024
d2430c3
fix zindex for viewport toolbar
HexaField Jun 25, 2024
58080e3
client input system was still running if no viewer was available
DanielBelmes Jun 25, 2024
92f19a2
revert
HexaField Jun 25, 2024
afb28d0
Merge branch 'dev' into IR-2746-Optimize-performance-of-webpages-when…
HexaField Jun 25, 2024
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
Prev Previous commit
Next Next commit
fix error with renderer system test, don't start time for tests
  • Loading branch information
HexaField committed Jun 25, 2024
commit 45662dcf3b5f26aaf161ac5ccc09878daacc177f
4 changes: 3 additions & 1 deletion packages/client/src/engine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ import { BrowserRouter, history } from '@etherealengine/client-core/src/common/s
import waitForClientAuthenticated from '@etherealengine/client-core/src/util/wait-for-client-authenticated'
import { pipeLogs } from '@etherealengine/common/src/logger'
import { Engine } from '@etherealengine/ecs/src/Engine'
import { getMutableState } from '@etherealengine/hyperflux'
import { getMutableState, getState } from '@etherealengine/hyperflux'
import { EngineState } from '@etherealengine/spatial/src/EngineState'

import { ECSState } from '@etherealengine/ecs'
import { createEngine } from '@etherealengine/spatial/src/initializeEngine'
import LoadingView from '@etherealengine/ui/src/primitives/tailwind/LoadingView'
import { initializei18n } from './util'
Expand All @@ -44,6 +45,7 @@ const initializeLogs = async () => {
}

createEngine()
getState(ECSState).timer.start()
getMutableState(EngineState).publicPath.set(
// @ts-ignore
import.meta.env.BASE_URL === '/client/' ? location.origin : import.meta.env.BASE_URL!.slice(0, -1) // remove trailing '/'
Expand Down
4 changes: 3 additions & 1 deletion packages/server-core/src/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ import healthcheck from 'koa-simple-healthcheck'
import { pipeLogs } from '@etherealengine/common/src/logger'
import { pipe } from '@etherealengine/common/src/utils/pipe'
import { Engine } from '@etherealengine/ecs/src/Engine'
import { getMutableState } from '@etherealengine/hyperflux'
import { getMutableState, getState } from '@etherealengine/hyperflux'
import { EngineState } from '@etherealengine/spatial/src/EngineState'
import { createEngine } from '@etherealengine/spatial/src/initializeEngine'

import { ECSState } from '@etherealengine/ecs'
import { Application } from '../declarations'
import { default as appConfig, default as config } from './appconfig'
import authenticate from './hooks/authenticate'
Expand Down Expand Up @@ -175,6 +176,7 @@ export const createFeathersKoaApp = (
configurationPipe = serverPipe
): Application => {
createEngine()
getState(ECSState).timer.start()

const serverState = getMutableState(ServerState)
serverState.serverMode.set(serverMode)
Expand Down
1 change: 0 additions & 1 deletion packages/spatial/src/initializeEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const createEngine = () => {
executeSystems(time)
getMutableState(XRState).xrFrame.set(null)
})
timer.start()
getMutableState(ECSState).timer.set(timer)
}

Expand Down
19 changes: 10 additions & 9 deletions packages/spatial/src/renderer/WebGLRendererSystem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
// */

import {
Engine,
Entity,
EntityUUID,
SystemDefinitions,
Expand All @@ -38,12 +37,13 @@ import {
import { getMutableState } from '@etherealengine/hyperflux'
import { act, render } from '@testing-library/react'
import assert from 'assert'
import { EffectComposer, RenderPass } from 'postprocessing'
import { EffectComposer } from 'postprocessing'
import React from 'react'
import { Color, Group, MathUtils, Texture } from 'three'
import { MockEngineRenderer } from '../../tests/util/MockEngineRenderer'
import { EngineState } from '../EngineState'
import { CameraComponent } from '../camera/components/CameraComponent'
import { createEngine, initializeSpatialEngine } from '../initializeEngine'
import { createEngine } from '../initializeEngine'
import { EntityTreeComponent } from '../transform/components/EntityTree'
import { RendererState } from './RendererState'
import {
Expand Down Expand Up @@ -80,9 +80,9 @@ describe('WebGl Renderer System', () => {

beforeEach(() => {
createEngine()
initializeSpatialEngine()

rootEntity = Engine.instance.viewerEntity //createEntity()
rootEntity = createEntity()
getMutableState(EngineState).viewerEntity.set(rootEntity)
setComponent(rootEntity, UUIDComponent, MathUtils.generateUUID() as EntityUUID)
setComponent(rootEntity, EntityTreeComponent)
setComponent(rootEntity, CameraComponent)
Expand Down Expand Up @@ -176,11 +176,12 @@ describe('WebGl Renderer System', () => {

const camera = getComponent(rootEntity, CameraComponent)
const rendererComp = getComponent(rootEntity, RendererComponent)
const effectComposer = rendererComp.effectComposer
const passes = effectComposer?.passes.filter((p) => p.name === 'RenderPass') as any
const renderPass: RenderPass = passes ? passes[0] : undefined
/** @todo we never add a PostProcessing component, so why are these tests expecting an effect composer? */
// const effectComposer = rendererComp.effectComposer
// const passes = effectComposer?.passes.filter((p) => p.name === 'RenderPass') as any
// const renderPass: RenderPass = passes ? passes[0] : undefined

assert(renderPass.overrideMaterial, 'change render mode')
// assert(renderPass.overrideMaterial, 'change render mode')
assert(rendererComp.needsResize, 'change render scale')
assert(camera.layers.isEnabled(ObjectLayers.PhysicsHelper), 'enable physicsDebug')
assert(camera.layers.isEnabled(ObjectLayers.AvatarHelper), 'enable avatarDebug')
Expand Down
4 changes: 2 additions & 2 deletions packages/spatial/src/renderer/WebGLRendererSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const RendererComponent = defineComponent({
},

onRemove(entity, component) {
component.renderer.value.dispose()
component.effectComposer.value?.dispose()
component.value.renderer.dispose()
component.value.effectComposer?.dispose()
}
})

Expand Down
Loading