Expose more ar config options
This commit is contained in:
@@ -55,6 +55,11 @@ namespace OpenVulkano::AR
|
||||
struct ArSessionConfig
|
||||
{
|
||||
bool enableDepth = true;
|
||||
bool autoFocus = true;
|
||||
bool preferHDR = true;
|
||||
bool sceneReconstruction = false;
|
||||
bool planeDetection = false;
|
||||
int preferredResolution = 0;
|
||||
};
|
||||
|
||||
struct ArCreateResult
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenVulkano::AR::ArKit
|
||||
auto vidFormats = [ARWorldTrackingConfiguration supportedVideoFormats];
|
||||
for (ARVideoFormat* format: vidFormats)
|
||||
{
|
||||
if (ss.gcount() > 1) ss << ", ";
|
||||
if (ss.tellp() > std::streampos(5)) ss << ", ";
|
||||
ss << format.imageResolution.width << 'x' << format.imageResolution.height;
|
||||
ss << '@' << format.framesPerSecond;
|
||||
if (@available(iOS 16.0, *))
|
||||
@@ -67,6 +67,12 @@ namespace OpenVulkano::AR::ArKit
|
||||
{
|
||||
m_arConfig.frameSemantics = ARFrameSemanticSceneDepth;
|
||||
}
|
||||
if (config.sceneReconstruction)
|
||||
{
|
||||
m_arConfig.sceneReconstruction = ARSceneReconstructionMesh;
|
||||
}
|
||||
m_arConfig.planeDetection = config.planeDetection ? (ARPlaneDetectionVertical | ARPlaneDetectionHorizontal) : ARPlaneDetectionNone;
|
||||
m_arConfig.autoFocusEnabled = config.autoFocus;
|
||||
|
||||
// Set video format
|
||||
{
|
||||
@@ -74,8 +80,8 @@ namespace OpenVulkano::AR::ArKit
|
||||
//TODO handle ar video format in settings
|
||||
if (@available(iOS 16.0, *))
|
||||
{
|
||||
//m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatFor4KResolution];
|
||||
//m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatForHighResolutionFrameCapturing];
|
||||
if (config.preferHDR) m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatForHighResolutionFrameCapturing];
|
||||
//TODO resolution handling
|
||||
}
|
||||
LogFormat("Using video format", m_arConfig.videoFormat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user