Skip to content

Commit

Permalink
perf(landing): disable textgeometry render
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed May 5, 2023
1 parent 0fdcee0 commit bb6dbac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/app/src/pages/Landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
href="https://github.com/Novout/betterwrite"
class="flex font-raleway items-center gap-3 absolute bottom-0 right-0 p-5 cursor-pointer"
>
<IconGithub class="text-gray-200 w-7 h-7" />
<IconGithub class="text-gray-200 w-9 h-9" />
</a>
<a
v-motion
Expand All @@ -88,9 +88,9 @@
target="_blank"
rel="noopener noreferrer"
href="https://twitter.com/betterwriteio"
class="flex font-raleway items-center gap-3 absolute bottom-0 right-12 p-5 cursor-pointer"
class="flex font-raleway items-center gap-3 absolute bottom-0 right-15 p-5 cursor-pointer"
>
<IconTwitter class="text-gray-200 w-7 h-7" />
<IconTwitter class="text-gray-200 w-9 h-9" />
</a>
</div>
<AuthMain v-else @close="isNecessaryLogin = false" />
Expand Down
10 changes: 7 additions & 3 deletions packages/plugin-webgl/src/background.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from 'three'
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader.js'
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js'
// import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js'
import WebGL from 'three/examples/jsm/capabilities/WebGL.js'
import { usePlugin } from 'better-write-plugin-core'
import { PluginTypes } from 'better-write-types'
Expand All @@ -21,7 +21,8 @@ export const BackgroundSet = (
const _cloudParticles: any = []
const meshArray: any = []

const { getLocaleMessage, locale } = hooks.i18n
// const { getLocaleMessage, locale } = hooks.i18n

const plugin = usePlugin()

const setCamera = () => {
Expand Down Expand Up @@ -108,6 +109,7 @@ export const BackgroundSet = (
}

const createNodes = () => {
/*
const { landing }: any = getLocaleMessage(locale.value)
const paragraphs = landing.first.paragraphs
Expand All @@ -130,6 +132,7 @@ export const BackgroundSet = (
meshArray.push(mesh)
scene.add(mesh)
})
*/
}

const render = () => {
Expand Down Expand Up @@ -173,7 +176,8 @@ export const BackgroundSet = (
cameraCreate()
rendererCreate()
loaderSmoke()
createNodes()
// TODO: better perfomatic textgeometry cache. Actually is slow runtime.
// createNodes()
contextResize()
createLight()
contextResize()
Expand Down

0 comments on commit bb6dbac

Please sign in to comment.