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

在第一版的Vr看房那个渲染函数有很大的性能问题 #2

Open
iEfoam opened this issue Apr 27, 2023 · 1 comment
Open

Comments

@iEfoam
Copy link

iEfoam commented Apr 27, 2023

在每一帧去用射线判断是否在视口内 来判定是否渲染 执行你这边的函数后 性能下降了2/3 建议不用那个addclass和removeclass 直接使用transform去控制显示和隐藏 这样性能有所提高 使用之后我这边从70fps上身到了200fps
if (Math.abs(pos.x) > 1 || Math.abs(pos.y) > 1 || Math.abs(pos.z) > 1) {
// 点在摄像机外面 不显示
console.log(point.title, '在视口外面')
point.element.style.transform = scale(0, 0)
continue
}

@wangyingjie123
Copy link

确实是,性能影响很大

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants