Add Chromium-only Blender WebEngine parity work
This commit is contained in:
16
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/AppDelegate.h
vendored
Normal file
16
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/AppDelegate.h
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Copyright 2013 Pixar
|
||||
//
|
||||
// Licensed under the terms set forth in the LICENSE.txt file available at
|
||||
// https://opensubdiv.org/license.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
44
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/AppDelegate.m
vendored
Normal file
44
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/AppDelegate.m
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright 2013 Pixar
|
||||
//
|
||||
// Licensed under the terms set forth in the LICENSE.txt file available at
|
||||
// https://opensubdiv.org/license.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// Override point for customization after application launch.
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11147" systemVersion="16A201u" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11119"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
265
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/Base.lproj/Main.storyboard
vendored
Normal file
265
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/Base.lproj/Main.storyboard
vendored
Normal file
@@ -0,0 +1,265 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11173.2" systemVersion="16A264" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11143.2"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="MTKView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1366" height="1024"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Information Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ze8-2s-lED">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minimumValue="1" maximumValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="QQ6-5o-gla">
|
||||
<connections>
|
||||
<action selector="stepperChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="uHZ-dB-XZV"/>
|
||||
</connections>
|
||||
</stepper>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ref Lvl." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N12-GK-yLY">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="16" translatesAutoresizingMaskIntoConstraints="NO" id="eYp-5M-Rgk">
|
||||
<connections>
|
||||
<action selector="stepperChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="mBg-38-OPM"/>
|
||||
</connections>
|
||||
</stepper>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="8kP-4Y-wzA">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="UsH-Nw-M31"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Wireframe" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FvR-NK-6s0" userLabel="Wireframe">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Backpatch Culling" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="esT-7h-XLG">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="P8z-O2-OLV">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="w7T-KH-L3E"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="5Ns-3P-r13">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="ym1-Xw-wU6"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="fw1-9C-P6U">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="8kp-Rh-Yua"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Backface Culling" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Iw4-VH-Zwm">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Patch Clip Culling" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5xP-bY-PgM">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Crease" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kuw-3r-nzl">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7yA-a6-Sq7">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="Yg5-z5-avS"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Screenspace Tessellation" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ioY-T2-PEM">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tes Lvl." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dlx-hC-oDg">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sDC-ZC-b6I">
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="ebT-0s-gYR"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lKi-xk-48C">
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="229" id="Wpt-NP-71K"/>
|
||||
<constraint firstAttribute="height" constant="100" id="zRD-L8-taf"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="BYZ-38-t0r" id="9Fy-8F-lh4"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="AGI-ts-ucC"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MhN-MJ-gcY">
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="229" id="2un-1F-Mel"/>
|
||||
<constraint firstAttribute="height" constant="100" id="e85-YP-l4W"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="BYZ-38-t0r" id="fva-Gz-Lm9"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="vnc-OK-4c7"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pci-qy-cH2">
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="229" id="ZYQ-3j-No7"/>
|
||||
<constraint firstAttribute="height" constant="100" id="iBl-mj-oGZ"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="BYZ-38-t0r" id="e4g-y8-rgS"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="txx-qB-tmn"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Color Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q2s-bO-zy8">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Normal Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I4F-1D-Czt">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Displacement Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uci-PY-aOB">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="5Ee-cu-NZx">
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="300" id="zHK-PA-cxQ"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<action selector="sliderChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="x6e-A1-PtP"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mipmap Bias" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ep7-AF-66o">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Displacement" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2eJ-wE-QUZ">
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="lg4-UF-DUA">
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="300" id="SAY-uf-0VR"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<action selector="sliderChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="T6h-NW-Qz3"/>
|
||||
</connections>
|
||||
</slider>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="P8z-O2-OLV" firstAttribute="leading" secondItem="esT-7h-XLG" secondAttribute="trailing" constant="8" id="0zt-WU-LC3"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="top" secondItem="5Ns-3P-r13" secondAttribute="bottom" constant="8" id="404-z0-Fv7"/>
|
||||
<constraint firstItem="pci-qy-cH2" firstAttribute="centerY" secondItem="uci-PY-aOB" secondAttribute="centerY" id="51c-EC-nM4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="pci-qy-cH2" secondAttribute="trailing" constant="8" id="5JD-9Q-LoS"/>
|
||||
<constraint firstItem="MhN-MJ-gcY" firstAttribute="top" secondItem="pci-qy-cH2" secondAttribute="bottom" constant="8" id="5We-Fg-mqK"/>
|
||||
<constraint firstItem="8kP-4Y-wzA" firstAttribute="leading" secondItem="FvR-NK-6s0" secondAttribute="trailing" constant="8" id="5rd-n5-Uxl"/>
|
||||
<constraint firstItem="5Ee-cu-NZx" firstAttribute="trailing" secondItem="lg4-UF-DUA" secondAttribute="trailing" id="7wp-4z-St6"/>
|
||||
<constraint firstItem="8kP-4Y-wzA" firstAttribute="top" secondItem="7yA-a6-Sq7" secondAttribute="bottom" constant="8" id="81h-8V-det"/>
|
||||
<constraint firstItem="lKi-xk-48C" firstAttribute="leading" secondItem="Q2s-bO-zy8" secondAttribute="trailing" constant="8" id="9Hf-nv-kO7"/>
|
||||
<constraint firstItem="eYp-5M-Rgk" firstAttribute="leading" secondItem="dlx-hC-oDg" secondAttribute="trailing" constant="8" id="B0o-kO-368"/>
|
||||
<constraint firstAttribute="trailing" secondItem="MhN-MJ-gcY" secondAttribute="trailing" constant="8" id="B5N-TG-DvY"/>
|
||||
<constraint firstAttribute="trailing" secondItem="lKi-xk-48C" secondAttribute="trailing" constant="8" id="Dsf-kk-VQH"/>
|
||||
<constraint firstItem="8kP-4Y-wzA" firstAttribute="trailing" secondItem="7yA-a6-Sq7" secondAttribute="trailing" id="HIl-Xg-PwW"/>
|
||||
<constraint firstItem="ioY-T2-PEM" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="25" id="Kg5-1N-BpG"/>
|
||||
<constraint firstItem="P8z-O2-OLV" firstAttribute="centerY" secondItem="esT-7h-XLG" secondAttribute="centerY" id="Oxf-2f-wTD"/>
|
||||
<constraint firstItem="eYp-5M-Rgk" firstAttribute="top" secondItem="QQ6-5o-gla" secondAttribute="bottom" constant="8" id="PJS-Lq-bIL"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="lKi-xk-48C" secondAttribute="bottom" constant="25" id="PnT-0o-uNH"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="top" secondItem="sDC-ZC-b6I" secondAttribute="bottom" constant="8" id="QC2-TN-FjW"/>
|
||||
<constraint firstItem="Ze8-2s-lED" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="20" id="SZK-UA-BiA"/>
|
||||
<constraint firstItem="MhN-MJ-gcY" firstAttribute="leading" secondItem="I4F-1D-Czt" secondAttribute="trailing" constant="8" id="T1r-ZQ-Jxi"/>
|
||||
<constraint firstItem="MhN-MJ-gcY" firstAttribute="centerY" secondItem="I4F-1D-Czt" secondAttribute="centerY" id="Tdj-kw-7IN"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="dlx-hC-oDg" secondAttribute="bottom" constant="25" id="U0T-iQ-NLt"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="fw1-9C-P6U" secondAttribute="bottom" constant="20" id="Uw7-fz-We7"/>
|
||||
<constraint firstItem="sDC-ZC-b6I" firstAttribute="leading" secondItem="kuw-3r-nzl" secondAttribute="trailing" constant="8" id="W06-wv-gqs"/>
|
||||
<constraint firstItem="QQ6-5o-gla" firstAttribute="centerY" secondItem="N12-GK-yLY" secondAttribute="centerY" id="bqu-uw-PqG"/>
|
||||
<constraint firstItem="eYp-5M-Rgk" firstAttribute="centerY" secondItem="dlx-hC-oDg" secondAttribute="centerY" id="cV6-GZ-8IP"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="leading" secondItem="ioY-T2-PEM" secondAttribute="trailing" constant="8" id="cqL-gl-vn2"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="5xP-bY-PgM" secondAttribute="bottom" constant="25" id="cqZ-ZJ-qwf"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="leading" secondItem="5xP-bY-PgM" secondAttribute="trailing" constant="8" id="dhX-z5-kgA"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="5Ee-cu-NZx" secondAttribute="bottom" constant="25" id="erc-MZ-6N2"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="centerY" secondItem="Iw4-VH-Zwm" secondAttribute="centerY" id="fEO-gM-cmZ"/>
|
||||
<constraint firstItem="lg4-UF-DUA" firstAttribute="leading" secondItem="2eJ-wE-QUZ" secondAttribute="trailing" constant="8" id="gne-Dp-lLU"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="trailing" secondItem="8kP-4Y-wzA" secondAttribute="trailing" id="gqA-q9-SK3"/>
|
||||
<constraint firstItem="lKi-xk-48C" firstAttribute="centerY" secondItem="Q2s-bO-zy8" secondAttribute="centerY" id="hdJ-mn-wba"/>
|
||||
<constraint firstItem="pci-qy-cH2" firstAttribute="leading" secondItem="uci-PY-aOB" secondAttribute="trailing" constant="8" id="huu-H0-Tby"/>
|
||||
<constraint firstItem="5Ee-cu-NZx" firstAttribute="centerY" secondItem="ep7-AF-66o" secondAttribute="centerY" id="iXa-Hm-SyL"/>
|
||||
<constraint firstItem="Ze8-2s-lED" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="20" id="kTX-YC-JKR"/>
|
||||
<constraint firstItem="dlx-hC-oDg" firstAttribute="leading" secondItem="fw1-9C-P6U" secondAttribute="trailing" constant="57" id="kk2-dV-2jk"/>
|
||||
<constraint firstItem="lKi-xk-48C" firstAttribute="top" secondItem="MhN-MJ-gcY" secondAttribute="bottom" constant="8" id="m49-1U-Jcw"/>
|
||||
<constraint firstItem="8kP-4Y-wzA" firstAttribute="centerY" secondItem="FvR-NK-6s0" secondAttribute="centerY" id="n3L-qM-7Pr"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="centerY" secondItem="5xP-bY-PgM" secondAttribute="centerY" id="nP1-Bt-GuV"/>
|
||||
<constraint firstItem="lKi-xk-48C" firstAttribute="top" secondItem="MhN-MJ-gcY" secondAttribute="bottom" constant="8" id="nrc-E0-3gd"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="trailing" secondItem="sDC-ZC-b6I" secondAttribute="trailing" id="pkW-Gf-A1P"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="top" secondItem="P8z-O2-OLV" secondAttribute="bottom" constant="8" id="pwK-2F-IIf"/>
|
||||
<constraint firstItem="P8z-O2-OLV" firstAttribute="top" secondItem="8kP-4Y-wzA" secondAttribute="bottom" constant="8" id="q11-mD-QDz"/>
|
||||
<constraint firstItem="QQ6-5o-gla" firstAttribute="leading" secondItem="N12-GK-yLY" secondAttribute="trailing" constant="8" id="qBz-A8-IZc"/>
|
||||
<constraint firstItem="P8z-O2-OLV" firstAttribute="trailing" secondItem="8kP-4Y-wzA" secondAttribute="trailing" id="rha-qA-vsj"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="trailing" secondItem="8kP-4Y-wzA" secondAttribute="trailing" id="ro3-hx-iLk"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="leading" secondItem="Iw4-VH-Zwm" secondAttribute="trailing" constant="8" id="ry7-bQ-bRa"/>
|
||||
<constraint firstItem="MhN-MJ-gcY" firstAttribute="top" secondItem="pci-qy-cH2" secondAttribute="bottom" constant="8" id="sR8-Lw-q9X"/>
|
||||
<constraint firstItem="eYp-5M-Rgk" firstAttribute="trailing" secondItem="QQ6-5o-gla" secondAttribute="trailing" id="syp-eW-H7w"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="top" secondItem="5Ns-3P-r13" secondAttribute="bottom" constant="8" id="tsW-3r-293"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="centerY" secondItem="ioY-T2-PEM" secondAttribute="centerY" id="wE0-Cg-4Qf"/>
|
||||
<constraint firstItem="sDC-ZC-b6I" firstAttribute="centerY" secondItem="kuw-3r-nzl" secondAttribute="centerY" id="wTg-7H-KXF"/>
|
||||
<constraint firstItem="lg4-UF-DUA" firstAttribute="centerY" secondItem="2eJ-wE-QUZ" secondAttribute="centerY" id="x0b-B2-XkG"/>
|
||||
<constraint firstItem="ep7-AF-66o" firstAttribute="leading" secondItem="eYp-5M-Rgk" secondAttribute="trailing" constant="52" id="xFx-Kb-IBp"/>
|
||||
<constraint firstItem="5Ee-cu-NZx" firstAttribute="leading" secondItem="ep7-AF-66o" secondAttribute="trailing" constant="8" id="xye-mn-VX2"/>
|
||||
<constraint firstItem="5Ee-cu-NZx" firstAttribute="top" secondItem="lg4-UF-DUA" secondAttribute="bottom" constant="8" id="zVK-yu-Uuz"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="backfaceCullingSwitch" destination="5Ns-3P-r13" id="n8X-2V-BRl"/>
|
||||
<outlet property="backpatchCullingSwitch" destination="P8z-O2-OLV" id="VIe-Lv-hsC"/>
|
||||
<outlet property="colorModePickerView" destination="lKi-xk-48C" id="u5F-aY-10I"/>
|
||||
<outlet property="displacementModePickerView" destination="pci-qy-cH2" id="jaV-1A-n0X"/>
|
||||
<outlet property="displacementSlider" destination="lg4-UF-DUA" id="BWG-lH-Qfm"/>
|
||||
<outlet property="frameTimeLabel" destination="Ze8-2s-lED" id="vLj-Id-oiv"/>
|
||||
<outlet property="mipmapBiasSlider" destination="5Ee-cu-NZx" id="WGF-bb-PaA"/>
|
||||
<outlet property="normalModePickerView" destination="MhN-MJ-gcY" id="LJw-CH-3Im"/>
|
||||
<outlet property="patchClipCullingSwitch" destination="fw1-9C-P6U" id="P2G-3F-eJh"/>
|
||||
<outlet property="refLvlLabel" destination="N12-GK-yLY" id="lXc-6r-pZY"/>
|
||||
<outlet property="refinementStepper" destination="QQ6-5o-gla" id="URK-fS-krY"/>
|
||||
<outlet property="screenspaceTessellationSwitch" destination="7yA-a6-Sq7" id="RpM-ER-4Oy"/>
|
||||
<outlet property="singleCreaseSwitch" destination="sDC-ZC-b6I" id="Arw-OY-Z4A"/>
|
||||
<outlet property="tesLvLlabel" destination="dlx-hC-oDg" id="haB-Hi-A9B"/>
|
||||
<outlet property="tessellationStepper" destination="eYp-5M-Rgk" id="IFG-H5-rJS"/>
|
||||
<outlet property="wireframeSwitch" destination="8kP-4Y-wzA" id="y3a-yu-4cs"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="463.83601756954607" y="406.640625"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
</document>
|
||||
50
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/Info.plist
vendored
Normal file
50
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/Info.plist
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>mtlPtexViewer</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.osd.mtlPtexViewer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>mtlPtexViewer</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>metal</string>
|
||||
</array>
|
||||
<key>UIRequiresFullScreen</key>
|
||||
<true/>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
40
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/ViewController.h
vendored
Normal file
40
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/ViewController.h
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright 2013 Pixar
|
||||
//
|
||||
// Licensed under the terms set forth in the LICENSE.txt file available at
|
||||
// https://opensubdiv.org/license.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <MetalKit/MetalKit.h>
|
||||
#import "../mtlPtexViewer.h"
|
||||
|
||||
@interface ViewController : UIViewController<
|
||||
MTKViewDelegate,
|
||||
UIPickerViewDelegate,
|
||||
UIPickerViewDataSource,
|
||||
OSDRendererDelegate
|
||||
>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *refLvlLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *tesLvLlabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *frameTimeLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *colorModePickerView;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *normalModePickerView;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *displacementModePickerView;
|
||||
@property (weak, nonatomic) IBOutlet UIStepper *tessellationStepper;
|
||||
@property (weak, nonatomic) IBOutlet UIStepper *refinementStepper;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *wireframeSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *backpatchCullingSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *backfaceCullingSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *patchClipCullingSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *singleCreaseSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *screenspaceTessellationSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISlider *displacementSlider;
|
||||
@property (weak, nonatomic) IBOutlet UISlider *mipmapBiasSlider;
|
||||
- (IBAction)stepperChanged:(UIStepper *)sender;
|
||||
- (IBAction)switchChanged:(UISwitch *)sender;
|
||||
- (IBAction)sliderChanged:(UISlider*)sender;
|
||||
|
||||
@end
|
||||
|
||||
280
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/ViewController.mm
vendored
Normal file
280
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/ViewController.mm
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
//
|
||||
// Copyright 2013 Pixar
|
||||
//
|
||||
// Licensed under the terms set forth in the LICENSE.txt file available at
|
||||
// https://opensubdiv.org/license.
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
|
||||
#define FRAME_HISTORY 30
|
||||
@interface ViewController ()
|
||||
{
|
||||
dispatch_semaphore_t _frameSemaphore;
|
||||
CGPoint _startTouch;
|
||||
bool _isTouching;
|
||||
OSDRenderer* _osdRenderer;
|
||||
MTKView* _view;
|
||||
id<MTLDevice> _device;
|
||||
id<MTLCommandQueue> _commandQueue;
|
||||
|
||||
double _frameTimes[FRAME_HISTORY];
|
||||
uint64_t _currentFrame;
|
||||
|
||||
UIPanGestureRecognizer *_zoomGesture;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
-(void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size {
|
||||
_osdRenderer.camera->aspectRatio = size.width / size.height;
|
||||
}
|
||||
|
||||
-(void)drawInMTKView:(MTKView *)view {
|
||||
dispatch_semaphore_wait(_frameSemaphore, DISPATCH_TIME_FOREVER);
|
||||
auto commandBuffer = [_commandQueue commandBuffer];
|
||||
[_osdRenderer drawFrame:commandBuffer];
|
||||
|
||||
__weak auto blockSemaphore = _frameSemaphore;
|
||||
unsigned frameIndex = _currentFrame % FRAME_HISTORY;
|
||||
const auto beginTime = CACurrentMediaTime();
|
||||
[commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> _Nonnull c) {
|
||||
dispatch_semaphore_signal(blockSemaphore);
|
||||
_frameTimes[frameIndex] = CACurrentMediaTime() - beginTime;
|
||||
}];
|
||||
[commandBuffer presentDrawable:_view.currentDrawable];
|
||||
[commandBuffer commit];
|
||||
_currentFrame++;
|
||||
|
||||
double frameAverage = 0;
|
||||
for(auto& x : _frameTimes)
|
||||
frameAverage += x;
|
||||
|
||||
frameAverage /= 30.0;
|
||||
|
||||
_frameTimeLabel.text = [NSString stringWithFormat:@"%0.2f ms", frameAverage * 1000.0];
|
||||
}
|
||||
|
||||
-(UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
||||
return UIInterfaceOrientationMaskLandscape;
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_view = (MTKView*)self.view;
|
||||
_frameSemaphore = dispatch_semaphore_create(3);
|
||||
|
||||
_device = MTLCreateSystemDefaultDevice();
|
||||
_commandQueue = [_device newCommandQueue];
|
||||
|
||||
_view.device = _device;
|
||||
_view.depthStencilPixelFormat = MTLPixelFormatDepth32Float;
|
||||
_view.sampleCount = 2;
|
||||
_view.frame = CGRectMake(0, 0, 1920, 1080);
|
||||
_view.contentScaleFactor = 1;
|
||||
_view.clearColor = MTLClearColorMake(0.4245, 0.4167, 0.4245, 1);
|
||||
|
||||
_osdRenderer = [[OSDRenderer alloc] initWithDelegate:self];
|
||||
|
||||
_view.delegate = self;
|
||||
|
||||
_zoomGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(_zoomView)];
|
||||
_zoomGesture.minimumNumberOfTouches = 2;
|
||||
_zoomGesture.maximumNumberOfTouches = 2;
|
||||
_zoomGesture.cancelsTouchesInView = true;
|
||||
|
||||
[_view addGestureRecognizer:_zoomGesture];
|
||||
|
||||
[self _applyOptions];
|
||||
}
|
||||
|
||||
-(void)_applyOptions {
|
||||
_osdRenderer.useSingleCrease = _singleCreaseSwitch.isOn;
|
||||
_osdRenderer.usePatchBackfaceCulling = _backpatchCullingSwitch.isOn;
|
||||
_osdRenderer.usePrimitiveBackfaceCulling = _backfaceCullingSwitch.isOn;
|
||||
_osdRenderer.useScreenspaceTessellation = sender.isOn;
|
||||
_osdRenderer.useFractionalTessellation = _osdRenderer.useScreenspaceTessellation;
|
||||
_osdRenderer.displayStyle = _wireframeSwitch.isOn ? kDisplayStyleWireOnShaded : kDisplayStyleShaded;
|
||||
_osdRenderer.usePatchClipCulling = _patchClipCullingSwitch.isOn;
|
||||
_osdRenderer.useAdaptive = true;
|
||||
_osdRenderer.freeze = true;
|
||||
_osdRenderer.animateVertices = false;
|
||||
|
||||
_osdRenderer.kernelType = kMetal;
|
||||
_osdRenderer.refinementLevel = _refinementStepper.value;
|
||||
_osdRenderer.tessellationLevel = _tessellationStepper.value;
|
||||
_osdRenderer.colorMode = (ColorMode)[_colorModePickerView selectedRowInComponent:0];
|
||||
_osdRenderer.normalMode = (NormalMode)[_normalModePickerView selectedRowInComponent:0];
|
||||
_osdRenderer.displacementMode = (DisplacementMode)[_displacementModePickerView selectedRowInComponent:0];
|
||||
_osdRenderer.mipmapBias = _mipmapBiasSlider.value;
|
||||
_osdRenderer.displacementScale = _displacementSlider.value;
|
||||
|
||||
|
||||
|
||||
_tesLvLlabel.text = [NSString stringWithFormat:@"Tes Lvl. %d", (int)_osdRenderer.tessellationLevel];
|
||||
[_tesLvLlabel sizeToFit];
|
||||
|
||||
_refLvlLabel.text = [NSString stringWithFormat:@"Ref Lvl. %d", _osdRenderer.refinementLevel];
|
||||
[_refLvlLabel sizeToFit];
|
||||
}
|
||||
|
||||
-(void)_zoomView {
|
||||
static float lastY = 0;
|
||||
if(_zoomGesture.state == UIGestureRecognizerStateBegan) {
|
||||
lastY = [_zoomGesture translationInView:_view].y;
|
||||
} else if(_zoomGesture.state == UIGestureRecognizerStateChanged) {
|
||||
const auto currentY = [_zoomGesture translationInView:_view].y;
|
||||
const auto deltaY = (currentY - lastY) / 100.0;
|
||||
lastY = currentY;
|
||||
_osdRenderer.camera->dollyDistance += deltaY;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
_isTouching = true;
|
||||
_startTouch = [touches.anyObject locationInView:self.view];
|
||||
[super touchesBegan:touches withEvent:event];
|
||||
}
|
||||
|
||||
-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
_isTouching = false;
|
||||
[super touchesEnded:touches withEvent:event];
|
||||
}
|
||||
|
||||
-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
if(_isTouching)
|
||||
{
|
||||
for(UITouch* touch in touches)
|
||||
{
|
||||
CGPoint location = [touch locationInView:self.view];
|
||||
_startTouch = [touch previousLocationInView:self.view];
|
||||
|
||||
double deltaX = location.x - _startTouch.x;
|
||||
double deltaY = location.y - _startTouch.y;
|
||||
|
||||
_osdRenderer.camera->rotationX += deltaX / 5.0;
|
||||
_osdRenderer.camera->rotationY += deltaY / 5.0;
|
||||
}
|
||||
}
|
||||
[super touchesMoved:touches withEvent:event];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(id<MTLDevice>)deviceFor:(OSDRenderer *)renderer {
|
||||
return _device;
|
||||
}
|
||||
-(id<MTLCommandQueue>)commandQueueFor:(OSDRenderer *)renderer {
|
||||
return _commandQueue;
|
||||
}
|
||||
-(MTLRenderPassDescriptor *)renderPassDescriptorFor:(OSDRenderer *)renderer {
|
||||
return _view.currentRenderPassDescriptor;
|
||||
}
|
||||
-(void)setupDepthStencilState:(MTLDepthStencilDescriptor *)descriptor for:(OSDRenderer *)renderer {
|
||||
|
||||
}
|
||||
-(void)setupRenderPipelineState:(MTLRenderPipelineDescriptor *)descriptor for:(OSDRenderer *)renderer {
|
||||
descriptor.colorAttachments[0].pixelFormat = _view.colorPixelFormat;
|
||||
descriptor.depthAttachmentPixelFormat = _view.depthStencilPixelFormat;
|
||||
descriptor.sampleCount = _view.sampleCount;
|
||||
}
|
||||
- (IBAction)stepperChanged:(UIStepper *)sender {
|
||||
if(sender == _tessellationStepper) {
|
||||
_osdRenderer.tessellationLevel = sender.value;
|
||||
_tesLvLlabel.text = [NSString stringWithFormat:@"Tes Lvl. %d", (int)_osdRenderer.tessellationLevel];
|
||||
[_tesLvLlabel sizeToFit];
|
||||
|
||||
} else if (sender == _refinementStepper) {
|
||||
_osdRenderer.refinementLevel = sender.value;
|
||||
_refLvlLabel.text = [NSString stringWithFormat:@"Ref Lvl. %d", _osdRenderer.refinementLevel];
|
||||
[_refLvlLabel sizeToFit];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)switchChanged:(UISwitch *)sender {
|
||||
if(sender == _wireframeSwitch) {
|
||||
_osdRenderer.displayStyle = _wireframeSwitch.isOn ? kDisplayStyleWireOnShaded : kDisplayStyleShaded;
|
||||
} else if(sender == _backpatchCullingSwitch) {
|
||||
_osdRenderer.usePatchBackfaceCulling = sender.isOn;
|
||||
} else if(sender == _backfaceCullingSwitch) {
|
||||
_osdRenderer.usePrimitiveBackfaceCulling = sender.isOn;
|
||||
} else if(sender == _patchClipCullingSwitch) {
|
||||
_osdRenderer.usePatchClipCulling = sender.isOn;
|
||||
} else if(sender == _singleCreaseSwitch) {
|
||||
_osdRenderer.useSingleCrease = sender.isOn;
|
||||
} else if(sender == _screenspaceTessellationSwitch) {
|
||||
_osdRenderer.useScreenspaceTessellation = sender.isOn;
|
||||
_osdRenderer.useFractionalTessellation = _osdRenderer.useScreenspaceTessellation;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)sliderChanged:(UISlider *)sender {
|
||||
if(sender == _displacementSlider) {
|
||||
_osdRenderer.displacementScale = sender.value;
|
||||
} else if(sender == _mipmapBiasSlider) {
|
||||
_osdRenderer.mipmapBias = sender.value;
|
||||
}
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
|
||||
if(pickerView == _colorModePickerView) {
|
||||
return 8;
|
||||
} else if(pickerView == _normalModePickerView) {
|
||||
return 5;
|
||||
} else if(pickerView == _displacementModePickerView) {
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
|
||||
if(pickerView == _colorModePickerView) {
|
||||
switch(row) {
|
||||
case kColorModePtexNearest: return @"Ptex Nearest";
|
||||
case kColorModeNormal: return @"Normal";
|
||||
case kColorModeNone: return @"None";
|
||||
case kColorModePatchType: return @"Patch Type";
|
||||
case kColorModePatchCoord: return @"Patch Coord";
|
||||
case kColorModePtexBilinear: return @"Ptex Bilinear";
|
||||
case kColorModePtexHWBilinear: return @"Ptex HW Bilinear";
|
||||
case kColorModePtexBiQuadratic: return @"Ptex BiQuadratic";
|
||||
}
|
||||
} else if(pickerView == _normalModePickerView) {
|
||||
switch(row) {
|
||||
case kNormalModeSurface: return @"Surface";
|
||||
case kNormalModeBiQuadratic: return @"BiQuadratic";
|
||||
case kNormalModeScreenspace: return @"Screenspace";
|
||||
case kNormalModeBiQuadraticWG: return @"BiQuadratic WG";
|
||||
case kNormalModeHWScreenspace: return @"HW Screenspace";
|
||||
}
|
||||
} else if(pickerView == _displacementModePickerView) {
|
||||
switch (row) {
|
||||
case kDisplacementModeBilinear: return @"Bilinear";
|
||||
case KDisplacementModeNone: return @"None";
|
||||
case kDisplacementModeHWBilinear: return @"HW Bilinear";
|
||||
case kDisplacementModeBiQuadratic: return @"BiQuadratic";
|
||||
}
|
||||
}
|
||||
return @"";
|
||||
}
|
||||
|
||||
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
|
||||
if(pickerView == _colorModePickerView) {
|
||||
_osdRenderer.colorMode = (ColorMode)row;
|
||||
} else if(pickerView == _normalModePickerView) {
|
||||
_osdRenderer.normalMode = (NormalMode)row;
|
||||
} else if(pickerView == _displacementModePickerView) {
|
||||
_osdRenderer.displacementMode = (DisplacementMode)row;
|
||||
}
|
||||
}
|
||||
@end
|
||||
8
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/main.m
vendored
Normal file
8
blender-5.2.0/extern/opensubdiv-source/examples/mtlPtexViewer/iOS/main.m
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user