Add Chromium-only Blender WebEngine parity work
This commit is contained in:
16
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/AppDelegate.h
vendored
Normal file
16
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/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/mtlViewer/iOS/AppDelegate.m
vendored
Normal file
44
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/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"
|
||||
}
|
||||
}
|
||||
27
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/Base.lproj/LaunchScreen.storyboard
vendored
Normal file
27
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/Base.lproj/LaunchScreen.storyboard
vendored
Normal file
@@ -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>
|
||||
279
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/Base.lproj/Main.storyboard
vendored
Normal file
279
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/Base.lproj/Main.storyboard
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<device id="ipad9_7" orientation="landscape">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<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="1024" height="768"/>
|
||||
<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">
|
||||
<rect key="frame" x="20" y="40" width="133.5" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oQb-3T-gg6" userLabel="modelPickerView">
|
||||
<rect key="frame" x="809" y="646" width="195" height="102"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="195" id="Qn1-yQ-7c6"/>
|
||||
<constraint firstAttribute="height" constant="102" id="xJP-UH-SIl"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="BYZ-38-t0r" id="jd1-qJ-49i"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="OdV-ot-p6a"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<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">
|
||||
<rect key="frame" x="910" y="511" width="94" height="29"/>
|
||||
<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">
|
||||
<rect key="frame" x="846.5" y="515.5" width="55.5" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="910" y="544" width="94" height="29"/>
|
||||
<connections>
|
||||
<action selector="stepperChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="mBg-38-OPM"/>
|
||||
</connections>
|
||||
</stepper>
|
||||
<segmentedControl opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="1" translatesAutoresizingMaskIntoConstraints="NO" id="jQK-WK-vfP">
|
||||
<rect key="frame" x="229.5" y="720" width="191" height="29"/>
|
||||
<segments>
|
||||
<segment title="Linear"/>
|
||||
<segment title="Regular"/>
|
||||
<segment title="Gregory"/>
|
||||
</segments>
|
||||
<connections>
|
||||
<action selector="endcapChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="vBH-MZ-zYA"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="8kP-4Y-wzA">
|
||||
<rect key="frame" x="736" y="600" width="51" height="31"/>
|
||||
<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">
|
||||
<rect key="frame" x="648" y="605.5" width="80" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="590" y="644.5" width="138" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="736" y="639" width="51" height="31"/>
|
||||
<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">
|
||||
<rect key="frame" x="736" y="678" width="51" height="31"/>
|
||||
<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">
|
||||
<rect key="frame" x="736" y="717" width="51" height="31"/>
|
||||
<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">
|
||||
<rect key="frame" x="600.5" y="683.5" width="127.5" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="593.5" y="722.5" width="134.5" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="524.5" y="681" width="51" height="31"/>
|
||||
<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="Control Mesh" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cRi-2K-jkK">
|
||||
<rect key="frame" x="413.5" y="647.5" width="103" height="20.5"/>
|
||||
<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="Screenspace Tessellation" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ioY-T2-PEM">
|
||||
<rect key="frame" x="322.5" y="686.5" width="194" height="20.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="845.5" y="548.5" width="56.5" height="20.5"/>
|
||||
<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="Ta2-7B-7Ck">
|
||||
<rect key="frame" x="524.5" y="642" width="51" height="31"/>
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="PcJ-3J-UKL"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8Ky-iT-gpT">
|
||||
<rect key="frame" x="810" y="581" width="194" height="57"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="57" id="8qk-aN-q1z"/>
|
||||
<constraint firstAttribute="width" constant="194" id="aSF-hS-BWT"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="BYZ-38-t0r" id="4w5-fv-wIj"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="73C-8g-Biy"/>
|
||||
</connections>
|
||||
</pickerView>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xBi-mu-U3U">
|
||||
<rect key="frame" x="265" y="682" width="49" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="Ksb-v0-3jz"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Inf Sharp Patch" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vaI-nm-Fqf">
|
||||
<rect key="frame" x="137" y="686" width="118" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OEV-Vc-RmB">
|
||||
<rect key="frame" x="265" y="646" width="49" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="Bcz-Ql-hk2"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Single Crease Patch" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Emp-qG-6H3">
|
||||
<rect key="frame" x="101" y="650" width="154" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FZx-Rb-43j">
|
||||
<rect key="frame" x="265" y="609" width="49" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<connections>
|
||||
<action selector="switchChanged:" destination="BYZ-38-t0r" eventType="valueChanged" id="3Rf-TS-afQ"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Smooth Corner Patch" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vyo-Y5-Nlh">
|
||||
<rect key="frame" x="90" y="613" width="165" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</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="eYp-5M-Rgk" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="2nS-t9-ncz"/>
|
||||
<constraint firstItem="fw1-9C-P6U" firstAttribute="top" secondItem="5Ns-3P-r13" secondAttribute="bottom" constant="8" id="404-z0-Fv7"/>
|
||||
<constraint firstItem="8kP-4Y-wzA" firstAttribute="leading" secondItem="FvR-NK-6s0" secondAttribute="trailing" constant="8" id="5rd-n5-Uxl"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="oQb-3T-gg6" secondAttribute="bottom" constant="20" id="6dr-og-11f"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="trailing" secondItem="jQK-WK-vfP" secondAttribute="trailing" id="AnK-qT-Bca"/>
|
||||
<constraint firstItem="eYp-5M-Rgk" firstAttribute="leading" secondItem="dlx-hC-oDg" secondAttribute="trailing" constant="8" id="B0o-kO-368"/>
|
||||
<constraint firstItem="QQ6-5o-gla" firstAttribute="leading" secondItem="N12-GK-yLY" secondAttribute="trailing" constant="8" id="DrB-sY-inQ"/>
|
||||
<constraint firstItem="Ta2-7B-7Ck" firstAttribute="leading" secondItem="cRi-2K-jkK" secondAttribute="trailing" constant="8" id="En4-Ve-B3K"/>
|
||||
<constraint firstItem="8Ky-iT-gpT" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="HnT-dY-hLh"/>
|
||||
<constraint firstItem="oQb-3T-gg6" firstAttribute="leading" secondItem="fw1-9C-P6U" secondAttribute="trailing" constant="24" id="JmG-em-jfy"/>
|
||||
<constraint firstItem="7yA-a6-Sq7" firstAttribute="top" secondItem="Ta2-7B-7Ck" secondAttribute="bottom" constant="8" id="O1O-AY-rOc"/>
|
||||
<constraint firstItem="Ta2-7B-7Ck" firstAttribute="centerY" secondItem="cRi-2K-jkK" secondAttribute="centerY" id="OGy-au-4ty"/>
|
||||
<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="4" id="PJS-Lq-bIL"/>
|
||||
<constraint firstItem="Ta2-7B-7Ck" firstAttribute="trailing" secondItem="jQK-WK-vfP" secondAttribute="trailing" id="PVt-1f-oef"/>
|
||||
<constraint firstItem="Ze8-2s-lED" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="20" id="SZK-UA-BiA"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="fw1-9C-P6U" secondAttribute="bottom" constant="20" id="Uw7-fz-We7"/>
|
||||
<constraint firstItem="oQb-3T-gg6" firstAttribute="top" secondItem="8Ky-iT-gpT" secondAttribute="bottom" constant="8" id="b0I-kW-GRc"/>
|
||||
<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="fw1-9C-P6U" firstAttribute="leading" secondItem="5xP-bY-PgM" secondAttribute="trailing" constant="8" id="dhX-z5-kgA"/>
|
||||
<constraint firstItem="jQK-WK-vfP" firstAttribute="top" secondItem="7yA-a6-Sq7" secondAttribute="bottom" constant="8" id="egb-qP-Lva"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="centerY" secondItem="Iw4-VH-Zwm" secondAttribute="centerY" id="fEO-gM-cmZ"/>
|
||||
<constraint firstItem="QQ6-5o-gla" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="ggj-9I-tbQ"/>
|
||||
<constraint firstItem="5Ns-3P-r13" firstAttribute="trailing" secondItem="8kP-4Y-wzA" secondAttribute="trailing" id="gqA-q9-SK3"/>
|
||||
<constraint firstItem="Ze8-2s-lED" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="20" id="kTX-YC-JKR"/>
|
||||
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="jQK-WK-vfP" secondAttribute="bottom" constant="20" id="kuT-qk-ibg"/>
|
||||
<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="oQb-3T-gg6" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="pIi-zk-crx"/>
|
||||
<constraint firstItem="5xP-bY-PgM" firstAttribute="leading" secondItem="jQK-WK-vfP" secondAttribute="trailing" constant="20" id="pvx-Go-b8B"/>
|
||||
<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="oQb-3T-gg6" firstAttribute="top" secondItem="eYp-5M-Rgk" secondAttribute="bottom" constant="8" id="qfG-FK-QD4"/>
|
||||
<constraint firstItem="P8z-O2-OLV" firstAttribute="trailing" secondItem="8kP-4Y-wzA" secondAttribute="trailing" id="rha-qA-vsj"/>
|
||||
<constraint firstItem="8Ky-iT-gpT" firstAttribute="top" secondItem="eYp-5M-Rgk" secondAttribute="bottom" constant="8" id="rjU-ER-xAm"/>
|
||||
<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="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"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="qfG-FK-QD4"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</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="controlMeshSwitch" destination="Ta2-7B-7Ck" id="hVP-58-sGA"/>
|
||||
<outlet property="endcapSegmentedControl" destination="jQK-WK-vfP" id="MIt-kE-Kwg"/>
|
||||
<outlet property="frameTimeLabel" destination="Ze8-2s-lED" id="vLj-Id-oiv"/>
|
||||
<outlet property="infinitelySharpSwitch" destination="xBi-mu-U3U" id="p7I-aQ-tkO"/>
|
||||
<outlet property="modelPickerView" destination="oQb-3T-gg6" id="YLl-SI-Azc"/>
|
||||
<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="shadingModePickerView" destination="8Ky-iT-gpT" id="PAS-0I-Vju"/>
|
||||
<outlet property="singleCreaseSwitch" destination="OEV-Vc-RmB" id="gAl-01-Jrw"/>
|
||||
<outlet property="smoothCornerSwitch" destination="FZx-Rb-43j" id="Ayt-Td-s6s"/>
|
||||
<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="476.57393850658855" y="533.7890625"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<color key="tintColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
</document>
|
||||
50
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/Info.plist
vendored
Normal file
50
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/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>mtlViewer</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.osd.mtlViewer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>mtlViewer</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>
|
||||
42
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/ViewController.h
vendored
Normal file
42
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/ViewController.h
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// 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 "../mtlViewer.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 *modelPickerView;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *shadingModePickerView;
|
||||
@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 *smoothCornerSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *singleCreaseSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *infinitelySharpSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *controlMeshSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *screenspaceTessellationSwitch;
|
||||
@property (weak, nonatomic) IBOutlet UISegmentedControl *endcapSegmentedControl;
|
||||
- (IBAction)stepperChanged:(UIStepper *)sender;
|
||||
- (IBAction)switchChanged:(UISwitch *)sender;
|
||||
- (IBAction)endcapChanged:(UISegmentedControl *)sender;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
264
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/ViewController.mm
vendored
Normal file
264
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/ViewController.mm
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
//
|
||||
// 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] endEncoding];
|
||||
|
||||
__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.useSmoothCornerPatch = _smoothCornerSwitch.isOn;
|
||||
_osdRenderer.useSingleCreasePatch = _singleCreaseSwitch.isOn;
|
||||
_osdRenderer.useInfinitelySharpPatch = _infinitelySharpSwitch.isOn;
|
||||
_osdRenderer.usePatchBackfaceCulling = _backpatchCullingSwitch.isOn;
|
||||
_osdRenderer.usePrimitiveBackfaceCulling = _backfaceCullingSwitch.isOn;
|
||||
_osdRenderer.useScreenspaceTessellation = _screenspaceTessellationSwitch.isOn;
|
||||
_osdRenderer.displayStyle = _wireframeSwitch.isOn ? kDisplayStyleWireOnShaded : kDisplayStyleShaded;
|
||||
_osdRenderer.displayControlMeshVertices = _controlMeshSwitch.isOn;
|
||||
_osdRenderer.displayControlMeshEdges = _controlMeshSwitch.isOn;
|
||||
_osdRenderer.usePatchClipCulling = _patchClipCullingSwitch.isOn;
|
||||
_osdRenderer.useFractionalTessellation = _osdRenderer.useFractionalTessellation;
|
||||
_osdRenderer.useAdaptive = true;
|
||||
_osdRenderer.freeze = true;
|
||||
_osdRenderer.animateVertices = false;
|
||||
_osdRenderer.kernelType = kMetal;
|
||||
_osdRenderer.refinementLevel = _refinementStepper.value;
|
||||
_osdRenderer.tessellationLevel = _tessellationStepper.value;
|
||||
_osdRenderer.endCapMode = (EndCap)(_endcapSegmentedControl.selectedSegmentIndex);
|
||||
|
||||
_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 == _smoothCornerSwitch) {
|
||||
_osdRenderer.useSmoothCornerPatch = sender.isOn;
|
||||
} else if(sender == _singleCreaseSwitch) {
|
||||
_osdRenderer.useSingleCreasePatch = sender.isOn;
|
||||
} else if(sender == _infinitelySharpSwitch) {
|
||||
_osdRenderer.useInfinitelySharpPatch = sender.isOn;
|
||||
} else if(sender == _controlMeshSwitch) {
|
||||
_osdRenderer.displayControlMeshEdges = sender.isOn;
|
||||
_osdRenderer.displayControlMeshVertices = sender.isOn;
|
||||
} else if(sender == _screenspaceTessellationSwitch) {
|
||||
_osdRenderer.useScreenspaceTessellation = sender.isOn;
|
||||
_osdRenderer.useFractionalTessellation = _osdRenderer.useFractionalTessellation;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)endcapChanged:(UISegmentedControl *)sender {
|
||||
_osdRenderer.endCapMode = (EndCap)(sender.selectedSegmentIndex);
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
|
||||
if(pickerView == _modelPickerView) {
|
||||
return _osdRenderer.loadedModels.count;
|
||||
} else if(pickerView == _shadingModePickerView) {
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
|
||||
if(pickerView == _modelPickerView) {
|
||||
return _osdRenderer.loadedModels[row];
|
||||
} else if(pickerView == _shadingModePickerView) {
|
||||
switch((ShadingMode)row) {
|
||||
case kShadingMaterial: return @"Material";
|
||||
case kShadingFaceVaryingColor: return @"FaceVarying Color";
|
||||
case kShadingPatchType: return @"Patch Type";
|
||||
case kShadingPatchDepth: return @"Patch Depth";
|
||||
case kShadingPatchCoord: return @"Patch Coord";
|
||||
case kShadingNormal: return @"Normal";
|
||||
}
|
||||
}
|
||||
return @"";
|
||||
}
|
||||
|
||||
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
|
||||
if(pickerView == _modelPickerView) {
|
||||
_osdRenderer.currentModel = _osdRenderer.loadedModels[row];
|
||||
} else if(pickerView == _shadingModePickerView) {
|
||||
_osdRenderer.shadingMode = (ShadingMode)row;
|
||||
}
|
||||
}
|
||||
@end
|
||||
8
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/iOS/main.m
vendored
Normal file
8
blender-5.2.0/extern/opensubdiv-source/examples/mtlViewer/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