###前提・実現したいこと
Unity + RealSense(SR300)を使用して、FaceTrackingを行っています。
FaceTrackingにはColor Cameraを使用しており、60FPSで動作させたいです。
###発生している問題・エラーメッセージ
Unityが30FPSで動作してしまいます。
###該当のソースコード
//不要と思われる箇所は省略しております。 private PXCMSenseManager psm; //SenseManager Instance void Start () { faceRenderer = gameObject.GetComponent<FaceRenderer>(); /* Initialize a PXCMSenseManager instance */ psm = PXCMSenseManager.CreateInstance(); if (psm == null) { Debug.LogError("SenseManager Initialization Failed"); return; } /* Enable the color stream of size 640x480 */ psm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 640, 480, 60); ★ここで60FPSに設定しているつもりですが・・・。 /* Enable the face tracking module*/ sts = psm.EnableFace(); if (sts != pxcmStatus.PXCM_STATUS_NO_ERROR) Debug.LogError("PXCSenseManager.EnableFace: " + sts); /* Retrieve an instance of face to configure */ faceAnalyzer = psm.QueryFace(); if (faceAnalyzer == null) Debug.LogError("PXCSenseManager.QueryFace"); /* Initialize the execution pipeline */ sts = psm.Init(); if (sts != pxcmStatus.PXCM_STATUS_NO_ERROR) { Debug.LogError("PXCMSenseManager.Init Failed"); OnDisable(); return; } /* Retrieve a PXCMFaceConfiguration instance from a face to enable Gestures and Alerts */ PXCMFaceConfiguration config = faceAnalyzer.CreateActiveConfiguration(); config.detection.isEnabled = true; // 3D detection is the default tracking mode. config.landmarks.isEnabled = true; config.pose.isEnabled = true; config.QueryExpressions().Enable(); config.QueryExpressions().EnableExpression(PXCMFaceData.ExpressionsData.FaceExpression.EXPRESSION_MOUTH_OPEN); config.EnableAllAlerts(); config.ApplyChanges(); config.Dispose(); }
###試したこと
以下のことを試してみました。
1:UnityのQualitySettingにてV Sync Count = Don't Sync設定
2:空のゲームオブジェクトにApplication.targetFrameRate = 60;を記載したScriptを適用
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
質問1:どのような方法で30fpsだと計測しましたか? 質問2:「Application.targetFrameRate = 60;」は確実に適用されていますか?(その前後で「Debug.Log(QualitySettings.vSyncCount);」を行うとどんな値が表示されますか?)
ご返信ありがとうございます。 質問1への回答:FrameRate計測用Scriptを作成して、Update関数にて1 / Time.deltaTimeで計算しました。 質問2への回答:Debug.Logで確認したところ、Application.targetFrameRateは60で、QualitySettings.vSyncCountは0になっております。
RealSenseを使用していないシーンでは60fpsになるのでしょうか?
そうですね。RealSenseのFaceTracking用Scriptを外すと60FPSで動作しています。
すみません、これ以上はちょっとわかりませんでした……このサイト(http://tips.hecomi.com/entry/2015/02/25/030422)を見るにSDK側で制御している?ような気もするのですが……公式フォーラム等あるならそちらで質問した方がよいかもしれないです。
貴重なお時間を割いていただいて、ありがとうございました。公式フォーラム等でも質問してみます。ありがとうございました。
回答1件
あなたの回答
tips
プレビュー