SceneKit_大神03_navigationbar上的3D文字
让学习成为一种习惯
基础的教程也写的差不多了,我觉得是时候帮大家深入的了解一些东西!不然后面的东西,你们学的很吃力。
scnView.preferredFramesPerSecond = 30;
FP = 60
CUP 消耗挺高的
FP = 10
降低不少
为什么设置帧率?
当我们的游戏画面能够满足我们的画质要求和性能要求的时候,尽量把帧率设置低点,这样能够节省我们的CPU 资源
[self.scnView snapshot]
- (IBAction)stop:(nullable id)sender;
- (IBAction)pause:(nullable id)sender;
- (IBAction)play:(nullable id)sender;
测试没有用,可能需要在xib才能中使用,先留个问题。
*怎么查看游戏引擎的类型
if (scnView.eaglContext){
NSLog(@"OpenGL");
}else{
NSLog(@"metal");
}
开启抗锯齿功能,默认是关闭的
scnView.antialiasingMode = SCNAntialiasingModeMultisampling4X;
关闭抗锯齿
开启抗锯齿
你应该这样初始化
SCNView *scnView = [[SCNView alloc]initWithFrame:self.view.bounds options:@{SCNPreferLowPowerDeviceKey:@(true)}];
我们看看有什么可选项
// OpenGL
SCN_EXTERN NSString * const SCNPreferredRenderingAPIKey NS_AVAILABLE(10_11, 9_0);
// 指定渲染器使用<MTLDevice>
SCN_EXTERN NSString * const SCNPreferredDeviceKey NS_AVAILABLE(10_11, 9_0);
// 指定如果是渲染则使用Metal
SCN_EXTERN NSString * const SCNPreferLowPowerDeviceKey NS_AVAILABLE(10_11, 9_0);
代码库,听说经常给人点赞都当老板了!