所以,我使用SceneKit来渲染一组参数曲面(其总和构成一个对象).为了将这些放在屏幕上,我通过采样点和创建三角形来创建自定义几何.这是我如何做到这一点的快速视图.
Loop through the collection of surfaces
Generate a random color C
For each surface calculate a grid of N x N points (both positions and normals)
Assign all vertexes for that surface the color C
Add groups of 3 vertexes from this surface to the face index list
Run Code Online (Sandbox Code Playgroud)
这似乎有效.在我获得所有这些数据后,我将其转换为正确的结构(SCNGeometrySource和SCNGeometryElement)并制作SCNGeometry,如此
SCNGeometry(sources: [vertexSource, normalSource, colorSource], elements: [element])
Run Code Online (Sandbox Code Playgroud)
这样可以在屏幕上显示我的曲面作为单个几何元素.我的问题是,我有一些非常复杂的对象,我正在尝试使用它,并且在查看对象时移动相机的速度非常慢.渲染大约需要500毫秒.这使我的帧率和体验变得糟糕.
所以问题是,我可以采取哪些步骤来加速SceneKit的性能?我使用具有相同数据量的Three.js的WebGL做了同样的项目,并且能够使用轨道相机很好,所以我无法相信场景套件至少无法与之竞争.我可以调整和关闭哪些功能以加快性能?我使用的是三角形基本类型,轨道相机的allowsCameraControl = true,以及SCNView的金属.
对于那些好奇的人,我正在努力的模型为面部生成231,900个顶点和347,850个索引(11.1312 MB的顶点数据(位置和法线)和1.3914 MB的面部数据(基本上只是顶点的索引位置以便三角形.))
所以我正在建立一个新的网站,链接,但由于某种原因没有文件夹有完整的SSL图标.顶级index.php文件具有锁定,但文件夹try/blog中的任何内容都具有partial-ssl.它有锁,但由于"有人可以改变这个页面的外观"类型错误而隐藏它.请帮助,因为我不知道为什么这是hapenning.我确实使用cloudflare,并设置了一个http://qualexcraft.tk/*页面规则来强制https.
更新:现在没有文件夹或文件具有完整锁定
对于任何感兴趣的人,这是我的htaccess文件:
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
ErrorDocument 404 http://qualexcraft.tk/404
# Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.qualexcraft\.tk [NC]
RewriteRule (.*) https://qualexcraft.tk/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)
目录结构:
的index.php
404
index.php
old.php
Run Code Online (Sandbox Code Playgroud)
资产
images
Run Code Online (Sandbox Code Playgroud)
博客
allPosts
index.php
Run Code Online (Sandbox Code Playgroud)
包括
headers
head.html
index.html
layout
footer.html
navbar.html
Run Code Online (Sandbox Code Playgroud)
地图
MDL
[mdl files]
Run Code Online (Sandbox Code Playgroud)