add qcom afme
This commit is contained in:
parent
f2942dae83
commit
cabe73b2c6
2
.gitignore
vendored
2
.gitignore
vendored
@ -46,6 +46,8 @@ sysinfo.txt
|
|||||||
|
|
||||||
# Builds
|
# Builds
|
||||||
*.apk
|
*.apk
|
||||||
|
*.hap
|
||||||
|
*.app
|
||||||
*.unitypackage
|
*.unitypackage
|
||||||
.vsconfig
|
.vsconfig
|
||||||
|
|
||||||
|
|||||||
8
Assets/Plugins.meta
Normal file
8
Assets/Plugins.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: W3gf43v7AX7cTPQxR8YjE1dpIPTV5wZRzpHYu5Fn0KISlXqsRzLtc1A=
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Android.meta
Normal file
8
Assets/Plugins/Android.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: WXkcvXv4UX1/JuVoVKRpheP6zqwavizmXJNdeXG0oEB4Ijk2wBHOKM0=
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/Android/libGfxPluginNativeRender.so
Normal file
BIN
Assets/Plugins/Android/libGfxPluginNativeRender.so
Normal file
Binary file not shown.
39
Assets/Plugins/Android/libGfxPluginNativeRender.so.meta
Normal file
39
Assets/Plugins/Android/libGfxPluginNativeRender.so.meta
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: DCkXsnv/B34eOwGENG/puU/aLspZXxc9PezQb5HZ7ZE2dZf9faeP2Qk=
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 1
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Android: Android
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: ARM64
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
HMIAndroid: HMIAndroid
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: ARM64
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Plugins/Windows.meta
Normal file
8
Assets/Plugins/Windows.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: WSsfty/7UH++iuK/tWenHX7H1q9yLZfCPmEk6KR2UPRA8V8V0XNmP4I=
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/Windows/GfxPluginNativeRender.dll
Normal file
BIN
Assets/Plugins/Windows/GfxPluginNativeRender.dll
Normal file
Binary file not shown.
27
Assets/Plugins/Windows/GfxPluginNativeRender.dll.meta
Normal file
27
Assets/Plugins/Windows/GfxPluginNativeRender.dll.meta
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: DCtMtCn5U3xMS7shR8OwiBEID90HAVK1x74mzYKnSk8WZJSdtVLPTY0=
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 1
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -8183,7 +8183,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &737529738
|
--- !u!4 &737529738
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -14004,7 +14004,7 @@ MonoBehaviour:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1317243097}
|
m_GameObject: {fileID: 1317243097}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 8a432c59e36da65418a040549712b15c, type: 3}
|
m_Script: {fileID: 11500000, guid: 8a432c59e36da65418a040549712b15c, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -14860,7 +14860,7 @@ MonoBehaviour:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 3547149925401584174}
|
m_GameObject: {fileID: 3547149925401584174}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 5f43f8f36f48f284dbd4ee65ea93bd08, type: 3}
|
m_Script: {fileID: 11500000, guid: 5f43f8f36f48f284dbd4ee65ea93bd08, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -15689,7 +15689,7 @@ MonoBehaviour:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1510284357}
|
m_GameObject: {fileID: 1510284357}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: c2f491b7d0e609d488f7a7bf05596657, type: 3}
|
m_Script: {fileID: 11500000, guid: c2f491b7d0e609d488f7a7bf05596657, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -16552,6 +16552,11 @@ Light:
|
|||||||
m_ShadowRadius: 0
|
m_ShadowRadius: 0
|
||||||
m_ShadowAngle: 0
|
m_ShadowAngle: 0
|
||||||
m_UseOcclusionCulling: 1
|
m_UseOcclusionCulling: 1
|
||||||
|
--- !u!1 &1558980086 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4916034631659228877, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 2760477044720773439}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &1559356782
|
--- !u!1 &1559356782
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -17445,7 +17450,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &1636404061
|
--- !u!4 &1636404061
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -22334,7 +22339,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &2050461559
|
--- !u!4 &2050461559
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -24868,7 +24873,7 @@ PrefabInstance:
|
|||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 141850471471409378, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 141850471471409378, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 141850471471409436, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 141850471471409436, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_Enabled
|
propertyPath: m_Enabled
|
||||||
@ -24899,6 +24904,10 @@ PrefabInstance:
|
|||||||
value: 1.3750001
|
value: 1.3750001
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 499885696063000424, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 499885696063000424, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 804158071037245537, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
@ -24920,7 +24929,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2307673875293584181, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 2307673875293584181, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2307673875293584185, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 2307673875293584185, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_DefaultControlScheme
|
propertyPath: m_DefaultControlScheme
|
||||||
@ -24930,6 +24939,14 @@ PrefabInstance:
|
|||||||
propertyPath: m_Enabled
|
propertyPath: m_Enabled
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_Enabled
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_CrosshairCanvas
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: FlythroughDirector
|
propertyPath: FlythroughDirector
|
||||||
value:
|
value:
|
||||||
@ -24946,6 +24963,14 @@ PrefabInstance:
|
|||||||
propertyPath: m_IdleTransitionTime
|
propertyPath: m_IdleTransitionTime
|
||||||
value: 10
|
value: 10
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2760477044887562765, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_StopNaN
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2760477044887562765, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_Dithering
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2760477044887562765, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 2760477044887562765, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_Antialiasing
|
propertyPath: m_Antialiasing
|
||||||
value: 0
|
value: 0
|
||||||
@ -25040,7 +25065,7 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2760477045267651031, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 2760477045267651031, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4682428349833130388, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 4682428349833130388, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
@ -25058,6 +25083,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6943526994973159469, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
propertyPath: m_Enabled
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7019485897165914674, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- target: {fileID: 7019485897165914674, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: 0
|
value: 0
|
||||||
@ -25175,12 +25204,16 @@ PrefabInstance:
|
|||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects:
|
||||||
|
- {fileID: 9131961404394414058, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
m_AddedGameObjects:
|
m_AddedGameObjects:
|
||||||
- targetCorrespondingSourceObject: {fileID: 7019485897165914674, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 7019485897165914674, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 867583717}
|
addedObject: {fileID: 867583717}
|
||||||
m_AddedComponents: []
|
m_AddedComponents:
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 4916034631659228877, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 6556307556733515108}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
--- !u!4 &3547149924374491350
|
--- !u!4 &3547149924374491350
|
||||||
Transform:
|
Transform:
|
||||||
@ -26485,12 +26518,24 @@ MonoBehaviour:
|
|||||||
m_CorrespondingSourceObject: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
m_CorrespondingSourceObject: {fileID: 2760477044286518991, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3}
|
||||||
m_PrefabInstance: {fileID: 2760477044720773439}
|
m_PrefabInstance: {fileID: 2760477044720773439}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 0}
|
m_GameObject: {fileID: 1558980086}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 567bc3eba414c614da47a095c9dde5d7, type: 3}
|
m_Script: {fileID: 11500000, guid: 567bc3eba414c614da47a095c9dde5d7, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!114 &6556307556733515108
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1558980086}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a62f35552be2a4a4e8e2683b7aea565b, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &8509203744807723470
|
--- !u!1 &8509203744807723470
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -1,45 +1,47 @@
|
|||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering.Universal;
|
||||||
|
using X.Rendering.Feature;
|
||||||
|
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
public class Test : MonoBehaviour
|
public class Test : MonoBehaviour
|
||||||
{
|
{
|
||||||
private Material material;
|
int vrs = 0;
|
||||||
private Texture2D oriTexture;
|
public void OnClickVRS()
|
||||||
private Texture2D cvtTexture;
|
{
|
||||||
|
var asset = UniversalRenderPipeline.asset;
|
||||||
|
if (asset != null)
|
||||||
|
{
|
||||||
|
vrs++;
|
||||||
|
if (vrs > (int)RenderingPlugin.VRSPluginShadingRate.X1_PER_4X4_PIXELS)
|
||||||
|
{
|
||||||
|
vrs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
asset.VRSRate = (RenderingPlugin.VRSPluginShadingRate)vrs;
|
||||||
|
Debug.Log("VRS RATE" + asset.VRSRate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
material = GetComponent<MeshRenderer>().sharedMaterial;
|
Debug.Log($"FeatureSupport--\n" +
|
||||||
oriTexture = material.GetTexture("_MainTex") as Texture2D;
|
$"VRS:[{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_DRAW)} " +
|
||||||
ConvertAlpha();
|
$"{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_PRIMITIVE)}" +
|
||||||
|
$"{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_ATTACHMENT)}" +
|
||||||
|
$"]" +
|
||||||
|
$"FG:[ QCOM_AFME: {RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.QCOM_AFME)}]"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConvertAlpha()
|
private void OnGUI()
|
||||||
{
|
{
|
||||||
cvtTexture = new Texture2D(oriTexture.width, oriTexture.height, TextureFormat.ARGB32, false);
|
if (GUI.Button(new Rect(100,200, 100, 50), "VRS"))
|
||||||
for (int i = 0; i < cvtTexture.width; i++)
|
|
||||||
{
|
{
|
||||||
for (int j = 0; j < cvtTexture.height; j++)
|
OnClickVRS();
|
||||||
{
|
}
|
||||||
var col = oriTexture.GetPixel(i, j);
|
if (GUI.Button(new Rect(100, 300, 100, 50), "FG"))
|
||||||
//col.r = Mathf.Pow(col.r, 1/2.2f);
|
{
|
||||||
//col.g = Mathf.Pow(col.g, 1/2.2f);
|
X.Rendering.Feature.FG.UseFG = !X.Rendering.Feature.FG.UseFG;
|
||||||
//col.b = Mathf.Pow(col.b, 1/2.2f);
|
|
||||||
cvtTexture.SetPixel(i,j, col);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cvtTexture.Apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
[ContextMenu("Use Converted")]
|
|
||||||
private void UseAlpha()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[ContextMenu("Use Original")]
|
|
||||||
private void UseOriginal()
|
|
||||||
{
|
|
||||||
material.SetTexture("_MainTex", oriTexture);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ MonoBehaviour:
|
|||||||
m_SupportsHDR: 1
|
m_SupportsHDR: 1
|
||||||
m_HDRColorBufferPrecision: 0
|
m_HDRColorBufferPrecision: 0
|
||||||
m_MSAA: 1
|
m_MSAA: 1
|
||||||
m_RenderScale: 0.75
|
m_RenderScale: 1
|
||||||
m_UpscalingFilter: 0
|
m_UpscalingFilter: 0
|
||||||
m_FsrOverrideSharpness: 1
|
m_FsrOverrideSharpness: 1
|
||||||
m_FsrSharpness: 1
|
m_FsrSharpness: 1
|
||||||
@ -114,5 +114,6 @@ MonoBehaviour:
|
|||||||
m_PrefilterNativeRenderPass: 1
|
m_PrefilterNativeRenderPass: 1
|
||||||
m_ShaderVariantLogLevel: 0
|
m_ShaderVariantLogLevel: 0
|
||||||
m_ShadowCascades: 0
|
m_ShadowCascades: 0
|
||||||
superResolution: 5
|
superResolution: 0
|
||||||
sSRenderScale: 3
|
sSRenderScale: 0
|
||||||
|
vrsRate: 0
|
||||||
|
|||||||
@ -81,7 +81,7 @@ MonoBehaviour:
|
|||||||
- {fileID: 1524480044783497712}
|
- {fileID: 1524480044783497712}
|
||||||
- {fileID: 6334271670068977784}
|
- {fileID: 6334271670068977784}
|
||||||
m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3de228858dca8d12222f0f17d10860a28157820480586dae757
|
m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3de228858dca8d12222f0f17d10860a28157820480586dae757
|
||||||
m_UseNativeRenderPass: 0
|
m_UseNativeRenderPass: 1
|
||||||
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
|
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
|
||||||
shaders:
|
shaders:
|
||||||
blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
|
blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
|
||||||
@ -144,7 +144,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: a6b8ba513f1b1fe499924f362fdde22d, type: 3}
|
m_Script: {fileID: 11500000, guid: a6b8ba513f1b1fe499924f362fdde22d, type: 3}
|
||||||
m_Name: GSR
|
m_Name: GSR
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Active: 1
|
m_Active: 0
|
||||||
v1settings:
|
v1settings:
|
||||||
EnableEdgeDirection: 1
|
EnableEdgeDirection: 1
|
||||||
Mode: 1
|
Mode: 1
|
||||||
|
|||||||
@ -28,7 +28,7 @@ MonoBehaviour:
|
|||||||
m_SupportsHDR: 1
|
m_SupportsHDR: 1
|
||||||
m_HDRColorBufferPrecision: 0
|
m_HDRColorBufferPrecision: 0
|
||||||
m_MSAA: 1
|
m_MSAA: 1
|
||||||
m_RenderScale: 1
|
m_RenderScale: 0.5
|
||||||
m_UpscalingFilter: 0
|
m_UpscalingFilter: 0
|
||||||
m_FsrOverrideSharpness: 0
|
m_FsrOverrideSharpness: 0
|
||||||
m_FsrSharpness: 0.92
|
m_FsrSharpness: 0.92
|
||||||
@ -106,7 +106,14 @@ MonoBehaviour:
|
|||||||
m_PrefilterDBufferMRT1: 1
|
m_PrefilterDBufferMRT1: 1
|
||||||
m_PrefilterDBufferMRT2: 1
|
m_PrefilterDBufferMRT2: 1
|
||||||
m_PrefilterDBufferMRT3: 0
|
m_PrefilterDBufferMRT3: 0
|
||||||
|
m_PrefilterSoftShadowsQualityLow: 0
|
||||||
|
m_PrefilterSoftShadowsQualityMedium: 0
|
||||||
|
m_PrefilterSoftShadowsQualityHigh: 0
|
||||||
|
m_PrefilterSoftShadows: 0
|
||||||
m_PrefilterScreenCoord: 1
|
m_PrefilterScreenCoord: 1
|
||||||
m_PrefilterNativeRenderPass: 1
|
m_PrefilterNativeRenderPass: 1
|
||||||
m_ShaderVariantLogLevel: 0
|
m_ShaderVariantLogLevel: 0
|
||||||
m_ShadowCascades: 0
|
m_ShadowCascades: 0
|
||||||
|
superResolution: 4
|
||||||
|
sSRenderScale: 5
|
||||||
|
vrsRate: 0
|
||||||
|
|||||||
@ -28,7 +28,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
|
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
|
||||||
m_Name: Bloom
|
m_Name: Bloom
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
active: 1
|
active: 0
|
||||||
skipIterations:
|
skipIterations:
|
||||||
m_OverrideState: 1
|
m_OverrideState: 1
|
||||||
m_Value: 0
|
m_Value: 0
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using Benchmarking;
|
using Benchmarking;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
|
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace StarterAssets
|
namespace StarterAssets
|
||||||
|
|||||||
1
NativeRenderPlugin/.gitignore
vendored
1
NativeRenderPlugin/.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
build
|
build
|
||||||
.vscode
|
|
||||||
vsxmake2022
|
vsxmake2022
|
||||||
vs2022
|
vs2022
|
||||||
.vs
|
.vs
|
||||||
|
|||||||
19
NativeRenderPlugin/.vscode/c_cpp_properties.json
vendored
Normal file
19
NativeRenderPlugin/.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Mac",
|
||||||
|
"intelliSenseMode": "clang-x64",
|
||||||
|
"defines": ["FOO", "BAR=100"],
|
||||||
|
"cStandard": "c11",
|
||||||
|
"cppStandard": "c++17",
|
||||||
|
"compileCommands": "${workspaceFolder}/.vscode/compile_commands.json",
|
||||||
|
"browse": {
|
||||||
|
"path": ["${workspaceFolder}"],
|
||||||
|
"limitSymbolsToIncludedHeaders": true,
|
||||||
|
"databaseFilename": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
|
|
||||||
31
NativeRenderPlugin/.vscode/compile_commands.json
vendored
Normal file
31
NativeRenderPlugin/.vscode/compile_commands.json
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI.cpp.o", "RenderAPI.cpp"],
|
||||||
|
"file": "RenderAPI.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D11.cpp.o", "RenderAPI_D3D11.cpp"],
|
||||||
|
"file": "RenderAPI_D3D11.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D12.cpp.o", "RenderAPI_D3D12.cpp"],
|
||||||
|
"file": "RenderAPI_D3D12.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_OpenGLCoreES.cpp.o", "RenderAPI_OpenGLCoreES.cpp"],
|
||||||
|
"file": "RenderAPI_OpenGLCoreES.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_Vulkan.cpp.o", "RenderAPI_Vulkan.cpp"],
|
||||||
|
"file": "RenderAPI_Vulkan.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "g:\\TJURP\\NativeRenderPlugin",
|
||||||
|
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderingPlugin.cpp.o", "RenderingPlugin.cpp"],
|
||||||
|
"file": "RenderingPlugin.cpp"
|
||||||
|
}]
|
||||||
29
NativeRenderPlugin/.vscode/settings.json
vendored
Normal file
29
NativeRenderPlugin/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"xiosbase": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"array": "cpp",
|
||||||
|
"format": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"list": "cpp",
|
||||||
|
"vector": "cpp",
|
||||||
|
"xhash": "cpp",
|
||||||
|
"xstring": "cpp",
|
||||||
|
"xtree": "cpp",
|
||||||
|
"xutility": "cpp",
|
||||||
|
"algorithm": "cpp",
|
||||||
|
"bitset": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"xmemory": "cpp",
|
||||||
|
"__bit_reference": "cpp",
|
||||||
|
"map": "cpp",
|
||||||
|
"unordered_map": "cpp"
|
||||||
|
},
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"editor.lineHighlightBackground": "#1073cf2d",
|
||||||
|
"editor.lineHighlightBorder": "#9fced11f",
|
||||||
|
"activityBar.background": "#2C3102",
|
||||||
|
"titleBar.activeBackground": "#3D4402",
|
||||||
|
"titleBar.activeForeground": "#F9FDD3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -16,7 +16,8 @@
|
|||||||
// UNITY_WEBGL - WebGL
|
// UNITY_WEBGL - WebGL
|
||||||
// UNITY_EMBEDDED_LINUX - EmbeddedLinux OpenGLES
|
// UNITY_EMBEDDED_LINUX - EmbeddedLinux OpenGLES
|
||||||
// UNITY_EMBEDDED_LINUX_GL - EmbeddedLinux OpenGLCore
|
// UNITY_EMBEDDED_LINUX_GL - EmbeddedLinux OpenGLCore
|
||||||
#if _MSC_VER
|
#if OHOS
|
||||||
|
#elif _MSC_VER
|
||||||
#define UNITY_WIN 1
|
#define UNITY_WIN 1
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
@ -39,6 +40,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Which graphics device APIs we possibly support?
|
// Which graphics device APIs we possibly support?
|
||||||
#if UNITY_METRO
|
#if UNITY_METRO
|
||||||
#define SUPPORT_D3D11 1
|
#define SUPPORT_D3D11 1
|
||||||
@ -55,14 +57,11 @@
|
|||||||
#else
|
#else
|
||||||
#define SUPPORT_D3D11 0 // comment this out if you don't have D3D11 header/library files
|
#define SUPPORT_D3D11 0 // comment this out if you don't have D3D11 header/library files
|
||||||
#define SUPPORT_D3D12 0 // comment this out if you don't have D3D12 header/library files
|
#define SUPPORT_D3D12 0 // comment this out if you don't have D3D12 header/library files
|
||||||
#define SUPPORT_OPENGL_UNIFIED 0
|
|
||||||
#define SUPPORT_OPENGL_CORE 0
|
|
||||||
#endif
|
#endif
|
||||||
#elif UNITY_IOS || UNITY_TVOS || UNITY_ANDROID || UNITY_WEBGL
|
#elif UNITY_IOS || UNITY_TVOS || UNITY_ANDROID || UNITY_WEBGL
|
||||||
#ifndef SUPPORT_OPENGL_ES
|
#ifndef SUPPORT_OPENGL_UNIFIED
|
||||||
#define SUPPORT_OPENGL_ES 1
|
#define SUPPORT_OPENGL_UNIFIED SUPPORT_OPENGL_ES
|
||||||
#endif
|
#endif
|
||||||
#define SUPPORT_OPENGL_UNIFIED SUPPORT_OPENGL_ES
|
|
||||||
#ifndef SUPPORT_VULKAN
|
#ifndef SUPPORT_VULKAN
|
||||||
#define SUPPORT_VULKAN 0
|
#define SUPPORT_VULKAN 0
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include "PlatformBase.h"
|
#include "PlatformBase.h"
|
||||||
#include "Unity/IUnityGraphics.h"
|
#include "Unity/IUnityGraphics.h"
|
||||||
|
|
||||||
RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType)
|
RenderAPI* createRenderAPI(UnityGfxRenderer apiType)
|
||||||
{
|
{
|
||||||
# if SUPPORT_D3D11
|
# if SUPPORT_D3D11
|
||||||
if (apiType == kUnityGfxRendererD3D11)
|
if (apiType == kUnityGfxRendererD3D11)
|
||||||
@ -48,3 +48,8 @@ RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType)
|
|||||||
// Unknown or unsupported graphics API
|
// Unknown or unsupported graphics API
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RenderAPI::getFeatureSupport(GraphicsFeature feature)
|
||||||
|
{
|
||||||
|
return support_features[feature];
|
||||||
|
}
|
||||||
|
|||||||
@ -2,10 +2,44 @@
|
|||||||
|
|
||||||
#include "Unity/IUnityGraphics.h"
|
#include "Unity/IUnityGraphics.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <array>
|
||||||
|
|
||||||
struct IUnityInterfaces;
|
struct IUnityInterfaces;
|
||||||
|
|
||||||
|
enum GraphicsFeature
|
||||||
|
{
|
||||||
|
VRS_DRAW = 0,
|
||||||
|
VRS_PRIMITIVE,
|
||||||
|
VRS_ATTACHMENT,
|
||||||
|
HW_SPATIAL_SR,
|
||||||
|
HW_AISR,
|
||||||
|
HW_ADAPTIVE_VRS,
|
||||||
|
HW_FG_INTERPOLATE,
|
||||||
|
HW_FG_EXTRAPOLATION,
|
||||||
|
METAL_FX_SPATIAL_SR,
|
||||||
|
METAL_FX_TEMPORAL_SR,
|
||||||
|
VIVO_TEMPORAL_SR,
|
||||||
|
QCOM_AFME,
|
||||||
|
MAX_CNT
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SupportFeatureList
|
||||||
|
{
|
||||||
|
std::array<bool, GraphicsFeature::MAX_CNT> support_features = {0};
|
||||||
|
|
||||||
|
bool& operator[](GraphicsFeature feature)
|
||||||
|
{
|
||||||
|
return support_features[(int)feature];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AFMEParam
|
||||||
|
{
|
||||||
|
void* src;
|
||||||
|
void* data;
|
||||||
|
void* dst;
|
||||||
|
};
|
||||||
|
|
||||||
// Super-simple "graphics abstraction". This is nothing like how a proper platform abstraction layer would look like;
|
// Super-simple "graphics abstraction". This is nothing like how a proper platform abstraction layer would look like;
|
||||||
// all this does is a base interface for whatever our plugin sample needs. Which is only "draw some triangles"
|
// all this does is a base interface for whatever our plugin sample needs. Which is only "draw some triangles"
|
||||||
// and "modify a texture" at this point.
|
// and "modify a texture" at this point.
|
||||||
@ -16,48 +50,12 @@ class RenderAPI
|
|||||||
public:
|
public:
|
||||||
virtual ~RenderAPI() { }
|
virtual ~RenderAPI() { }
|
||||||
|
|
||||||
|
|
||||||
// Process general event like initialization, shutdown, device loss/reset etc.
|
// Process general event like initialization, shutdown, device loss/reset etc.
|
||||||
virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) = 0;
|
virtual void processDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces) = 0;
|
||||||
|
|
||||||
// Is the API using "reversed" (1.0 at near plane, 0.0 at far plane) depth buffer?
|
// Is the API using "reversed" (1.0 at near plane, 0.0 at far plane) depth buffer?
|
||||||
// Reversed Z is used on modern platforms, and improves depth buffer precision.
|
// Reversed Z is used on modern platforms, and improves depth buffer precision.
|
||||||
virtual bool GetUsesReverseZ() = 0;
|
virtual bool getUsesReverseZ() = 0;
|
||||||
|
|
||||||
// Draw some triangle geometry, using some simple rendering state.
|
|
||||||
// Upon call into our plug-in the render state can be almost completely arbitrary depending
|
|
||||||
// on what was rendered in Unity before. Here, we turn off culling, blending, depth writes etc.
|
|
||||||
// and draw the triangles with a given world matrix. The triangle data is
|
|
||||||
// float3 (position) and byte4 (color) per vertex.
|
|
||||||
virtual void DrawSimpleTriangles(const float worldMatrix[16], int triangleCount, const void* verticesFloat3Byte4) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Begin modifying texture data. You need to pass texture width/height too, since some graphics APIs
|
|
||||||
// (e.g. OpenGL ES) do not have a good way to query that from the texture itself...
|
|
||||||
//
|
|
||||||
// Returns pointer into the data buffer to write into (or NULL on failure), and pitch in bytes of a single texture row.
|
|
||||||
virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch) = 0;
|
|
||||||
// End modifying texture data.
|
|
||||||
virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Begin modifying vertex buffer data.
|
|
||||||
// Returns pointer into the data buffer to write into (or NULL on failure), and buffer size.
|
|
||||||
virtual void* BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize) = 0;
|
|
||||||
// End modifying vertex buffer data.
|
|
||||||
virtual void EndModifyVertexBuffer(void* bufferHandle) = 0;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// DX12 plugin specific functions
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Draws to a texture that is created by the plugin
|
|
||||||
virtual void drawToPluginTexture() {}
|
|
||||||
|
|
||||||
// Draws to a a unity RenderBuffer which can be set with
|
|
||||||
// setRenderTextureResource(). When the texture resource is not
|
|
||||||
// set with setRenderTextureResource() one is created by the plugin
|
|
||||||
virtual void drawToRenderTexture() {}
|
|
||||||
|
|
||||||
// Returns the native resource pointer to either unity render buffer or
|
// Returns the native resource pointer to either unity render buffer or
|
||||||
// to the resource created by the plugin (i.e ID3D12Resource* in case of DX12)
|
// to the resource created by the plugin (i.e ID3D12Resource* in case of DX12)
|
||||||
@ -79,14 +77,29 @@ public:
|
|||||||
|
|
||||||
virtual unsigned int getPresentFlags() { return 0; }
|
virtual unsigned int getPresentFlags() { return 0; }
|
||||||
virtual unsigned int getSyncInterval() { return 0; }
|
virtual unsigned int getSyncInterval() { return 0; }
|
||||||
virtual unsigned int getBackbufferWidth() { return 0; }
|
virtual unsigned int getBackbufferWidth() { return 0; }
|
||||||
virtual unsigned int getBackbufferHeight() { return 0; }
|
virtual unsigned int getBackbufferHeight() { return 0; }
|
||||||
|
|
||||||
virtual void enableVRS(int vrsEnum) {}
|
virtual void enableVRS(int vrsEnum) {}
|
||||||
virtual void disableVRS() {}
|
virtual void disableVRS() {}
|
||||||
|
|
||||||
|
virtual void enableFGExtrapolation() {}
|
||||||
|
virtual void preFGExtrapolation() {}
|
||||||
|
// when renturn true present dst, data may matriaxs or texture
|
||||||
|
virtual bool doFGExtrapolation(void* src, void* data, void* dst) { return false;}
|
||||||
|
virtual void postFGExtrapolation() {}
|
||||||
|
virtual void disableFGExtrapolation() {}
|
||||||
|
|
||||||
|
virtual void spatialUpScale(void* src, void* data, void* dst) {}
|
||||||
|
|
||||||
|
virtual bool getFeatureSupport(GraphicsFeature feature);
|
||||||
|
protected:
|
||||||
|
virtual void initSupportFeature() = 0;
|
||||||
|
|
||||||
|
SupportFeatureList support_features;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Create a graphics API implementation instance for the given API type.
|
// Create a graphics API implementation instance for the given API type.
|
||||||
RenderAPI* CreateRenderAPI(UnityGfxRenderer apiType);
|
RenderAPI* createRenderAPI(UnityGfxRenderer apiType);
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#include "RenderAPI.h"
|
#include "RenderAPI.h"
|
||||||
#include "PlatformBase.h"
|
#include "PlatformBase.h"
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
// Direct3D 12 implementation of RenderAPI.
|
// Direct3D 12 implementation of RenderAPI.
|
||||||
|
|
||||||
#if SUPPORT_D3D12
|
#if SUPPORT_D3D12
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <dxgi1_6.h>
|
#include <dxgi1_6.h>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
|
|||||||
@ -11,6 +11,9 @@
|
|||||||
#include "Unity/IUnityGraphicsMetal.h"
|
#include "Unity/IUnityGraphicsMetal.h"
|
||||||
#import <Metal/Metal.h>
|
#import <Metal/Metal.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MetalFX/MTLFXSpatialScaler.h>
|
||||||
|
|
||||||
|
|
||||||
class RenderAPI_Metal : public RenderAPI
|
class RenderAPI_Metal : public RenderAPI
|
||||||
{
|
{
|
||||||
@ -18,28 +21,16 @@ public:
|
|||||||
RenderAPI_Metal();
|
RenderAPI_Metal();
|
||||||
virtual ~RenderAPI_Metal() { }
|
virtual ~RenderAPI_Metal() { }
|
||||||
|
|
||||||
virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces);
|
virtual void processDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces);
|
||||||
|
|
||||||
virtual bool GetUsesReverseZ() { return true; }
|
virtual bool getUsesReverseZ() { return true; }
|
||||||
|
|
||||||
virtual void DrawSimpleTriangles(const float worldMatrix[16], int triangleCount, const void* verticesFloat3Byte4);
|
virtual void initSupportFeature();
|
||||||
|
|
||||||
virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch);
|
|
||||||
virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr);
|
|
||||||
|
|
||||||
virtual void* BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize);
|
|
||||||
virtual void EndModifyVertexBuffer(void* bufferHandle);
|
|
||||||
|
|
||||||
|
virtual void spatialUpScale(void* src, void*data, void* dst);
|
||||||
private:
|
private:
|
||||||
void CreateResources();
|
id <MTLFXSpatialScaler> mfx_spatial_scaler;
|
||||||
|
IUnityGraphicsMetal* metal_graphics;
|
||||||
private:
|
|
||||||
IUnityGraphicsMetal* m_MetalGraphics;
|
|
||||||
id<MTLBuffer> m_VertexBuffer;
|
|
||||||
id<MTLBuffer> m_ConstantBuffer;
|
|
||||||
|
|
||||||
id<MTLDepthStencilState> m_DepthStencil;
|
|
||||||
id<MTLRenderPipelineState> m_Pipeline;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -49,210 +40,66 @@ RenderAPI* CreateRenderAPI_Metal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Class MTLVertexDescriptorClass;
|
|
||||||
static Class MTLRenderPipelineDescriptorClass;
|
|
||||||
static Class MTLDepthStencilDescriptorClass;
|
|
||||||
const int kVertexSize = 12 + 4;
|
|
||||||
|
|
||||||
// Simple vertex & fragment shader source
|
|
||||||
static const char kShaderSource[] =
|
|
||||||
"#include <metal_stdlib>\n"
|
|
||||||
"using namespace metal;\n"
|
|
||||||
"struct AppData\n"
|
|
||||||
"{\n"
|
|
||||||
" float4x4 worldMatrix;\n"
|
|
||||||
"};\n"
|
|
||||||
"struct Vertex\n"
|
|
||||||
"{\n"
|
|
||||||
" float3 pos [[attribute(0)]];\n"
|
|
||||||
" float4 color [[attribute(1)]];\n"
|
|
||||||
"};\n"
|
|
||||||
"struct VSOutput\n"
|
|
||||||
"{\n"
|
|
||||||
" float4 pos [[position]];\n"
|
|
||||||
" half4 color;\n"
|
|
||||||
"};\n"
|
|
||||||
"struct FSOutput\n"
|
|
||||||
"{\n"
|
|
||||||
" half4 frag_data [[color(0)]];\n"
|
|
||||||
"};\n"
|
|
||||||
"vertex VSOutput vertexMain(Vertex input [[stage_in]], constant AppData& my_cb [[buffer(0)]])\n"
|
|
||||||
"{\n"
|
|
||||||
" VSOutput out = { my_cb.worldMatrix * float4(input.pos.xyz, 1), (half4)input.color };\n"
|
|
||||||
" return out;\n"
|
|
||||||
"}\n"
|
|
||||||
"fragment FSOutput fragmentMain(VSOutput input [[stage_in]])\n"
|
|
||||||
"{\n"
|
|
||||||
" FSOutput out = { input.color };\n"
|
|
||||||
" return out;\n"
|
|
||||||
"}\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RenderAPI_Metal::CreateResources()
|
|
||||||
{
|
|
||||||
id<MTLDevice> metalDevice = m_MetalGraphics->MetalDevice();
|
|
||||||
NSError* error = nil;
|
|
||||||
|
|
||||||
// Create shaders
|
|
||||||
NSString* srcStr = [[NSString alloc] initWithBytes:kShaderSource length:sizeof(kShaderSource) encoding:NSASCIIStringEncoding];
|
|
||||||
id<MTLLibrary> shaderLibrary = [metalDevice newLibraryWithSource:srcStr options:nil error:&error];
|
|
||||||
if(error != nil)
|
|
||||||
{
|
|
||||||
NSString* desc = [error localizedDescription];
|
|
||||||
NSString* reason = [error localizedFailureReason];
|
|
||||||
::fprintf(stderr, "%s\n%s\n\n", desc ? [desc UTF8String] : "<unknown>", reason ? [reason UTF8String] : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
id<MTLFunction> vertexFunction = [shaderLibrary newFunctionWithName:@"vertexMain"];
|
|
||||||
id<MTLFunction> fragmentFunction = [shaderLibrary newFunctionWithName:@"fragmentMain"];
|
|
||||||
|
|
||||||
|
|
||||||
// Vertex / Constant buffers
|
|
||||||
|
|
||||||
# if UNITY_OSX
|
|
||||||
MTLResourceOptions bufferOptions = MTLResourceCPUCacheModeDefaultCache | MTLResourceStorageModeManaged;
|
|
||||||
# else
|
|
||||||
MTLResourceOptions bufferOptions = MTLResourceOptionCPUCacheModeDefault;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
m_VertexBuffer = [metalDevice newBufferWithLength:1024 options:bufferOptions];
|
|
||||||
m_VertexBuffer.label = @"PluginVB";
|
|
||||||
m_ConstantBuffer = [metalDevice newBufferWithLength:16*sizeof(float) options:bufferOptions];
|
|
||||||
m_ConstantBuffer.label = @"PluginCB";
|
|
||||||
|
|
||||||
// Vertex layout
|
|
||||||
MTLVertexDescriptor* vertexDesc = [MTLVertexDescriptorClass vertexDescriptor];
|
|
||||||
vertexDesc.attributes[0].format = MTLVertexFormatFloat3;
|
|
||||||
vertexDesc.attributes[0].offset = 0;
|
|
||||||
vertexDesc.attributes[0].bufferIndex = 1;
|
|
||||||
vertexDesc.attributes[1].format = MTLVertexFormatUChar4Normalized;
|
|
||||||
vertexDesc.attributes[1].offset = 3*sizeof(float);
|
|
||||||
vertexDesc.attributes[1].bufferIndex = 1;
|
|
||||||
vertexDesc.layouts[1].stride = kVertexSize;
|
|
||||||
vertexDesc.layouts[1].stepFunction = MTLVertexStepFunctionPerVertex;
|
|
||||||
vertexDesc.layouts[1].stepRate = 1;
|
|
||||||
|
|
||||||
// Pipeline
|
|
||||||
|
|
||||||
MTLRenderPipelineDescriptor* pipeDesc = [[MTLRenderPipelineDescriptorClass alloc] init];
|
|
||||||
// Let's assume we're rendering into BGRA8Unorm...
|
|
||||||
pipeDesc.colorAttachments[0].pixelFormat= MTLPixelFormatBGRA8Unorm;
|
|
||||||
|
|
||||||
pipeDesc.depthAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8;
|
|
||||||
pipeDesc.stencilAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8;
|
|
||||||
|
|
||||||
pipeDesc.sampleCount = 1;
|
|
||||||
pipeDesc.colorAttachments[0].blendingEnabled = NO;
|
|
||||||
|
|
||||||
pipeDesc.vertexFunction = vertexFunction;
|
|
||||||
pipeDesc.fragmentFunction = fragmentFunction;
|
|
||||||
pipeDesc.vertexDescriptor = vertexDesc;
|
|
||||||
|
|
||||||
m_Pipeline = [metalDevice newRenderPipelineStateWithDescriptor:pipeDesc error:&error];
|
|
||||||
if (error != nil)
|
|
||||||
{
|
|
||||||
::fprintf(stderr, "Metal: Error creating pipeline state: %s\n%s\n", [[error localizedDescription] UTF8String], [[error localizedFailureReason] UTF8String]);
|
|
||||||
error = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Depth/Stencil state
|
|
||||||
MTLDepthStencilDescriptor* depthDesc = [[MTLDepthStencilDescriptorClass alloc] init];
|
|
||||||
depthDesc.depthCompareFunction = GetUsesReverseZ() ? MTLCompareFunctionGreaterEqual : MTLCompareFunctionLessEqual;
|
|
||||||
depthDesc.depthWriteEnabled = false;
|
|
||||||
m_DepthStencil = [metalDevice newDepthStencilStateWithDescriptor:depthDesc];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RenderAPI_Metal::RenderAPI_Metal()
|
RenderAPI_Metal::RenderAPI_Metal()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderAPI_Metal::processDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces)
|
||||||
void RenderAPI_Metal::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces)
|
|
||||||
{
|
{
|
||||||
if (type == kUnityGfxDeviceEventInitialize)
|
if (type == kUnityGfxDeviceEventInitialize)
|
||||||
{
|
{
|
||||||
m_MetalGraphics = interfaces->Get<IUnityGraphicsMetal>();
|
metal_graphics = interfaces->Get<IUnityGraphicsMetal>();
|
||||||
MTLVertexDescriptorClass = NSClassFromString(@"MTLVertexDescriptor");
|
|
||||||
MTLRenderPipelineDescriptorClass = NSClassFromString(@"MTLRenderPipelineDescriptor");
|
|
||||||
MTLDepthStencilDescriptorClass = NSClassFromString(@"MTLDepthStencilDescriptor");
|
|
||||||
|
|
||||||
CreateResources();
|
|
||||||
}
|
}
|
||||||
else if (type == kUnityGfxDeviceEventShutdown)
|
else if (type == kUnityGfxDeviceEventShutdown)
|
||||||
{
|
{
|
||||||
//@TODO: release resources
|
//@TODO: release resources
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void RenderAPI_Metal::initSupportFeature()
|
||||||
|
|
||||||
void RenderAPI_Metal::DrawSimpleTriangles(const float worldMatrix[16], int triangleCount, const void* verticesFloat3Byte4)
|
|
||||||
{
|
{
|
||||||
// Update vertex and constant buffers
|
if (@available(iOS 16.0, *))
|
||||||
//@TODO: we don't do any synchronization here :)
|
{
|
||||||
|
support_features[GraphicsFeature::METAL_FX_SPATIAL_SR] = true;
|
||||||
const int vbSize = triangleCount * 3 * kVertexSize;
|
support_features[GraphicsFeature::METAL_FX_TEMPORAL_SR] = true;
|
||||||
const int cbSize = 16 * sizeof(float);
|
}
|
||||||
|
|
||||||
::memcpy(m_VertexBuffer.contents, verticesFloat3Byte4, vbSize);
|
|
||||||
::memcpy(m_ConstantBuffer.contents, worldMatrix, cbSize);
|
|
||||||
|
|
||||||
#if UNITY_OSX
|
|
||||||
[m_VertexBuffer didModifyRange:NSMakeRange(0, vbSize)];
|
|
||||||
[m_ConstantBuffer didModifyRange:NSMakeRange(0, cbSize)];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
id<MTLRenderCommandEncoder> cmd = (id<MTLRenderCommandEncoder>)m_MetalGraphics->CurrentCommandEncoder();
|
|
||||||
|
|
||||||
// Setup rendering state
|
|
||||||
[cmd setRenderPipelineState:m_Pipeline];
|
|
||||||
[cmd setDepthStencilState:m_DepthStencil];
|
|
||||||
[cmd setCullMode:MTLCullModeNone];
|
|
||||||
|
|
||||||
// Bind buffers
|
|
||||||
[cmd setVertexBuffer:m_VertexBuffer offset:0 atIndex:1];
|
|
||||||
[cmd setVertexBuffer:m_ConstantBuffer offset:0 atIndex:0];
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
[cmd drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:triangleCount*3];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderAPI_Metal::spatialUpScale(void* src, void* data, void* dst)
|
||||||
void* RenderAPI_Metal::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch)
|
|
||||||
{
|
{
|
||||||
const int rowPitch = textureWidth * 4;
|
if (@available(iOS 16.0, *))
|
||||||
// Just allocate a system memory buffer here for simplicity
|
{
|
||||||
unsigned char* data = new unsigned char[rowPitch * textureHeight];
|
id<MTLTexture> srctex = (__bridge id<MTLTexture>)src;
|
||||||
*outRowPitch = rowPitch;
|
id<MTLTexture> dsttex = (__bridge id<MTLTexture>)dst;
|
||||||
return data;
|
|
||||||
|
id<MTLDevice> _device = metal_graphics->MetalDevice();
|
||||||
|
id<MTLCommandBuffer> cmd = (id<MTLCommandBuffer>)metal_graphics->CurrentCommandBuffer();
|
||||||
|
|
||||||
|
cmd.label = @"Upscale Command Buffer";
|
||||||
|
|
||||||
|
if (mfx_spatial_scaler == nil)
|
||||||
|
{
|
||||||
|
MTLFXSpatialScalerDescriptor* desc = [[MTLFXSpatialScalerDescriptor alloc]init];
|
||||||
|
desc.inputWidth = [srctex width];
|
||||||
|
desc.inputHeight = [srctex height];
|
||||||
|
desc.outputWidth = [dsttex width];
|
||||||
|
desc.outputHeight = [dsttex height];
|
||||||
|
|
||||||
|
desc.colorTextureFormat = [srctex pixelFormat];
|
||||||
|
desc.outputTextureFormat = [dsttex pixelFormat];
|
||||||
|
desc.colorProcessingMode = MTLFXSpatialScalerColorProcessingModeLinear;
|
||||||
|
|
||||||
|
mfx_spatial_scaler = [desc newSpatialScalerWithDevice:_device];
|
||||||
|
if (mfx_spatial_scaler == nil)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mfx_spatial_scaler.colorTexture = srctex;
|
||||||
|
mfx_spatial_scaler.outputTexture = dsttex;
|
||||||
|
[mfx_spatial_scaler encodeToCommandBuffer:cmd];
|
||||||
|
[cmd commit];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RenderAPI_Metal::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr)
|
|
||||||
{
|
|
||||||
id<MTLTexture> tex = (__bridge id<MTLTexture>)textureHandle;
|
|
||||||
// Update texture data, and free the memory buffer
|
|
||||||
[tex replaceRegion:MTLRegionMake3D(0,0,0, textureWidth,textureHeight,1) mipmapLevel:0 withBytes:dataPtr bytesPerRow:rowPitch];
|
|
||||||
delete[](unsigned char*)dataPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void* RenderAPI_Metal::BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize)
|
|
||||||
{
|
|
||||||
id<MTLBuffer> buf = (__bridge id<MTLBuffer>)bufferHandle;
|
|
||||||
*outBufferSize = [buf length];
|
|
||||||
return [buf contents];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RenderAPI_Metal::EndModifyVertexBuffer(void* bufferHandle)
|
|
||||||
{
|
|
||||||
# if UNITY_OSX
|
|
||||||
id<MTLBuffer> buf = (__bridge id<MTLBuffer>)bufferHandle;
|
|
||||||
[buf didModifyRange:NSMakeRange(0, buf.length)];
|
|
||||||
# endif // if UNITY_OSX
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // #if SUPPORT_METAL
|
#endif // #if SUPPORT_METAL
|
||||||
|
|||||||
@ -1,210 +1,137 @@
|
|||||||
#include "RenderAPI.h"
|
#include "RenderAPI.h"
|
||||||
#include "PlatformBase.h"
|
#include "PlatformBase.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
// OpenGL Core profile (desktop) or OpenGL ES (mobile) implementation of RenderAPI.
|
// OpenGL Core profile (desktop) or OpenGL ES (mobile) implementation of RenderAPI.
|
||||||
// Supports several flavors: Core, ES2, ES3
|
// Supports several flavors: Core, ES2, ES3
|
||||||
|
|
||||||
|
|
||||||
#if SUPPORT_OPENGL_UNIFIED
|
#if SUPPORT_OPENGL_UNIFIED
|
||||||
|
|
||||||
|
#include "Unity/IUnityRenderingExtensions.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#if UNITY_IOS || UNITY_TVOS
|
#if UNITY_IOS || UNITY_TVOS
|
||||||
# include <OpenGLES/ES2/gl.h>
|
#include <OpenGLES/ES2/gl.h>
|
||||||
#elif UNITY_ANDROID || UNITY_WEBGL
|
#elif UNITY_ANDROID || UNITY_WEBGL || OHOS
|
||||||
# include <GLES2/gl2.h>
|
#define GL_GLEXT_PROTOTYPES
|
||||||
|
#include <GLES2/gl2.h>
|
||||||
|
#include <GLES2/gl2ext.h>
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
|
||||||
|
#if OHOS
|
||||||
|
#include <xengine/xeg_gles_extension.h>
|
||||||
|
#include "xengine/xeg_gles_spatial_upscale.h"
|
||||||
|
#include "xengine/xeg_gles_adaptive_vrs.h"
|
||||||
|
#include "xengine/xeg_gles_neural_upscale.h"
|
||||||
|
#include <native_buffer/native_buffer.h>
|
||||||
|
#include <native_window/external_window.h>
|
||||||
|
#endif
|
||||||
#elif UNITY_OSX
|
#elif UNITY_OSX
|
||||||
# include <OpenGL/gl3.h>
|
#include <OpenGL/gl3.h>
|
||||||
#elif UNITY_WIN
|
#elif UNITY_WIN
|
||||||
// On Windows, use gl3w to initialize and load OpenGL Core functions. In principle any other
|
// On Windows, use gl3w to initialize and load OpenGL Core functions. In principle any other
|
||||||
// library (like GLEW, GLFW etc.) can be used; here we use gl3w since it's simple and
|
// library (like GLEW, GLFW etc.) can be used; here we use gl3w since it's simple and
|
||||||
// straightforward.
|
// straightforward.
|
||||||
# include "gl3w/gl3w.h"
|
#include "gl3w/gl3w.h"
|
||||||
#elif UNITY_LINUX
|
#elif UNITY_LINUX
|
||||||
# define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
# include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#elif UNITY_EMBEDDED_LINUX
|
#elif UNITY_EMBEDDED_LINUX
|
||||||
# include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#if SUPPORT_OPENGL_CORE
|
#if SUPPORT_OPENGL_CORE
|
||||||
# define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
# include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
#elif UNITY_QNX
|
#elif UNITY_QNX
|
||||||
# include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#else
|
#else
|
||||||
# error Unknown platform
|
#error Unknown platform
|
||||||
#endif
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
extern void unityLog(const char *msg);
|
||||||
|
|
||||||
|
typedef void(GL_APIENTRYP PFNGLSHADINGRATE)(GLenum rate);
|
||||||
|
typedef void (GL_APIENTRYP PFNGLQCOMFRAMEEXTRAPOLATION) (GLuint src1, GLuint src2, GLuint output, float scaleFactor);
|
||||||
|
|
||||||
class RenderAPI_OpenGLCoreES : public RenderAPI
|
class RenderAPI_OpenGLCoreES : public RenderAPI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RenderAPI_OpenGLCoreES(UnityGfxRenderer apiType);
|
RenderAPI_OpenGLCoreES(UnityGfxRenderer api_type);
|
||||||
virtual ~RenderAPI_OpenGLCoreES() { }
|
virtual ~RenderAPI_OpenGLCoreES() {}
|
||||||
|
|
||||||
virtual void ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces);
|
virtual void processDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces *interfaces) override;
|
||||||
|
|
||||||
virtual bool GetUsesReverseZ() { return false; }
|
virtual bool getUsesReverseZ() override { return false; }
|
||||||
|
|
||||||
virtual void DrawSimpleTriangles(const float worldMatrix[16], int triangleCount, const void* verticesFloat3Byte4);
|
virtual void enableVRS(int vrsEnum) override;
|
||||||
|
virtual void disableVRS() override;
|
||||||
|
|
||||||
virtual void* BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch);
|
virtual void enableFGExtrapolation() override;
|
||||||
virtual void EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr);
|
virtual void preFGExtrapolation() override;
|
||||||
|
virtual bool doFGExtrapolation(void *src, void *data, void *dst) override;
|
||||||
|
virtual void postFGExtrapolation() override;
|
||||||
|
virtual void disableFGExtrapolation() override;
|
||||||
|
|
||||||
virtual void* BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize);
|
virtual void spatialUpScale(void *src, void *data, void *dst) override;
|
||||||
virtual void EndModifyVertexBuffer(void* bufferHandle);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateResources();
|
virtual void initSupportFeature() override;
|
||||||
|
UnityGfxRenderer m_api_type;
|
||||||
|
|
||||||
|
PFNGLSHADINGRATE gl_shadingrate_fn = nullptr;
|
||||||
|
PFNGLQCOMFRAMEEXTRAPOLATION gl_extrapolate_qcom_fn;
|
||||||
|
|
||||||
private:
|
|
||||||
UnityGfxRenderer m_APIType;
|
|
||||||
GLuint m_VertexShader;
|
|
||||||
GLuint m_FragmentShader;
|
|
||||||
GLuint m_Program;
|
|
||||||
GLuint m_VertexArray;
|
|
||||||
GLuint m_VertexBuffer;
|
|
||||||
int m_UniformWorldMatrix;
|
|
||||||
int m_UniformProjMatrix;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 重新定义 vrs rate
|
||||||
|
/*
|
||||||
|
QCOM_shading_rate
|
||||||
|
SHADING_RATE_1X1_PIXELS_QCOM 0x96A6
|
||||||
|
SHADING_RATE_1X2_PIXELS_QCOM 0x96A7
|
||||||
|
SHADING_RATE_2X1_PIXELS_QCOM 0x96A8
|
||||||
|
SHADING_RATE_2X2_PIXELS_QCOM 0x96A9
|
||||||
|
SHADING_RATE_4X2_PIXELS_QCOM 0x96AC
|
||||||
|
SHADING_RATE_4X4_PIXELS_QCOM 0x96AE
|
||||||
|
*/
|
||||||
|
#define SHADING_RATE_1X1_PIXELS_EXT 0x96A6
|
||||||
|
#define SHADING_RATE_1X2_PIXELS_EXT 0x96A7
|
||||||
|
#define SHADING_RATE_2X1_PIXELS_EXT 0x96A8
|
||||||
|
#define SHADING_RATE_2X2_PIXELS_EXT 0x96A9
|
||||||
|
#define SHADING_RATE_1X4_PIXELS_EXT 0x96AA
|
||||||
|
#define SHADING_RATE_4X1_PIXELS_EXT 0x96AB
|
||||||
|
#define SHADING_RATE_4X2_PIXELS_EXT 0x96AC
|
||||||
|
#define SHADING_RATE_2X4_PIXELS_EXT 0x96AD
|
||||||
|
#define SHADING_RATE_4X4_PIXELS_EXT 0x96AE
|
||||||
|
|
||||||
RenderAPI* CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer apiType)
|
// TODO: glGetFragmentShadingRatesEXT 检查支持的项
|
||||||
{
|
static GLenum vrs_argment_size_table[] =
|
||||||
return new RenderAPI_OpenGLCoreES(apiType);
|
{
|
||||||
}
|
SHADING_RATE_1X1_PIXELS_EXT,
|
||||||
|
SHADING_RATE_2X1_PIXELS_EXT,
|
||||||
|
SHADING_RATE_1X2_PIXELS_EXT,
|
||||||
enum VertexInputs
|
SHADING_RATE_2X2_PIXELS_EXT,
|
||||||
{
|
SHADING_RATE_4X2_PIXELS_EXT,
|
||||||
kVertexInputPosition = 0,
|
SHADING_RATE_2X4_PIXELS_EXT,
|
||||||
kVertexInputColor = 1
|
SHADING_RATE_4X4_PIXELS_EXT,
|
||||||
|
// SHADING_RATE_1X4_PIXELS_EXT, //(此硬件原生不支持)
|
||||||
|
// SHADING_RATE_4X1_PIXELS_EXT,// (此硬件原生不支持)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
RenderAPI *CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer api_type)
|
||||||
// Simple vertex shader source
|
|
||||||
#define VERTEX_SHADER_SRC(ver, attr, varying) \
|
|
||||||
ver \
|
|
||||||
attr " highp vec3 pos;\n" \
|
|
||||||
attr " lowp vec4 color;\n" \
|
|
||||||
"\n" \
|
|
||||||
varying " lowp vec4 ocolor;\n" \
|
|
||||||
"\n" \
|
|
||||||
"uniform highp mat4 worldMatrix;\n" \
|
|
||||||
"uniform highp mat4 projMatrix;\n" \
|
|
||||||
"\n" \
|
|
||||||
"void main()\n" \
|
|
||||||
"{\n" \
|
|
||||||
" gl_Position = (projMatrix * worldMatrix) * vec4(pos,1);\n" \
|
|
||||||
" ocolor = color;\n" \
|
|
||||||
"}\n" \
|
|
||||||
|
|
||||||
static const char* kGlesVProgTextGLES2 = VERTEX_SHADER_SRC("\n", "attribute", "varying");
|
|
||||||
static const char* kGlesVProgTextGLES3 = VERTEX_SHADER_SRC("#version 300 es\n", "in", "out");
|
|
||||||
#if SUPPORT_OPENGL_CORE
|
|
||||||
static const char* kGlesVProgTextGLCore = VERTEX_SHADER_SRC("#version 150\n", "in", "out");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef VERTEX_SHADER_SRC
|
|
||||||
|
|
||||||
|
|
||||||
// Simple fragment shader source
|
|
||||||
#define FRAGMENT_SHADER_SRC(ver, varying, outDecl, outVar) \
|
|
||||||
ver \
|
|
||||||
outDecl \
|
|
||||||
varying " lowp vec4 ocolor;\n" \
|
|
||||||
"\n" \
|
|
||||||
"void main()\n" \
|
|
||||||
"{\n" \
|
|
||||||
" " outVar " = ocolor;\n" \
|
|
||||||
"}\n" \
|
|
||||||
|
|
||||||
static const char* kGlesFShaderTextGLES2 = FRAGMENT_SHADER_SRC("\n", "varying", "\n", "gl_FragColor");
|
|
||||||
static const char* kGlesFShaderTextGLES3 = FRAGMENT_SHADER_SRC("#version 300 es\n", "in", "out lowp vec4 fragColor;\n", "fragColor");
|
|
||||||
#if SUPPORT_OPENGL_CORE
|
|
||||||
static const char* kGlesFShaderTextGLCore = FRAGMENT_SHADER_SRC("#version 150\n", "in", "out lowp vec4 fragColor;\n", "fragColor");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef FRAGMENT_SHADER_SRC
|
|
||||||
|
|
||||||
|
|
||||||
static GLuint CreateShader(GLenum type, const char* sourceText)
|
|
||||||
{
|
{
|
||||||
GLuint ret = glCreateShader(type);
|
return new RenderAPI_OpenGLCoreES(api_type);
|
||||||
glShaderSource(ret, 1, &sourceText, NULL);
|
|
||||||
glCompileShader(ret);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderAPI_OpenGLCoreES::RenderAPI_OpenGLCoreES(UnityGfxRenderer api_type)
|
||||||
void RenderAPI_OpenGLCoreES::CreateResources()
|
: m_api_type(api_type)
|
||||||
{
|
|
||||||
# if UNITY_WIN && SUPPORT_OPENGL_CORE
|
|
||||||
if (m_APIType == kUnityGfxRendererOpenGLCore)
|
|
||||||
gl3wInit();
|
|
||||||
# endif
|
|
||||||
// Make sure that there are no GL error flags set before creating resources
|
|
||||||
while (glGetError() != GL_NO_ERROR) {}
|
|
||||||
|
|
||||||
// Create shaders
|
|
||||||
if (m_APIType == kUnityGfxRendererOpenGLES30)
|
|
||||||
{
|
|
||||||
m_VertexShader = CreateShader(GL_VERTEX_SHADER, kGlesVProgTextGLES2);
|
|
||||||
m_FragmentShader = CreateShader(GL_FRAGMENT_SHADER, kGlesFShaderTextGLES2);
|
|
||||||
}
|
|
||||||
else if (m_APIType == kUnityGfxRendererOpenGLES30)
|
|
||||||
{
|
|
||||||
m_VertexShader = CreateShader(GL_VERTEX_SHADER, kGlesVProgTextGLES3);
|
|
||||||
m_FragmentShader = CreateShader(GL_FRAGMENT_SHADER, kGlesFShaderTextGLES3);
|
|
||||||
}
|
|
||||||
# if SUPPORT_OPENGL_CORE
|
|
||||||
else if (m_APIType == kUnityGfxRendererOpenGLCore)
|
|
||||||
{
|
|
||||||
m_VertexShader = CreateShader(GL_VERTEX_SHADER, kGlesVProgTextGLCore);
|
|
||||||
m_FragmentShader = CreateShader(GL_FRAGMENT_SHADER, kGlesFShaderTextGLCore);
|
|
||||||
}
|
|
||||||
# endif // if SUPPORT_OPENGL_CORE
|
|
||||||
|
|
||||||
|
|
||||||
// Link shaders into a program and find uniform locations
|
|
||||||
m_Program = glCreateProgram();
|
|
||||||
glBindAttribLocation(m_Program, kVertexInputPosition, "pos");
|
|
||||||
glBindAttribLocation(m_Program, kVertexInputColor, "color");
|
|
||||||
glAttachShader(m_Program, m_VertexShader);
|
|
||||||
glAttachShader(m_Program, m_FragmentShader);
|
|
||||||
# if SUPPORT_OPENGL_CORE
|
|
||||||
if (m_APIType == kUnityGfxRendererOpenGLCore)
|
|
||||||
glBindFragDataLocation(m_Program, 0, "fragColor");
|
|
||||||
# endif // if SUPPORT_OPENGL_CORE
|
|
||||||
glLinkProgram(m_Program);
|
|
||||||
|
|
||||||
GLint status = 0;
|
|
||||||
glGetProgramiv(m_Program, GL_LINK_STATUS, &status);
|
|
||||||
assert(status == GL_TRUE);
|
|
||||||
|
|
||||||
m_UniformWorldMatrix = glGetUniformLocation(m_Program, "worldMatrix");
|
|
||||||
m_UniformProjMatrix = glGetUniformLocation(m_Program, "projMatrix");
|
|
||||||
|
|
||||||
// Create vertex buffer
|
|
||||||
glGenBuffers(1, &m_VertexBuffer);
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, 1024, NULL, GL_STREAM_DRAW);
|
|
||||||
|
|
||||||
assert(glGetError() == GL_NO_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RenderAPI_OpenGLCoreES::RenderAPI_OpenGLCoreES(UnityGfxRenderer apiType)
|
|
||||||
: m_APIType(apiType)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::processDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces *interfaces)
|
||||||
void RenderAPI_OpenGLCoreES::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInterfaces* interfaces)
|
|
||||||
{
|
{
|
||||||
if (type == kUnityGfxDeviceEventInitialize)
|
if (type == kUnityGfxDeviceEventInitialize)
|
||||||
{
|
{
|
||||||
CreateResources();
|
initSupportFeature();
|
||||||
}
|
}
|
||||||
else if (type == kUnityGfxDeviceEventShutdown)
|
else if (type == kUnityGfxDeviceEventShutdown)
|
||||||
{
|
{
|
||||||
@ -212,103 +139,155 @@ void RenderAPI_OpenGLCoreES::ProcessDeviceEvent(UnityGfxDeviceEventType type, IU
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::initSupportFeature()
|
||||||
void RenderAPI_OpenGLCoreES::DrawSimpleTriangles(const float worldMatrix[16], int triangleCount, const void* verticesFloat3Byte4)
|
|
||||||
{
|
{
|
||||||
// Set basic render state
|
#ifdef GL_EXT_fragment_shading_rate
|
||||||
glDisable(GL_CULL_FACE);
|
support_features[GraphicsFeature::VRS_DRAW] = true;
|
||||||
glDisable(GL_BLEND);
|
gl_shadingrate_fn = glShadingRateEXT;
|
||||||
glDepthFunc(GL_LEQUAL);
|
#endif // GL_EXT_fragment_shading_rate
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Tweak the projection matrix a bit to make it match what identity projection would do in D3D case.
|
#ifdef GL_EXT_fragment_shading_rate_primitive
|
||||||
float projectionMatrix[16] = {
|
support_features[GraphicsFeature::VRS_PRIMITIVE] = true;
|
||||||
1,0,0,0,
|
#endif // GL_EXT_fragment_shading_rate_primitive
|
||||||
0,1,0,0,
|
|
||||||
0,0,2,0,
|
#ifdef GL_EXT_fragment_shading_rate_attachment
|
||||||
0,0,-1,1,
|
support_features[GraphicsFeature::VRS_ATTACHMENT] = true;
|
||||||
|
#endif // GL_EXT_fragment_shading_rate_attachment
|
||||||
|
|
||||||
|
const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
|
||||||
|
if (strstr(extensions, "GL_EXT_fragment_shading_rate") || strstr(extensions, "GL_QCOM_shading_rate"))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::VRS_DRAW] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(extensions, "GL_EXT_fragment_shading_rate_primitive"))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::VRS_PRIMITIVE] = true;
|
||||||
|
}
|
||||||
|
if (strstr(extensions, "GL_EXT_fragment_shading_rate_attachment"))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::VRS_ATTACHMENT] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (support_features[GraphicsFeature::VRS_DRAW])
|
||||||
|
{
|
||||||
|
if (gl_shadingrate_fn == nullptr)
|
||||||
|
{
|
||||||
|
gl_shadingrate_fn = (PFNGLSHADINGRATE)((void *)eglGetProcAddress("glShadingRateQCOM"));
|
||||||
|
if (gl_shadingrate_fn == nullptr)
|
||||||
|
{
|
||||||
|
gl_shadingrate_fn = (PFNGLSHADINGRATE)((void *)eglGetProcAddress("glShadingRateEXT"));
|
||||||
|
if (gl_shadingrate_fn == nullptr)
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::VRS_DRAW] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(extensions, "GL_QCOM_frame_extrapolation"))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::QCOM_AFME] = true;
|
||||||
|
gl_extrapolate_qcom_fn = (PFNGLQCOMFRAMEEXTRAPOLATION)eglGetProcAddress("glExtrapolateTex2DQCOM");
|
||||||
|
}
|
||||||
|
|
||||||
|
#if OHOS
|
||||||
|
extensions = (const char *)HMS_XEG_GetString(XEG_EXTENSIONS);
|
||||||
|
|
||||||
|
if (strstr(extensions, XEG_SPATIAL_UPSCALE_EXTENSION_NAME))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::HW_SPATIAL_SR] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(extensions, XEG_NEURAL_UPSCALE_EXTENSION_NAME))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::HW_AISR] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(extensions, XEG_ADAPTIVE_VRS_EXTENSION_NAME))
|
||||||
|
{
|
||||||
|
support_features[GraphicsFeature::HW_ADAPTIVE_VRS] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char buf[40];
|
||||||
|
for (size_t i = 0; i < GraphicsFeature::MAX_CNT; i++)
|
||||||
|
{
|
||||||
|
sprintf(buf, "GraphicsFeature: %d \n", support_features[(GraphicsFeature)i]);
|
||||||
|
unityLog(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::enableVRS(int vrs_enum)
|
||||||
|
{
|
||||||
|
gl_shadingrate_fn(vrs_argment_size_table[vrs_enum]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::disableVRS()
|
||||||
|
{
|
||||||
|
gl_shadingrate_fn(vrs_argment_size_table[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::enableFGExtrapolation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::preFGExtrapolation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RenderAPI_OpenGLCoreES::doFGExtrapolation(void *src, void *data, void *dst)
|
||||||
|
{
|
||||||
|
GLuint gl_src0tex = (GLuint)(size_t)(src);
|
||||||
|
GLuint gl_src1tex = (GLuint)(size_t)(data);
|
||||||
|
GLuint gl_dsttex = (GLuint)(size_t)(dst);
|
||||||
|
|
||||||
|
gl_extrapolate_qcom_fn(gl_src0tex, gl_src1tex, gl_dsttex, 0.5f);
|
||||||
|
|
||||||
|
auto err = glGetError();
|
||||||
|
return err == GL_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::postFGExtrapolation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::disableFGExtrapolation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAPI_OpenGLCoreES::spatialUpScale(void *src, void *data, void *dst)
|
||||||
|
{
|
||||||
|
#if OHOS
|
||||||
|
struct HWSpatialSRParam
|
||||||
|
{
|
||||||
|
float sharpness;
|
||||||
|
uint32_t render_width;
|
||||||
|
uint32_t render_height;
|
||||||
};
|
};
|
||||||
|
if (data != NULL)
|
||||||
// Setup shader program to use, and the matrices
|
|
||||||
glUseProgram(m_Program);
|
|
||||||
glUniformMatrix4fv(m_UniformWorldMatrix, 1, GL_FALSE, worldMatrix);
|
|
||||||
glUniformMatrix4fv(m_UniformProjMatrix, 1, GL_FALSE, projectionMatrix);
|
|
||||||
|
|
||||||
// Core profile needs VAOs, setup one
|
|
||||||
# if SUPPORT_OPENGL_CORE
|
|
||||||
if (m_APIType == kUnityGfxRendererOpenGLCore)
|
|
||||||
{
|
{
|
||||||
glGenVertexArrays(1, &m_VertexArray);
|
HWSpatialSRParam* param = (HWSpatialSRParam*) data;
|
||||||
glBindVertexArray(m_VertexArray);
|
float m_sharpness = param->sharpness;
|
||||||
|
|
||||||
|
HMS_XEG_SpatialUpscaleParameter(XEG_SPATIAL_UPSCALE_SHARPNESS, &m_sharpness);
|
||||||
|
// upscaleScissor为超分输入图像的采样区域
|
||||||
|
int upscaleScissor[4] = {0, 0, static_cast<int>(param->render_width), static_cast<int>(param->render_height)};
|
||||||
|
HMS_XEG_SpatialUpscaleParameter(XEG_SPATIAL_UPSCALE_SCISSOR, upscaleScissor);
|
||||||
}
|
}
|
||||||
# endif // if SUPPORT_OPENGL_CORE
|
GLuint gl_srctex = (GLuint)(size_t)(src);
|
||||||
|
|
||||||
// Bind a vertex buffer, and update data in it
|
// TODO: 测试由上层设置
|
||||||
const int kVertexSize = 12 + 4;
|
// GLuint gl_dsttex = (GLuint)(size_t)(dst);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
// // upscaleFBO为用户自定义创建的framebuffer
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
|
// glBindFramebuffer(GL_FRAMEBUFFER, gl_dsttex);
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, kVertexSize * triangleCount * 3, verticesFloat3Byte4);
|
// glViewport(0, 0, upscale_width, upscale_height);
|
||||||
|
// glScissor(0, 0, upscale_width, upscale_height);
|
||||||
|
|
||||||
// Setup vertex layout
|
HMS_XEG_RenderSpatialUpscale(gl_srctex);
|
||||||
glEnableVertexAttribArray(kVertexInputPosition);
|
#endif
|
||||||
glVertexAttribPointer(kVertexInputPosition, 3, GL_FLOAT, GL_FALSE, kVertexSize, (char*)NULL + 0);
|
|
||||||
glEnableVertexAttribArray(kVertexInputColor);
|
|
||||||
glVertexAttribPointer(kVertexInputColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, kVertexSize, (char*)NULL + 12);
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, triangleCount * 3);
|
|
||||||
|
|
||||||
// Cleanup VAO
|
|
||||||
# if SUPPORT_OPENGL_CORE
|
|
||||||
if (m_APIType == kUnityGfxRendererOpenGLCore)
|
|
||||||
{
|
|
||||||
glDeleteVertexArrays(1, &m_VertexArray);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void* RenderAPI_OpenGLCoreES::BeginModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int* outRowPitch)
|
|
||||||
{
|
|
||||||
const int rowPitch = textureWidth * 4;
|
|
||||||
// Just allocate a system memory buffer here for simplicity
|
|
||||||
unsigned char* data = new unsigned char[rowPitch * textureHeight];
|
|
||||||
*outRowPitch = rowPitch;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RenderAPI_OpenGLCoreES::EndModifyTexture(void* textureHandle, int textureWidth, int textureHeight, int rowPitch, void* dataPtr)
|
|
||||||
{
|
|
||||||
GLuint gltex = (GLuint)(size_t)(textureHandle);
|
|
||||||
// Update texture data, and free the memory buffer
|
|
||||||
glBindTexture(GL_TEXTURE_2D, gltex);
|
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, GL_RGBA, GL_UNSIGNED_BYTE, dataPtr);
|
|
||||||
delete[](unsigned char*)dataPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* RenderAPI_OpenGLCoreES::BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize)
|
|
||||||
{
|
|
||||||
# if SUPPORT_OPENGL_ES
|
|
||||||
return 0;
|
|
||||||
# else
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, (GLuint)(size_t)bufferHandle);
|
|
||||||
GLint size = 0;
|
|
||||||
glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size);
|
|
||||||
*outBufferSize = size;
|
|
||||||
void* mapped = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
|
|
||||||
return mapped;
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RenderAPI_OpenGLCoreES::EndModifyVertexBuffer(void* bufferHandle)
|
|
||||||
{
|
|
||||||
# if !SUPPORT_OPENGL_ES
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, (GLuint)(size_t)bufferHandle);
|
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if SUPPORT_OPENGL_UNIFIED
|
#endif // #if SUPPORT_OPENGL_UNIFIED
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -9,62 +9,31 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// SetTimeFromUnity, an example function we export which is called by one of the scripts.
|
|
||||||
|
|
||||||
static float g_Time;
|
|
||||||
|
|
||||||
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API SetTimeFromUnity (float t) { g_Time = t; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// SetTextureFromUnity, an example function we export which is called by one of the scripts.
|
|
||||||
|
|
||||||
static void* g_TextureHandle = NULL;
|
|
||||||
static int g_TextureWidth = 0;
|
|
||||||
static int g_TextureHeight = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void* g_VertexBufferHandle = NULL;
|
|
||||||
static int g_VertexBufferVertexCount;
|
|
||||||
|
|
||||||
struct MeshVertex
|
|
||||||
{
|
|
||||||
float pos[3];
|
|
||||||
float normal[3];
|
|
||||||
float color[4];
|
|
||||||
float uv[2];
|
|
||||||
};
|
|
||||||
static std::vector<MeshVertex> g_VertexSource;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// UnitySetInterfaces
|
// UnitySetInterfaces
|
||||||
|
|
||||||
static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType);
|
static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType);
|
||||||
|
|
||||||
static IUnityInterfaces* s_UnityInterfaces = NULL;
|
static IUnityInterfaces *s_unity_interfaces = NULL;
|
||||||
static IUnityGraphics* s_Graphics = NULL;
|
static IUnityGraphics *s_graphics = NULL;
|
||||||
static IUnityLog* s_unityLogPtr = nullptr;
|
static IUnityLog *s_unity_logptr = nullptr;
|
||||||
|
|
||||||
void UnityLog(const char* msg)
|
void unityLog(const char *msg)
|
||||||
{
|
{
|
||||||
UNITY_LOG(s_unityLogPtr, msg);
|
UNITY_LOG(s_unity_logptr, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces* unityInterfaces)
|
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces *unityInterfaces)
|
||||||
{
|
{
|
||||||
s_UnityInterfaces = unityInterfaces;
|
s_unity_interfaces = unityInterfaces;
|
||||||
s_Graphics = s_UnityInterfaces->Get<IUnityGraphics>();
|
s_graphics = s_unity_interfaces->Get<IUnityGraphics>();
|
||||||
s_Graphics->RegisterDeviceEventCallback(OnGraphicsDeviceEvent);
|
s_graphics->RegisterDeviceEventCallback(OnGraphicsDeviceEvent);
|
||||||
s_unityLogPtr = s_UnityInterfaces->Get<IUnityLog>();
|
s_unity_logptr = s_unity_interfaces->Get<IUnityLog>();
|
||||||
UnityLog("UnityPluginLoad");
|
unityLog("UnityPluginLoad");
|
||||||
#if SUPPORT_VULKAN
|
#if SUPPORT_VULKAN
|
||||||
if (s_Graphics->GetRenderer() == kUnityGfxRendererNull)
|
if (s_graphics->GetRenderer() == kUnityGfxRendererNull)
|
||||||
{
|
{
|
||||||
extern void RenderAPI_Vulkan_OnPluginLoad(IUnityInterfaces*);
|
extern void RenderAPI_Vulkan_OnPluginLoad(IUnityInterfaces *);
|
||||||
RenderAPI_Vulkan_OnPluginLoad(unityInterfaces);
|
RenderAPI_Vulkan_OnPluginLoad(unityInterfaces);
|
||||||
}
|
}
|
||||||
#endif // SUPPORT_VULKAN
|
#endif // SUPPORT_VULKAN
|
||||||
@ -75,15 +44,14 @@ extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnit
|
|||||||
|
|
||||||
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload()
|
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload()
|
||||||
{
|
{
|
||||||
s_Graphics->UnregisterDeviceEventCallback(OnGraphicsDeviceEvent);
|
s_graphics->UnregisterDeviceEventCallback(OnGraphicsDeviceEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if UNITY_WEBGL
|
#if UNITY_WEBGL
|
||||||
typedef void (UNITY_INTERFACE_API * PluginLoadFunc)(IUnityInterfaces* unityInterfaces);
|
typedef void(UNITY_INTERFACE_API *PluginLoadFunc)(IUnityInterfaces *unityInterfaces);
|
||||||
typedef void (UNITY_INTERFACE_API * PluginUnloadFunc)();
|
typedef void(UNITY_INTERFACE_API *PluginUnloadFunc)();
|
||||||
|
|
||||||
extern "C" void UnityRegisterRenderingPlugin(PluginLoadFunc loadPlugin, PluginUnloadFunc unloadPlugin);
|
extern "C" void UnityRegisterRenderingPlugin(PluginLoadFunc loadPlugin, PluginUnloadFunc unloadPlugin);
|
||||||
|
|
||||||
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API RegisterPlugin()
|
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API RegisterPlugin()
|
||||||
{
|
{
|
||||||
@ -94,165 +62,74 @@ extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API RegisterPlugin()
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// GraphicsDeviceEvent
|
// GraphicsDeviceEvent
|
||||||
|
|
||||||
|
static RenderAPI *s_current_api = NULL;
|
||||||
static RenderAPI* s_CurrentAPI = NULL;
|
static UnityGfxRenderer s_device_type = kUnityGfxRendererNull;
|
||||||
static UnityGfxRenderer s_DeviceType = kUnityGfxRendererNull;
|
|
||||||
|
|
||||||
static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType)
|
static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType eventType)
|
||||||
{
|
{
|
||||||
// Create graphics API implementation upon initialization
|
// Create graphics API implementation upon initialization
|
||||||
if (eventType == kUnityGfxDeviceEventInitialize)
|
if (eventType == kUnityGfxDeviceEventInitialize)
|
||||||
{
|
{
|
||||||
assert(s_CurrentAPI == NULL);
|
assert(s_current_api == NULL);
|
||||||
s_DeviceType = s_Graphics->GetRenderer();
|
s_device_type = s_graphics->GetRenderer();
|
||||||
s_CurrentAPI = CreateRenderAPI(s_DeviceType);
|
s_current_api = createRenderAPI(s_device_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let the implementation process the device related events
|
// Let the implementation process the device related events
|
||||||
if (s_CurrentAPI)
|
if (s_current_api)
|
||||||
{
|
{
|
||||||
s_CurrentAPI->ProcessDeviceEvent(eventType, s_UnityInterfaces);
|
s_current_api->processDeviceEvent(eventType, s_unity_interfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup graphics API implementation upon shutdown
|
// Cleanup graphics API implementation upon shutdown
|
||||||
if (eventType == kUnityGfxDeviceEventShutdown)
|
if (eventType == kUnityGfxDeviceEventShutdown)
|
||||||
{
|
{
|
||||||
delete s_CurrentAPI;
|
delete s_current_api;
|
||||||
s_CurrentAPI = NULL;
|
s_current_api = NULL;
|
||||||
s_DeviceType = kUnityGfxRendererNull;
|
s_device_type = kUnityGfxRendererNull;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// OnRenderEvent
|
// OnRenderEvent
|
||||||
// This will be called for GL.IssuePluginEvent script calls; eventID will
|
// This will be called for GL.IssuePluginEvent script calls; eventID will
|
||||||
// be the integer passed to IssuePluginEvent. In this example, we just ignore
|
// be the integer passed to IssuePluginEvent. In this example, we just ignore
|
||||||
// that value.
|
// that value.
|
||||||
|
|
||||||
|
|
||||||
static void ModifyTexturePixels()
|
|
||||||
{
|
|
||||||
void* textureHandle = g_TextureHandle;
|
|
||||||
int width = g_TextureWidth;
|
|
||||||
int height = g_TextureHeight;
|
|
||||||
if (!textureHandle)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int textureRowPitch;
|
|
||||||
void* textureDataPtr = s_CurrentAPI->BeginModifyTexture(textureHandle, width, height, &textureRowPitch);
|
|
||||||
if (!textureDataPtr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const float t = g_Time * 4.0f;
|
|
||||||
|
|
||||||
unsigned char* dst = (unsigned char*)textureDataPtr;
|
|
||||||
for (int y = 0; y < height; ++y)
|
|
||||||
{
|
|
||||||
unsigned char* ptr = dst;
|
|
||||||
for (int x = 0; x < width; ++x)
|
|
||||||
{
|
|
||||||
// Simple "plasma effect": several combined sine waves
|
|
||||||
int vv = int(
|
|
||||||
(127.0f + (127.0f * sinf(x / 7.0f + t))) +
|
|
||||||
(127.0f + (127.0f * sinf(y / 5.0f - t))) +
|
|
||||||
(127.0f + (127.0f * sinf((x + y) / 6.0f - t))) +
|
|
||||||
(127.0f + (127.0f * sinf(sqrtf(float(x*x + y*y)) / 4.0f - t)))
|
|
||||||
) / 4;
|
|
||||||
|
|
||||||
// Write the texture pixel
|
|
||||||
ptr[0] = vv;
|
|
||||||
ptr[1] = vv;
|
|
||||||
ptr[2] = vv;
|
|
||||||
ptr[3] = vv;
|
|
||||||
|
|
||||||
// To next pixel (our pixels are 4 bpp)
|
|
||||||
ptr += 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
// To next image row
|
|
||||||
dst += textureRowPitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_CurrentAPI->EndModifyTexture(textureHandle, width, height, textureRowPitch, textureDataPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void ModifyVertexBuffer()
|
|
||||||
{
|
|
||||||
void* bufferHandle = g_VertexBufferHandle;
|
|
||||||
int vertexCount = g_VertexBufferVertexCount;
|
|
||||||
if (!bufferHandle)
|
|
||||||
return;
|
|
||||||
|
|
||||||
size_t bufferSize;
|
|
||||||
void* bufferDataPtr = s_CurrentAPI->BeginModifyVertexBuffer(bufferHandle, &bufferSize);
|
|
||||||
if (!bufferDataPtr)
|
|
||||||
return;
|
|
||||||
int vertexStride = int(bufferSize / vertexCount);
|
|
||||||
|
|
||||||
// Unity should return us a buffer that is the size of `vertexCount * sizeof(MeshVertex)`
|
|
||||||
// If that's not the case then we should quit to avoid unexpected results.
|
|
||||||
// This can happen if https://docs.unity3d.com/ScriptReference/Mesh.GetNativeVertexBufferPtr.html returns
|
|
||||||
// a pointer to a buffer with an unexpected layout.
|
|
||||||
if (static_cast<unsigned int>(vertexStride) != sizeof(MeshVertex))
|
|
||||||
return;
|
|
||||||
|
|
||||||
const float t = g_Time * 3.0f;
|
|
||||||
|
|
||||||
char* bufferPtr = (char*)bufferDataPtr;
|
|
||||||
// modify vertex Y position with several scrolling sine waves,
|
|
||||||
// copy the rest of the source data unmodified
|
|
||||||
for (int i = 0; i < vertexCount; ++i)
|
|
||||||
{
|
|
||||||
const MeshVertex& src = g_VertexSource[i];
|
|
||||||
MeshVertex& dst = *(MeshVertex*)bufferPtr;
|
|
||||||
dst.pos[0] = src.pos[0];
|
|
||||||
dst.pos[1] = src.pos[1] + sinf(src.pos[0] * 1.1f + t) * 0.4f + sinf(src.pos[2] * 0.9f - t) * 0.3f;
|
|
||||||
dst.pos[2] = src.pos[2];
|
|
||||||
dst.normal[0] = src.normal[0];
|
|
||||||
dst.normal[1] = src.normal[1];
|
|
||||||
dst.normal[2] = src.normal[2];
|
|
||||||
dst.uv[0] = src.uv[0];
|
|
||||||
dst.uv[1] = src.uv[1];
|
|
||||||
bufferPtr += vertexStride;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_CurrentAPI->EndModifyVertexBuffer(bufferHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void drawToPluginTexture()
|
|
||||||
{
|
|
||||||
s_CurrentAPI->drawToPluginTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void drawToRenderTexture()
|
|
||||||
{
|
|
||||||
s_CurrentAPI->drawToRenderTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
enum NativeRenderingEvent
|
enum NativeRenderingEvent
|
||||||
{
|
{
|
||||||
EnableVRS = 1,
|
EnableVRS = 1,
|
||||||
DisableVRS,
|
DisableVRS,
|
||||||
|
// EnableFGExtrapolation,
|
||||||
|
// PreFGExtrapolation,
|
||||||
|
DoFGExtrapolation,
|
||||||
|
// PostFGExtrapolation,
|
||||||
|
// DisableFGExtrapolation,
|
||||||
|
// SpatialUpScale,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void UNITY_INTERFACE_API OnRenderEventAndData(int eventID, void* data)
|
static void UNITY_INTERFACE_API OnRenderEventAndData(int eventID, void *data)
|
||||||
{
|
{
|
||||||
// Unknown / unsupported graphics device type? Do nothing
|
// Unknown / unsupported graphics device type? Do nothing
|
||||||
if (s_CurrentAPI == NULL)
|
if (s_current_api == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch ((NativeRenderingEvent)eventID)
|
switch ((NativeRenderingEvent)eventID)
|
||||||
{
|
{
|
||||||
case NativeRenderingEvent::EnableVRS:
|
case NativeRenderingEvent::EnableVRS:
|
||||||
{
|
{
|
||||||
s_CurrentAPI->enableVRS(*(int*)data);
|
s_current_api->enableVRS(*(int *)data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NativeRenderingEvent::DisableVRS:
|
case NativeRenderingEvent::DisableVRS:
|
||||||
{
|
{
|
||||||
s_CurrentAPI->disableVRS();
|
s_current_api->disableVRS();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case NativeRenderingEvent::DoFGExtrapolation:
|
||||||
|
{
|
||||||
|
AFMEParam* param = (AFMEParam*)data;
|
||||||
|
s_current_api->doFGExtrapolation(param->src, param->data, param->dst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -265,41 +142,49 @@ extern "C" UnityRenderingEventAndData UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API
|
|||||||
return OnRenderEventAndData;
|
return OnRenderEventAndData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" UNITY_INTERFACE_EXPORT bool GetFeatureSupport(int feature)
|
||||||
|
{
|
||||||
|
if (s_current_api == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return s_current_api->getFeatureSupport((GraphicsFeature)feature);
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// DX12 plugin specific
|
// DX12 plugin specific
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT void* UNITY_INTERFACE_API GetRenderTexture()
|
extern "C" UNITY_INTERFACE_EXPORT void *UNITY_INTERFACE_API GetRenderTexture()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->getRenderTexture();
|
return s_current_api->getRenderTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API SetRenderTexture(UnityRenderBuffer rb)
|
extern "C" UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API SetRenderTexture(UnityRenderBuffer rb)
|
||||||
{
|
{
|
||||||
s_CurrentAPI->setRenderTextureResource(rb);
|
s_current_api->setRenderTextureResource(rb);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT bool UNITY_INTERFACE_API IsSwapChainAvailable()
|
extern "C" UNITY_INTERFACE_EXPORT bool UNITY_INTERFACE_API IsSwapChainAvailable()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->isSwapChainAvailable();
|
return s_current_api->isSwapChainAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetPresentFlags()
|
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetPresentFlags()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->getPresentFlags();
|
return s_current_api->getPresentFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetSyncInterval()
|
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetSyncInterval()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->getSyncInterval();
|
return s_current_api->getSyncInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetBackBufferWidth()
|
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetBackBufferWidth()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->getBackbufferHeight();
|
return s_current_api->getBackbufferHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetBackBufferHeight()
|
extern "C" UNITY_INTERFACE_EXPORT unsigned int UNITY_INTERFACE_API GetBackBufferHeight()
|
||||||
{
|
{
|
||||||
return s_CurrentAPI->getBackbufferWidth();
|
return s_current_api->getBackbufferWidth();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY)
|
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY)
|
||||||
#define UNITY_INTERFACE_API __stdcall
|
#define UNITY_INTERFACE_API __stdcall
|
||||||
#define UNITY_INTERFACE_EXPORT __declspec(dllexport)
|
#define UNITY_INTERFACE_EXPORT __declspec(dllexport)
|
||||||
#elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(LUMIN)
|
#elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(OHOS) || defined(LUMIN)
|
||||||
#define UNITY_INTERFACE_API
|
#define UNITY_INTERFACE_API
|
||||||
#define UNITY_INTERFACE_EXPORT __attribute__ ((visibility ("default")))
|
#define UNITY_INTERFACE_EXPORT __attribute__ ((visibility ("default")))
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "IUnityGraphics.h"
|
#include "IUnityGraphics.h"
|
||||||
|
#include "stdint.h"
|
||||||
/*
|
/*
|
||||||
Low-level Native Plugin Rendering Extensions
|
Low-level Native Plugin Rendering Extensions
|
||||||
============================================
|
============================================
|
||||||
|
|||||||
@ -7,7 +7,6 @@ if (is_plat("windows")) then
|
|||||||
add_cxflags("/EHsc")
|
add_cxflags("/EHsc")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
option("use_vulkan")
|
option("use_vulkan")
|
||||||
set_showmenu(true)
|
set_showmenu(true)
|
||||||
set_default(false)
|
set_default(false)
|
||||||
@ -18,34 +17,118 @@ option("use_metal")
|
|||||||
|
|
||||||
option("use_gles")
|
option("use_gles")
|
||||||
set_default(false)
|
set_default(false)
|
||||||
|
option_end()
|
||||||
|
|
||||||
target("NativeRenderPlugin")
|
target("GfxPluginNativeRender")
|
||||||
|
|
||||||
add_includedirs("./gl3w")
|
add_includedirs("./gl3w")
|
||||||
add_includedirs("./Unity")
|
add_includedirs("./Unity")
|
||||||
add_includedirs("C:/VulkanSDK/1.3.283.0/Include")
|
|
||||||
|
|
||||||
add_headerfiles("./PlatformBase.h")
|
add_headerfiles("./*.h")
|
||||||
|
|
||||||
-- add_linkdirs("C:/VulkanSDK/1.3.283.0/Lib")
|
if is_plat("windows") then
|
||||||
|
add_includedirs("C:/VulkanSDK/1.3.283.0/Include")
|
||||||
|
add_linkdirs("C:/VulkanSDK/1.3.283.0/Lib")
|
||||||
|
end
|
||||||
|
|
||||||
if has_config("use_vulkan") then
|
if has_config("use_vulkan") then
|
||||||
set_kind("shared")
|
set_kind("shared")
|
||||||
add_defines("SUPPORT_VULKAN=1")
|
add_defines("SUPPORT_VULKAN=1")
|
||||||
|
-- add_links("EGL")
|
||||||
-- add_links("vulkan-1")
|
if is_plat("windows") then
|
||||||
elseif has_config("use_metal") then
|
add_links("vulkan-1")
|
||||||
|
else
|
||||||
|
add_links("vulkan")
|
||||||
|
end
|
||||||
|
if is_plat("android") then
|
||||||
|
local target = "aarch64-linux-android31"
|
||||||
|
add_cxflags("--target=" .. target)
|
||||||
|
add_asflags("--target=" .. target)
|
||||||
|
add_ldflags("--target=" .. target)
|
||||||
|
add_shflags("--target=" .. target)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if has_config("use_metal") then
|
||||||
set_kind("static")
|
set_kind("static")
|
||||||
add_defines("SUPPORT_METAL=1")
|
add_defines("SUPPORT_METAL=1")
|
||||||
|
add_defines("TARGET_OS_IOS=1")
|
||||||
|
|
||||||
add_files("./*.mm")
|
add_files("./*.mm")
|
||||||
elseif has_config("use_gles") then
|
add_frameworks("MetalFX.framework")
|
||||||
|
end
|
||||||
|
if has_config("use_gles") then
|
||||||
set_kind("shared")
|
set_kind("shared")
|
||||||
add_defines("SUPPORT_OPENGL_UNIFIED=1")
|
add_defines("SUPPORT_OPENGL_UNIFIED=1")
|
||||||
add_defines("SUPPORT_OPENGL_ES=1")
|
add_defines("SUPPORT_OPENGL_ES=1")
|
||||||
|
|
||||||
add_links("GLESv2")
|
if not is_plat("windows") then
|
||||||
|
add_links("EGL")
|
||||||
|
add_links("GLESv3")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_plat("harmonyos") then
|
||||||
|
add_links("xengine")
|
||||||
|
add_defines("OHOS=1")
|
||||||
end
|
end
|
||||||
|
|
||||||
add_files("./*.cpp")
|
add_files("./*.cpp")
|
||||||
|
|
||||||
target_end()
|
target_end()
|
||||||
|
|
||||||
|
|
||||||
|
-- xmake f --ndk=E:/NDK -a arm64-v8a -p android --use_gles=true --use_vulkan=true --vs=2022 -m debug
|
||||||
|
-- xmake f --toolchain=ohndk -p harmonyos -a aarch64 --use_gles=true --vs=2022 -m debug
|
||||||
|
toolchain("ohndk")
|
||||||
|
-- mark as standalone toolchain
|
||||||
|
set_kind("standalone")
|
||||||
|
set_bindir("C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/llvm/bin")
|
||||||
|
|
||||||
|
-- set toolset
|
||||||
|
set_toolset("cc", "clang")
|
||||||
|
set_toolset("cxx", "clang", "clang++")
|
||||||
|
set_toolset("ld", "clang++", "clang")
|
||||||
|
set_toolset("sh", "clang++", "clang")
|
||||||
|
set_toolset("ar", "llvm-ar")
|
||||||
|
set_toolset("ex", "llvm-ar")
|
||||||
|
set_toolset("strip", "llvm-strip")
|
||||||
|
set_toolset("mm", "llvm-mm")
|
||||||
|
set_toolset("mxx", "clang", "clang++")
|
||||||
|
set_toolset("as", "llvm-as")
|
||||||
|
|
||||||
|
add_defines("MYCLANG")
|
||||||
|
add_defines("OHOS_STL=c++_shared")
|
||||||
|
|
||||||
|
on_check(function (toolchain)
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
-- on load
|
||||||
|
on_load(function (toolchain)
|
||||||
|
-- init cxflags for the target kind: binary
|
||||||
|
toolchain:add("binary.cxflags", "-fPIE", "-pie")
|
||||||
|
|
||||||
|
-- add "-fPIE -pie" to ldflags
|
||||||
|
toolchain:add("ldflags", "-fPIE")
|
||||||
|
toolchain:add("ldflags", "-pie")
|
||||||
|
|
||||||
|
-- add some builtin flags
|
||||||
|
toolchain:add("cxflags", "-D__MUSL__")
|
||||||
|
|
||||||
|
local target = "aarch64-linux-ohos"
|
||||||
|
toolchain:add("cxflags", "--target=" .. target)
|
||||||
|
toolchain:add("asflags", "--target=" .. target)
|
||||||
|
toolchain:add("ldflags", "--target=" .. target)
|
||||||
|
toolchain:add("shflags", "--target=" .. target)
|
||||||
|
|
||||||
|
local sysroot = "C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot"
|
||||||
|
toolchain:add("cxflags", "--sysroot=" .. sysroot)
|
||||||
|
toolchain:add("asflags", "--sysroot=" .. sysroot)
|
||||||
|
toolchain:add("ldflags", "--sysroot=" .. sysroot)
|
||||||
|
toolchain:add("shflags", "--sysroot=" .. sysroot)
|
||||||
|
|
||||||
|
-- toolchain:add("includedirs", "C:/Program Files/Huawei/DevEco Studio/sdk/default/openharmony/native/sysroot/usr/include")
|
||||||
|
|
||||||
|
toolchain:add("includedirs", "C:/Program Files/Huawei/DevEco Studio/sdk/default/hms/native/sysroot/usr/include")
|
||||||
|
toolchain:add("linkdirs", "C:/Program Files/Huawei/DevEco Studio/sdk/default/hms/native/sysroot/usr/lib/aarch64-linux-ohos")
|
||||||
|
end)
|
||||||
|
toolchain_end()
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ namespace UnityEditor.Rendering.Universal
|
|||||||
|
|
||||||
private SerializedProperty superResolution;
|
private SerializedProperty superResolution;
|
||||||
private SerializedProperty ssRenderScale;
|
private SerializedProperty ssRenderScale;
|
||||||
|
private SerializedProperty vrsRate;
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI()
|
||||||
{
|
{
|
||||||
@ -29,6 +30,7 @@ namespace UnityEditor.Rendering.Universal
|
|||||||
UniversalRenderPipelineAssetUI.Inspector.Draw(m_SerializedURPAsset, this);
|
UniversalRenderPipelineAssetUI.Inspector.Draw(m_SerializedURPAsset, this);
|
||||||
EditorGUILayout.PropertyField(superResolution, new GUIContent("超分"));
|
EditorGUILayout.PropertyField(superResolution, new GUIContent("超分"));
|
||||||
EditorGUILayout.PropertyField(ssRenderScale, new GUIContent("超分比例"));
|
EditorGUILayout.PropertyField(ssRenderScale, new GUIContent("超分比例"));
|
||||||
|
EditorGUILayout.PropertyField(vrsRate, new GUIContent("VRS Rate"));
|
||||||
m_SerializedURPAsset.Apply();
|
m_SerializedURPAsset.Apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +39,7 @@ namespace UnityEditor.Rendering.Universal
|
|||||||
m_SerializedURPAsset = new SerializedUniversalRenderPipelineAsset(serializedObject);
|
m_SerializedURPAsset = new SerializedUniversalRenderPipelineAsset(serializedObject);
|
||||||
superResolution = serializedObject.FindProperty("superResolution");
|
superResolution = serializedObject.FindProperty("superResolution");
|
||||||
ssRenderScale = serializedObject.FindProperty("sSRenderScale");
|
ssRenderScale = serializedObject.FindProperty("sSRenderScale");
|
||||||
|
vrsRate = serializedObject.FindProperty("vrsRate");
|
||||||
CreateRendererReorderableList();
|
CreateRendererReorderableList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using UnityEngine.Experimental.Rendering;
|
using UnityEngine.Experimental.Rendering;
|
||||||
using UnityEngine.Experimental.Rendering.RenderGraphModule;
|
using UnityEngine.Experimental.Rendering.RenderGraphModule;
|
||||||
using UnityEngine.Profiling;
|
using UnityEngine.Profiling;
|
||||||
|
using X.Rendering.Feature;
|
||||||
|
|
||||||
namespace UnityEngine.Rendering.Universal.Internal
|
namespace UnityEngine.Rendering.Universal.Internal
|
||||||
{
|
{
|
||||||
@ -170,7 +172,9 @@ namespace UnityEngine.Rendering.Universal.Internal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ExecutePass(ScriptableRenderContext context, PassData data, ref RenderingData renderingData, bool yFlip)
|
static IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf<int>());
|
||||||
|
|
||||||
|
private static unsafe void ExecutePass(ScriptableRenderContext context, PassData data, ref RenderingData renderingData, bool yFlip)
|
||||||
{
|
{
|
||||||
var cmd = renderingData.commandBuffer;
|
var cmd = renderingData.commandBuffer;
|
||||||
using (new ProfilingScope(cmd, data.m_ProfilingSampler))
|
using (new ProfilingScope(cmd, data.m_ProfilingSampler))
|
||||||
@ -237,8 +241,22 @@ namespace UnityEngine.Rendering.Universal.Internal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var asset = UniversalRenderPipeline.asset;
|
||||||
|
if(asset.VRSRate != RenderingPlugin.VRSPluginShadingRate.X1_PER_PIXEL)
|
||||||
|
{
|
||||||
|
*(int*)p.ToPointer() = (int)asset.VRSRate;
|
||||||
|
cmd.IssuePluginEventAndData(RenderingPlugin.GetRenderEventAndDataFunc(), (int)RenderingPlugin.NativeRenderingEvent.EnableVRS, p);
|
||||||
|
context.ExecuteCommandBuffer(cmd);
|
||||||
|
cmd.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filterSettings, ref data.m_RenderStateBlock);
|
context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filterSettings, ref data.m_RenderStateBlock);
|
||||||
|
|
||||||
|
if(asset.VRSRate != RenderingPlugin.VRSPluginShadingRate.X1_PER_PIXEL)
|
||||||
|
{
|
||||||
|
cmd.IssuePluginEventAndData(RenderingPlugin.GetRenderEventAndDataFunc(), (int)RenderingPlugin.NativeRenderingEvent.DisableVRS, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
// Render objects that did not match any shader pass with error shader
|
// Render objects that did not match any shader pass with error shader
|
||||||
RenderingUtils.RenderObjectsWithError(context, ref renderingData.cullResults, camera, filterSettings, SortingCriteria.None);
|
RenderingUtils.RenderObjectsWithError(context, ref renderingData.cullResults, camera, filterSettings, SortingCriteria.None);
|
||||||
}
|
}
|
||||||
@ -250,6 +268,7 @@ namespace UnityEngine.Rendering.Universal.Internal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class PassData
|
private class PassData
|
||||||
{
|
{
|
||||||
internal TextureHandle m_Albedo;
|
internal TextureHandle m_Albedo;
|
||||||
|
|||||||
@ -2,6 +2,8 @@ using System.Collections.Generic;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using UnityEngine.Experimental.Rendering;
|
using UnityEngine.Experimental.Rendering;
|
||||||
using X.Rendering.Feature;
|
using X.Rendering.Feature;
|
||||||
|
using static Unity.Burst.Intrinsics.X86.Avx;
|
||||||
|
using static UnityEngine.Rendering.Universal.UniversalRenderPipeline.Profiling.Pipeline;
|
||||||
|
|
||||||
namespace UnityEngine.Rendering.Universal
|
namespace UnityEngine.Rendering.Universal
|
||||||
{
|
{
|
||||||
@ -500,7 +502,8 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
colorDescriptor.width = cameraData.camera.pixelWidth;
|
colorDescriptor.width = cameraData.camera.pixelWidth;
|
||||||
colorDescriptor.height = cameraData.camera.pixelHeight;
|
colorDescriptor.height = cameraData.camera.pixelHeight;
|
||||||
|
|
||||||
colorDescriptor.enableRandomWrite = true;
|
//colorDescriptor.graphicsFormat = GraphicsFormat.R16G16B16A16_SFloat;
|
||||||
|
//colorDescriptor.enableRandomWrite = true; // compute
|
||||||
|
|
||||||
renderer.m_ColorBufferSystem.SetCameraSettings(colorDescriptor, FilterMode.Bilinear);
|
renderer.m_ColorBufferSystem.SetCameraSettings(colorDescriptor, FilterMode.Bilinear);
|
||||||
|
|
||||||
@ -645,6 +648,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
renderer.EnableSwapBufferMSAA(true);
|
renderer.EnableSwapBufferMSAA(true);
|
||||||
destination = renderer.GetCameraColorFrontBuffer(cmd);
|
destination = renderer.GetCameraColorFrontBuffer(cmd);
|
||||||
}
|
}
|
||||||
|
FG.RecordFrame(GetSource(), cmd);
|
||||||
Blitter.BlitCameraTexture(cmd, GetSource(), destination, colorLoadAction, RenderBufferStoreAction.Store, m_Materials.uber, 0);
|
Blitter.BlitCameraTexture(cmd, GetSource(), destination, colorLoadAction, RenderBufferStoreAction.Store, m_Materials.uber, 0);
|
||||||
renderer.ConfigureCameraColorTarget(destination);
|
renderer.ConfigureCameraColorTarget(destination);
|
||||||
Swap(renderer);
|
Swap(renderer);
|
||||||
@ -673,14 +677,22 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
RenderTargetIdentifier cameraTarget = cameraData.targetTexture != null ? new RenderTargetIdentifier(cameraData.targetTexture) : cameraTargetID;
|
RenderTargetIdentifier cameraTarget = cameraData.targetTexture != null ? new RenderTargetIdentifier(cameraData.targetTexture) : cameraTargetID;
|
||||||
RTHandleStaticHelpers.SetRTHandleStaticWrapper(cameraTarget);
|
RTHandleStaticHelpers.SetRTHandleStaticWrapper(cameraTarget);
|
||||||
var cameraTargetHandle = RTHandleStaticHelpers.s_RTHandleWrapper;
|
var cameraTargetHandle = RTHandleStaticHelpers.s_RTHandleWrapper;
|
||||||
|
FG.RecordFrame(GetSource(), cmd);
|
||||||
RenderingUtils.FinalBlit(cmd, ref cameraData, GetSource(), cameraTargetHandle, colorLoadAction, RenderBufferStoreAction.Store, m_Materials.uber, 0);
|
RenderingUtils.FinalBlit(cmd, ref cameraData, GetSource(), cameraTargetHandle, colorLoadAction, RenderBufferStoreAction.Store, m_Materials.uber, 0);
|
||||||
renderer.ConfigureCameraColorTarget(cameraTargetHandle);
|
renderer.ConfigureCameraColorTarget(cameraTargetHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void Present(CommandBuffer cmd, ref CameraData cameraData, RTHandle rt)
|
||||||
|
{
|
||||||
|
RenderTargetIdentifier cameraTargetID = BuiltinRenderTextureType.CameraTarget;
|
||||||
|
RenderTargetIdentifier cameraTarget = cameraData.targetTexture != null ? new RenderTargetIdentifier(cameraData.targetTexture) : cameraTargetID;
|
||||||
|
RTHandleStaticHelpers.SetRTHandleStaticWrapper(cameraTarget);
|
||||||
|
var cameraTargetHandle = RTHandleStaticHelpers.s_RTHandleWrapper;
|
||||||
|
RenderingUtils.FinalBlit(cmd, ref cameraData, rt, cameraTargetHandle, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, m_Materials.uber, 0);
|
||||||
}
|
}
|
||||||
#region Sub-pixel Morphological Anti-aliasing
|
#region Sub-pixel Morphological Anti-aliasing
|
||||||
|
|
||||||
|
|||||||
@ -4,24 +4,39 @@ namespace X.Rendering.Feature
|
|||||||
{
|
{
|
||||||
public static class RenderingPlugin
|
public static class RenderingPlugin
|
||||||
{
|
{
|
||||||
//#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
||||||
// [DllImport("__Internal")]
|
[DllImport("__Internal")]
|
||||||
//#else
|
#else
|
||||||
// [DllImport("NativeRenderPlugin")]
|
[DllImport("GfxPluginNativeRender")]
|
||||||
//#endif
|
#endif
|
||||||
// public static extern void SetTimeFromUnity(float t);
|
public static extern void SetTimeFromUnity(float t);
|
||||||
|
|
||||||
//#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
||||||
// [DllImport("__Internal")]
|
[DllImport("__Internal")]
|
||||||
//#else
|
#else
|
||||||
// [DllImport("NativeRenderPlugin")]
|
[DllImport("GfxPluginNativeRender")]
|
||||||
//#endif
|
#endif
|
||||||
// public static extern IntPtr GetRenderEventAndDataFunc();
|
public static extern IntPtr GetRenderEventAndDataFunc();
|
||||||
|
|
||||||
|
#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
||||||
|
[DllImport("__Internal")]
|
||||||
|
#else
|
||||||
|
[DllImport("GfxPluginNativeRender")]
|
||||||
|
#endif
|
||||||
|
private static extern bool GetFeatureSupport(int feature);
|
||||||
|
|
||||||
|
//#if (PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_BRATWURST || PLATFORM_SWITCH) && !UNITY_EDITOR
|
||||||
|
// [DllImport("__Internal")]
|
||||||
|
//#else
|
||||||
|
// [DllImport("GfxPluginNativeRender")]
|
||||||
|
//#endif
|
||||||
|
// public static extern bool DoFGExtrapolation(IntPtr src, IntPtr data, IntPtr dst);
|
||||||
|
|
||||||
public enum NativeRenderingEvent
|
public enum NativeRenderingEvent
|
||||||
{
|
{
|
||||||
EnableVRS = 1,
|
EnableVRS = 1,
|
||||||
DisableVRS,
|
DisableVRS,
|
||||||
|
DoFGExtrapolation,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum VRSPluginShadingRate
|
public enum VRSPluginShadingRate
|
||||||
@ -34,5 +49,28 @@ namespace X.Rendering.Feature
|
|||||||
X1_PER_2X4_PIXELS,
|
X1_PER_2X4_PIXELS,
|
||||||
X1_PER_4X4_PIXELS,
|
X1_PER_4X4_PIXELS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public enum GraphicsFeature
|
||||||
|
{
|
||||||
|
VRS_DRAW = 0,
|
||||||
|
VRS_PRIMITIVE,
|
||||||
|
VRS_ATTACHMENT,
|
||||||
|
HW_SPATIAL_SR,
|
||||||
|
HW_AISR,
|
||||||
|
HW_ADAPTIVE_VRS,
|
||||||
|
HW_FG_INTERPOLATE,
|
||||||
|
HW_FG_EXTRAPOLATION,
|
||||||
|
METAL_FX_SPATIAL_SR,
|
||||||
|
METAL_FX_TEMPORAL_SR,
|
||||||
|
VIVO_TEMPORAL_SR,
|
||||||
|
QCOM_AFME,
|
||||||
|
MAX_CNT
|
||||||
|
};
|
||||||
|
|
||||||
|
public static bool GetFeatureSupport(GraphicsFeature feature)
|
||||||
|
{
|
||||||
|
return GetFeatureSupport((int)feature);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,11 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
namespace X.Rendering.Feature
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// only gles32 QCOM_frame_extrapolation
|
|
||||||
/// </summary>
|
|
||||||
public class AFME : MonoBehaviour
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
75
Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SF/FG.cs
vendored
Normal file
75
Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SF/FG.cs
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
using UnityEngine.Rendering.Universal;
|
||||||
|
namespace X.Rendering.Feature
|
||||||
|
{
|
||||||
|
public enum EFrameGeneration
|
||||||
|
{
|
||||||
|
AFME,// Adaptive Frame Motion Extrapolation GL_QCOM_frame_extrapolation
|
||||||
|
HW_INTERPOLATE,// 华为 Graphics Accelerate Kit 内插值
|
||||||
|
HW_EXTRAPOLATION,// 华为 Graphics Accelerate Kit 外插值
|
||||||
|
//VGS,// vivo
|
||||||
|
FSR2,
|
||||||
|
FSR3,
|
||||||
|
}
|
||||||
|
|
||||||
|
public unsafe class FG
|
||||||
|
{
|
||||||
|
static int frameIndex = 0;
|
||||||
|
static RTHandle[] historys = new RTHandle[2];
|
||||||
|
static RTHandle presentRt;
|
||||||
|
static bool presented = false;
|
||||||
|
public static bool UseFG = true;
|
||||||
|
|
||||||
|
public static bool CanDoFG => frameIndex > 0 && frameIndex % 3 == 0 && !presented && UseFG;
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
struct AFMEParam
|
||||||
|
{
|
||||||
|
public IntPtr src;
|
||||||
|
public IntPtr data;
|
||||||
|
public IntPtr dst;
|
||||||
|
}
|
||||||
|
static IntPtr data = Marshal.AllocHGlobal(sizeof(AFMEParam));
|
||||||
|
|
||||||
|
public static bool FrameGenearte(ScriptableRenderContext context, CommandBuffer cmd, out RTHandle dst)
|
||||||
|
{
|
||||||
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
|
Debug.Log("FrameGenearte" + frameIndex);
|
||||||
|
dst = presentRt;
|
||||||
|
var history1 = historys[frameIndex % 2];
|
||||||
|
var history2 = historys[frameIndex % 2 == 1 ? 0 : 1];
|
||||||
|
AFMEParam* p = (AFMEParam*)data.ToPointer();
|
||||||
|
p->src = history1.rt.GetNativeTexturePtr();
|
||||||
|
p->data = history2.rt.GetNativeTexturePtr();
|
||||||
|
p->dst = dst.rt.GetNativeTexturePtr();
|
||||||
|
cmd.IssuePluginEventAndData(RenderingPlugin.GetRenderEventAndDataFunc(), (int)RenderingPlugin.NativeRenderingEvent.DoFGExtrapolation, data);
|
||||||
|
context.ExecuteCommandBuffer(cmd);
|
||||||
|
cmd.Clear();
|
||||||
|
presented = true;
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
dst = null;
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RecordFrame(RTHandle source, CommandBuffer cmd)
|
||||||
|
{
|
||||||
|
presented = false;
|
||||||
|
var index = frameIndex++ % 2;
|
||||||
|
var desc = source.rt.descriptor;
|
||||||
|
desc.graphicsFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.R8G8B8A8_UNorm;
|
||||||
|
desc.depthBufferBits = 0;
|
||||||
|
RenderingUtils.ReAllocateIfNeeded(ref historys[0], desc);
|
||||||
|
|
||||||
|
RenderingUtils.ReAllocateIfNeeded(ref historys[1], desc);
|
||||||
|
|
||||||
|
RenderingUtils.ReAllocateIfNeeded(ref presentRt, desc);
|
||||||
|
var history = historys[index];
|
||||||
|
cmd.Blit(source, history);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Rendering.Universal;
|
|
||||||
using UnityEngine.Rendering;
|
using UnityEngine.Rendering;
|
||||||
|
using UnityEngine.Rendering.Universal;
|
||||||
|
|
||||||
namespace X.Rendering.Feature
|
namespace X.Rendering.Feature
|
||||||
{
|
{
|
||||||
public enum ESuperResolution
|
public enum ESuperResolution
|
||||||
@ -15,6 +18,7 @@ namespace X.Rendering.Feature
|
|||||||
HW_SPATIAL_SR, // 华为空域超分
|
HW_SPATIAL_SR, // 华为空域超分
|
||||||
HW_AISR, // 华为AI空域超分
|
HW_AISR, // 华为AI空域超分
|
||||||
METAL_FX_SPATIAL_SR, // 苹果空域超分
|
METAL_FX_SPATIAL_SR, // 苹果空域超分
|
||||||
|
VSR, // vivo v-sr
|
||||||
DLSS1,
|
DLSS1,
|
||||||
DLSS2,
|
DLSS2,
|
||||||
DLSS3,
|
DLSS3,
|
||||||
@ -36,6 +40,14 @@ namespace X.Rendering.Feature
|
|||||||
Factor05,
|
Factor05,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
struct HWSpatialSRParam
|
||||||
|
{
|
||||||
|
float sharpness;
|
||||||
|
Int32 render_width;
|
||||||
|
Int32 render_height;
|
||||||
|
};
|
||||||
|
|
||||||
public interface ISuperResolutionFeature
|
public interface ISuperResolutionFeature
|
||||||
{
|
{
|
||||||
public void SetSR(ESuperResolution resolution);
|
public void SetSR(ESuperResolution resolution);
|
||||||
|
|||||||
@ -13,6 +13,11 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
|
|
||||||
public ESuperResolution SuperResolution => superResolution;
|
public ESuperResolution SuperResolution => superResolution;
|
||||||
|
|
||||||
|
public RenderingPlugin.VRSPluginShadingRate VRSRate { get => vrsRate; set => vrsRate = value; }
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private RenderingPlugin.VRSPluginShadingRate vrsRate;
|
||||||
|
|
||||||
private void UpdateSSSettings()
|
private void UpdateSSSettings()
|
||||||
{
|
{
|
||||||
var renderer = GetRenderer(this.m_DefaultRendererIndex);
|
var renderer = GetRenderer(this.m_DefaultRendererIndex);
|
||||||
|
|||||||
@ -51,8 +51,8 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
{
|
{
|
||||||
// TODO: Would be better to add Profiling name hooks into RenderPipeline.cs, requires changes outside of Universal.
|
// TODO: Would be better to add Profiling name hooks into RenderPipeline.cs, requires changes outside of Universal.
|
||||||
#if UNITY_2021_1_OR_NEWER
|
#if UNITY_2021_1_OR_NEWER
|
||||||
public static readonly ProfilingSampler beginContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginContextRendering)}");
|
public static readonly ProfilingSampler beginContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginContextRendering)}");
|
||||||
public static readonly ProfilingSampler endContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndContextRendering)}");
|
public static readonly ProfilingSampler endContextRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndContextRendering)}");
|
||||||
#else
|
#else
|
||||||
public static readonly ProfilingSampler beginFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginFrameRendering)}");
|
public static readonly ProfilingSampler beginFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(BeginFrameRendering)}");
|
||||||
public static readonly ProfilingSampler endFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndFrameRendering)}");
|
public static readonly ProfilingSampler endFrameRendering = new ProfilingSampler($"{nameof(RenderPipeline)}.{nameof(EndFrameRendering)}");
|
||||||
@ -348,7 +348,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
if (m_GlobalSettings == null || UniversalRenderPipelineGlobalSettings.instance == null)
|
if (m_GlobalSettings == null || UniversalRenderPipelineGlobalSettings.instance == null)
|
||||||
{
|
{
|
||||||
m_GlobalSettings = UniversalRenderPipelineGlobalSettings.Ensure();
|
m_GlobalSettings = UniversalRenderPipelineGlobalSettings.Ensure();
|
||||||
if(m_GlobalSettings == null) return;
|
if (m_GlobalSettings == null) return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
StandardRequest standardRequest = renderRequest as StandardRequest;
|
StandardRequest standardRequest = renderRequest as StandardRequest;
|
||||||
SingleCameraRequest singleRequest = renderRequest as SingleCameraRequest;
|
SingleCameraRequest singleRequest = renderRequest as SingleCameraRequest;
|
||||||
|
|
||||||
if(standardRequest != null || singleRequest != null)
|
if (standardRequest != null || singleRequest != null)
|
||||||
{
|
{
|
||||||
RenderTexture destination = standardRequest != null ? standardRequest.destination : singleRequest.destination;
|
RenderTexture destination = standardRequest != null ? standardRequest.destination : singleRequest.destination;
|
||||||
int mipLevel = standardRequest != null ? standardRequest.mipLevel : singleRequest.mipLevel;
|
int mipLevel = standardRequest != null ? standardRequest.mipLevel : singleRequest.mipLevel;
|
||||||
@ -473,7 +473,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
RTDesc.height = Mathf.Max(1, RTDesc.height);
|
RTDesc.height = Mathf.Max(1, RTDesc.height);
|
||||||
|
|
||||||
//if mip is 0 and target is Texture2D we can immediately render to the requested destination
|
//if mip is 0 and target is Texture2D we can immediately render to the requested destination
|
||||||
if(destination.dimension != TextureDimension.Tex2D || mipLevel != 0)
|
if (destination.dimension != TextureDimension.Tex2D || mipLevel != 0)
|
||||||
{
|
{
|
||||||
temporaryRT = RenderTexture.GetTemporary(RTDesc);
|
temporaryRT = RenderTexture.GetTemporary(RTDesc);
|
||||||
}
|
}
|
||||||
@ -516,9 +516,9 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(temporaryRT)
|
if (temporaryRT)
|
||||||
{
|
{
|
||||||
switch(destination.dimension)
|
switch (destination.dimension)
|
||||||
{
|
{
|
||||||
case TextureDimension.Tex2D:
|
case TextureDimension.Tex2D:
|
||||||
case TextureDimension.Tex2DArray:
|
case TextureDimension.Tex2DArray:
|
||||||
@ -539,7 +539,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("The given RenderRequest type: " + typeof(RequestData).FullName + ", is either invalid or unsupported by the current pipeline");
|
Debug.LogWarning("The given RenderRequest type: " + typeof(RequestData).FullName + ", is either invalid or unsupported by the current pipeline");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,66 +636,74 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
ProfilingSampler sampler = Profiling.TryGetOrAddCameraSampler(camera);
|
ProfilingSampler sampler = Profiling.TryGetOrAddCameraSampler(camera);
|
||||||
using (new ProfilingScope(cmdScope, sampler)) // Enqueues a "BeginSample" command into the CommandBuffer cmd
|
using (new ProfilingScope(cmdScope, sampler)) // Enqueues a "BeginSample" command into the CommandBuffer cmd
|
||||||
{
|
{
|
||||||
renderer.Clear(cameraData.renderType);
|
if (camera.cameraType == CameraType.Game && X.Rendering.Feature.FG.CanDoFG && X.Rendering.Feature.FG.FrameGenearte(context, cmd, out var rt))
|
||||||
|
|
||||||
using (new ProfilingScope(null, Profiling.Pipeline.Renderer.setupCullingParameters))
|
|
||||||
{
|
{
|
||||||
renderer.OnPreCullRenderPasses(in cameraData);
|
(renderer as UniversalRenderer).postProcessPass.Present(cmd, ref cameraData, rt);
|
||||||
renderer.SetupCullingParameters(ref cullingParameters, ref cameraData);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
renderer.Clear(cameraData.renderType);
|
||||||
|
|
||||||
context.ExecuteCommandBuffer(cmd); // Send all the commands enqueued so far in the CommandBuffer cmd, to the ScriptableRenderContext context
|
using (new ProfilingScope(null, Profiling.Pipeline.Renderer.setupCullingParameters))
|
||||||
cmd.Clear();
|
{
|
||||||
|
renderer.OnPreCullRenderPasses(in cameraData);
|
||||||
|
renderer.SetupCullingParameters(ref cullingParameters, ref cameraData);
|
||||||
|
}
|
||||||
|
|
||||||
SetupPerCameraShaderConstants(cmd);
|
context.ExecuteCommandBuffer(cmd); // Send all the commands enqueued so far in the CommandBuffer cmd, to the ScriptableRenderContext context
|
||||||
|
cmd.Clear();
|
||||||
|
|
||||||
// Emit scene/game view UI. The main game camera UI is always rendered, so this needs to be handled only for different camera types
|
SetupPerCameraShaderConstants(cmd);
|
||||||
if (camera.cameraType == CameraType.Reflection || camera.cameraType == CameraType.Preview)
|
|
||||||
ScriptableRenderContext.EmitGeometryForCamera(camera);
|
// Emit scene/game view UI. The main game camera UI is always rendered, so this needs to be handled only for different camera types
|
||||||
|
if (camera.cameraType == CameraType.Reflection || camera.cameraType == CameraType.Preview)
|
||||||
|
ScriptableRenderContext.EmitGeometryForCamera(camera);
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
else if (isSceneViewCamera)
|
else if (isSceneViewCamera)
|
||||||
ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
|
ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Update camera motion tracking (prev matrices) from cameraData.
|
// Update camera motion tracking (prev matrices) from cameraData.
|
||||||
// Called and updated only once, as the same camera can be rendered multiple times.
|
// Called and updated only once, as the same camera can be rendered multiple times.
|
||||||
// NOTE: Tracks only the current (this) camera, not shadow views or any other offscreen views.
|
// NOTE: Tracks only the current (this) camera, not shadow views or any other offscreen views.
|
||||||
// NOTE: Shared between both Execute and Render (RG) paths.
|
// NOTE: Shared between both Execute and Render (RG) paths.
|
||||||
if(camera.TryGetComponent<UniversalAdditionalCameraData>(out var additionalCameraData))
|
if (camera.TryGetComponent<UniversalAdditionalCameraData>(out var additionalCameraData))
|
||||||
additionalCameraData.motionVectorsPersistentData.Update(ref cameraData);
|
additionalCameraData.motionVectorsPersistentData.Update(ref cameraData);
|
||||||
|
|
||||||
// Update TAA persistent data based on cameraData. Most importantly resize the history render targets.
|
// Update TAA persistent data based on cameraData. Most importantly resize the history render targets.
|
||||||
// NOTE: Persistent data is kept over multiple frames. Its life-time differs from typical resources.
|
// NOTE: Persistent data is kept over multiple frames. Its life-time differs from typical resources.
|
||||||
// NOTE: Shared between both Execute and Render (RG) paths.
|
// NOTE: Shared between both Execute and Render (RG) paths.
|
||||||
if (cameraData.taaPersistentData != null)
|
if (cameraData.taaPersistentData != null)
|
||||||
UpdateTemporalAATargets(ref cameraData);
|
UpdateTemporalAATargets(ref cameraData);
|
||||||
|
|
||||||
RTHandles.SetReferenceSize(cameraData.cameraTargetDescriptor.width, cameraData.cameraTargetDescriptor.height);
|
RTHandles.SetReferenceSize(cameraData.cameraTargetDescriptor.width, cameraData.cameraTargetDescriptor.height);
|
||||||
|
|
||||||
// Do NOT use cameraData after 'InitializeRenderingData'. CameraData state may diverge otherwise.
|
// Do NOT use cameraData after 'InitializeRenderingData'. CameraData state may diverge otherwise.
|
||||||
// RenderingData takes a copy of the CameraData.
|
// RenderingData takes a copy of the CameraData.
|
||||||
var cullResults = context.Cull(ref cullingParameters);
|
var cullResults = context.Cull(ref cullingParameters);
|
||||||
InitializeRenderingData(asset, ref cameraData, ref cullResults, cmd, out var renderingData);
|
InitializeRenderingData(asset, ref cameraData, ref cullResults, cmd, out var renderingData);
|
||||||
#if ADAPTIVE_PERFORMANCE_2_0_0_OR_NEWER
|
#if ADAPTIVE_PERFORMANCE_2_0_0_OR_NEWER
|
||||||
if (asset.useAdaptivePerformance)
|
if (asset.useAdaptivePerformance)
|
||||||
ApplyAdaptivePerformance(ref renderingData);
|
ApplyAdaptivePerformance(ref renderingData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
renderer.AddRenderPasses(ref renderingData);
|
renderer.AddRenderPasses(ref renderingData);
|
||||||
|
|
||||||
if (useRenderGraph)
|
if (useRenderGraph)
|
||||||
{
|
{
|
||||||
RecordAndExecuteRenderGraph(s_RenderGraph, context, ref renderingData);
|
RecordAndExecuteRenderGraph(s_RenderGraph, context, ref renderingData);
|
||||||
renderer.FinishRenderGraphRendering(context, ref renderingData);
|
renderer.FinishRenderGraphRendering(context, ref renderingData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using (new ProfilingScope(null, Profiling.Pipeline.Renderer.setup))
|
using (new ProfilingScope(null, Profiling.Pipeline.Renderer.setup))
|
||||||
renderer.Setup(context, ref renderingData);
|
renderer.Setup(context, ref renderingData);
|
||||||
|
|
||||||
// Timing scope inside
|
// Timing scope inside
|
||||||
renderer.Execute(context, ref renderingData);
|
renderer.Execute(context, ref renderingData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // When ProfilingSample goes out of scope, an "EndSample" command is enqueued into CommandBuffer cmd
|
} // When ProfilingSample goes out of scope, an "EndSample" command is enqueued into CommandBuffer cmd
|
||||||
|
|
||||||
context.ExecuteCommandBuffer(cmd); // Sends to ScriptableRenderContext all the commands enqueued since cmd.Clear, i.e the "EndSample" command
|
context.ExecuteCommandBuffer(cmd); // Sends to ScriptableRenderContext all the commands enqueued since cmd.Clear, i.e the "EndSample" command
|
||||||
@ -985,7 +993,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
// Some effects like Vignette computes aspect ratio from width and height. We have to take viewport into consideration if it is not default viewport.
|
// Some effects like Vignette computes aspect ratio from width and height. We have to take viewport into consideration if it is not default viewport.
|
||||||
baseCameraData.cameraTargetDescriptor.width = baseCameraData.pixelWidth;
|
baseCameraData.cameraTargetDescriptor.width = baseCameraData.pixelWidth;
|
||||||
baseCameraData.cameraTargetDescriptor.height = baseCameraData.pixelHeight;
|
baseCameraData.cameraTargetDescriptor.height = baseCameraData.pixelHeight;
|
||||||
baseCameraData.cameraTargetDescriptor.useDynamicScale = false;
|
baseCameraData.cameraTargetDescriptor.useDynamicScale = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1573,7 +1581,7 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
|
|
||||||
// Fill new history with current frame
|
// Fill new history with current frame
|
||||||
// XR Multipass renders a "frame" per eye
|
// XR Multipass renders a "frame" per eye
|
||||||
if(allocation)
|
if (allocation)
|
||||||
cameraData.taaSettings.resetHistoryFrames += xrMultipassEnabled ? 2 : 1;
|
cameraData.taaSettings.resetHistoryFrames += xrMultipassEnabled ? 2 : 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1755,50 +1763,50 @@ namespace UnityEngine.Rendering.Universal
|
|||||||
switch (selection)
|
switch (selection)
|
||||||
{
|
{
|
||||||
case UpscalingFilterSelection.Auto:
|
case UpscalingFilterSelection.Auto:
|
||||||
{
|
|
||||||
// The user selected "auto" for their upscaling filter so we should attempt to choose the best filter
|
|
||||||
// for the current situation. When the current resolution and render scale are compatible with integer
|
|
||||||
// scaling we use the point sampling filter. Otherwise we just use the default filter (linear).
|
|
||||||
float pixelScale = (1.0f / renderScale);
|
|
||||||
bool isIntegerScale = Mathf.Approximately((pixelScale - Mathf.Floor(pixelScale)), 0.0f);
|
|
||||||
|
|
||||||
if (isIntegerScale)
|
|
||||||
{
|
{
|
||||||
float widthScale = (imageSize.x / pixelScale);
|
// The user selected "auto" for their upscaling filter so we should attempt to choose the best filter
|
||||||
float heightScale = (imageSize.y / pixelScale);
|
// for the current situation. When the current resolution and render scale are compatible with integer
|
||||||
|
// scaling we use the point sampling filter. Otherwise we just use the default filter (linear).
|
||||||
|
float pixelScale = (1.0f / renderScale);
|
||||||
|
bool isIntegerScale = Mathf.Approximately((pixelScale - Mathf.Floor(pixelScale)), 0.0f);
|
||||||
|
|
||||||
bool isImageCompatible = (Mathf.Approximately((widthScale - Mathf.Floor(widthScale)), 0.0f) &&
|
if (isIntegerScale)
|
||||||
Mathf.Approximately((heightScale - Mathf.Floor(heightScale)), 0.0f));
|
|
||||||
|
|
||||||
if (isImageCompatible)
|
|
||||||
{
|
{
|
||||||
filter = ImageUpscalingFilter.Point;
|
float widthScale = (imageSize.x / pixelScale);
|
||||||
|
float heightScale = (imageSize.y / pixelScale);
|
||||||
|
|
||||||
|
bool isImageCompatible = (Mathf.Approximately((widthScale - Mathf.Floor(widthScale)), 0.0f) &&
|
||||||
|
Mathf.Approximately((heightScale - Mathf.Floor(heightScale)), 0.0f));
|
||||||
|
|
||||||
|
if (isImageCompatible)
|
||||||
|
{
|
||||||
|
filter = ImageUpscalingFilter.Point;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case UpscalingFilterSelection.Linear:
|
case UpscalingFilterSelection.Linear:
|
||||||
{
|
{
|
||||||
// Do nothing since linear is already the default
|
// Do nothing since linear is already the default
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UpscalingFilterSelection.Point:
|
case UpscalingFilterSelection.Point:
|
||||||
{
|
{
|
||||||
filter = ImageUpscalingFilter.Point;
|
filter = ImageUpscalingFilter.Point;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UpscalingFilterSelection.FSR:
|
case UpscalingFilterSelection.FSR:
|
||||||
{
|
{
|
||||||
filter = ImageUpscalingFilter.FSR;
|
filter = ImageUpscalingFilter.FSR;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
|
|||||||
16
ProjectSettings/BurstAotSettings_OpenHarmony.json
Normal file
16
ProjectSettings/BurstAotSettings_OpenHarmony.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"MonoBehaviour": {
|
||||||
|
"Version": 4,
|
||||||
|
"EnableBurstCompilation": true,
|
||||||
|
"EnableOptimisations": true,
|
||||||
|
"EnableSafetyChecks": false,
|
||||||
|
"EnableDebugInAllBuilds": false,
|
||||||
|
"DebugDataKind": 1,
|
||||||
|
"EnableArmv9SecurityFeatures": false,
|
||||||
|
"CpuMinTargetX32": 0,
|
||||||
|
"CpuMaxTargetX32": 0,
|
||||||
|
"CpuMinTargetX64": 0,
|
||||||
|
"CpuMaxTargetX64": 0,
|
||||||
|
"OptimizeFor": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -266,6 +266,7 @@ PlayerSettings:
|
|||||||
- {fileID: 0}
|
- {fileID: 0}
|
||||||
- {fileID: 0}
|
- {fileID: 0}
|
||||||
- {fileID: 0}
|
- {fileID: 0}
|
||||||
|
- {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2}
|
||||||
metroInputSource: 0
|
metroInputSource: 0
|
||||||
wsaTransparentSwapchain: 0
|
wsaTransparentSwapchain: 0
|
||||||
m_HolographicPauseOnTrackingLoss: 1
|
m_HolographicPauseOnTrackingLoss: 1
|
||||||
@ -288,7 +289,7 @@ PlayerSettings:
|
|||||||
applicationIdentifier:
|
applicationIdentifier:
|
||||||
Android: com.DefaultCompany.TJURP
|
Android: com.DefaultCompany.TJURP
|
||||||
OpenHarmony: com.DefaultCompany.TJURP
|
OpenHarmony: com.DefaultCompany.TJURP
|
||||||
Standalone: com.unity.template.urp-sample
|
Standalone: com.DefaultCompany.TJURP
|
||||||
iPhone: com.unity.template.urp-sample
|
iPhone: com.unity.template.urp-sample
|
||||||
buildNumber:
|
buildNumber:
|
||||||
Standalone: 0
|
Standalone: 0
|
||||||
@ -301,7 +302,7 @@ PlayerSettings:
|
|||||||
AndroidTargetSdkVersion: 0
|
AndroidTargetSdkVersion: 0
|
||||||
AndroidPreferredInstallLocation: 1
|
AndroidPreferredInstallLocation: 1
|
||||||
aotOptions:
|
aotOptions:
|
||||||
stripEngineCode: 1
|
stripEngineCode: 0
|
||||||
iPhoneStrippingLevel: 0
|
iPhoneStrippingLevel: 0
|
||||||
iPhoneScriptCallOptimization: 0
|
iPhoneScriptCallOptimization: 0
|
||||||
ForceInternetPermission: 0
|
ForceInternetPermission: 0
|
||||||
@ -392,7 +393,7 @@ PlayerSettings:
|
|||||||
useCustomGradlePropertiesTemplate: 0
|
useCustomGradlePropertiesTemplate: 0
|
||||||
useCustomGradleSettingsTemplate: 0
|
useCustomGradleSettingsTemplate: 0
|
||||||
useCustomProguardFile: 0
|
useCustomProguardFile: 0
|
||||||
AndroidTargetArchitectures: 3
|
AndroidTargetArchitectures: 2
|
||||||
AndroidTargetDevices: 0
|
AndroidTargetDevices: 0
|
||||||
AndroidSplashScreenScale: 0
|
AndroidSplashScreenScale: 0
|
||||||
androidSplashScreen: {fileID: 0}
|
androidSplashScreen: {fileID: 0}
|
||||||
@ -747,7 +748,7 @@ PlayerSettings:
|
|||||||
- m_BuildTarget: LuminSupport
|
- m_BuildTarget: LuminSupport
|
||||||
m_GraphicsJobs: 0
|
m_GraphicsJobs: 0
|
||||||
- m_BuildTarget: AndroidPlayer
|
- m_BuildTarget: AndroidPlayer
|
||||||
m_GraphicsJobs: 1
|
m_GraphicsJobs: 0
|
||||||
- m_BuildTarget: WebGLSupport
|
- m_BuildTarget: WebGLSupport
|
||||||
m_GraphicsJobs: 0
|
m_GraphicsJobs: 0
|
||||||
m_BuildTargetGraphicsJobMode:
|
m_BuildTargetGraphicsJobMode:
|
||||||
@ -763,13 +764,19 @@ PlayerSettings:
|
|||||||
m_APIs: 10000000
|
m_APIs: 10000000
|
||||||
m_Automatic: 1
|
m_Automatic: 1
|
||||||
- m_BuildTarget: AndroidPlayer
|
- m_BuildTarget: AndroidPlayer
|
||||||
m_APIs: 150000000b000000
|
m_APIs: 0b00000015000000
|
||||||
m_Automatic: 0
|
m_Automatic: 0
|
||||||
- m_BuildTarget: WebGLSupport
|
- m_BuildTarget: WebGLSupport
|
||||||
m_APIs: 0b000000
|
m_APIs: 0b000000
|
||||||
m_Automatic: 0
|
m_Automatic: 0
|
||||||
- m_BuildTarget: WindowsStandaloneSupport
|
- m_BuildTarget: WindowsStandaloneSupport
|
||||||
m_APIs: 02000000
|
m_APIs: 15000000
|
||||||
|
m_Automatic: 0
|
||||||
|
- m_BuildTarget: LinuxStandaloneSupport
|
||||||
|
m_APIs: 15000000
|
||||||
|
m_Automatic: 0
|
||||||
|
- m_BuildTarget: MacStandaloneSupport
|
||||||
|
m_APIs: 10000000
|
||||||
m_Automatic: 0
|
m_Automatic: 0
|
||||||
m_BuildTargetVRSettings: []
|
m_BuildTargetVRSettings: []
|
||||||
m_DefaultShaderChunkSizeInMB: 16
|
m_DefaultShaderChunkSizeInMB: 16
|
||||||
@ -1074,13 +1081,14 @@ PlayerSettings:
|
|||||||
platformArchitecture: {}
|
platformArchitecture: {}
|
||||||
scriptingBackend:
|
scriptingBackend:
|
||||||
Android: 1
|
Android: 1
|
||||||
|
OpenHarmony: 1
|
||||||
Standalone: 0
|
Standalone: 0
|
||||||
il2cppCompilerConfiguration: {}
|
il2cppCompilerConfiguration: {}
|
||||||
il2cppCodeGeneration: {}
|
il2cppCodeGeneration: {}
|
||||||
managedStrippingLevel: {}
|
managedStrippingLevel: {}
|
||||||
incrementalIl2cppBuild: {}
|
incrementalIl2cppBuild: {}
|
||||||
suppressCommonWarnings: 1
|
suppressCommonWarnings: 1
|
||||||
allowUnsafeCode: 0
|
allowUnsafeCode: 1
|
||||||
useDeterministicCompilation: 1
|
useDeterministicCompilation: 1
|
||||||
additionalIl2CppArgs:
|
additionalIl2CppArgs:
|
||||||
scriptingRuntimeVersion: 1
|
scriptingRuntimeVersion: 1
|
||||||
@ -1168,7 +1176,7 @@ PlayerSettings:
|
|||||||
hmiCpuConfiguration:
|
hmiCpuConfiguration:
|
||||||
openHarmonySplashScreen: {fileID: 0}
|
openHarmonySplashScreen: {fileID: 0}
|
||||||
openHarmonySplashScreenScale: 0
|
openHarmonySplashScreenScale: 0
|
||||||
OpenHarmonyTargetArchitectures: 2
|
OpenHarmonyTargetArchitectures: 6
|
||||||
openHarmonyClientID:
|
openHarmonyClientID:
|
||||||
openHarmonyAppID:
|
openHarmonyAppID:
|
||||||
openHarmonyDeviceTypes: 7
|
openHarmonyDeviceTypes: 7
|
||||||
|
|||||||
@ -58,7 +58,6 @@ QualitySettings:
|
|||||||
vgStreamingBufferSize: 512
|
vgStreamingBufferSize: 512
|
||||||
excludedTargetPlatforms:
|
excludedTargetPlatforms:
|
||||||
- Nintendo Switch
|
- Nintendo Switch
|
||||||
- Standalone
|
|
||||||
m_TextureMipmapLimitGroupNames: []
|
m_TextureMipmapLimitGroupNames: []
|
||||||
m_PerPlatformDefaultQuality:
|
m_PerPlatformDefaultQuality:
|
||||||
Android: 0
|
Android: 0
|
||||||
|
|||||||
@ -12,14 +12,14 @@ EditorUserSettings:
|
|||||||
value: 5a57555407545f0b5e0f5f764277594914161e2b787977692b714e64e4b2363b
|
value: 5a57555407545f0b5e0f5f764277594914161e2b787977692b714e64e4b2363b
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-2:
|
RecentlyUsedSceneGuid-2:
|
||||||
value: 57050d5004060d590f56087046700f4445164c7e7a7824312e7c4e6bb0e1376d
|
|
||||||
flags: 0
|
|
||||||
RecentlyUsedSceneGuid-3:
|
|
||||||
value: 01060c075556080e0956597315775b14104e4179282b25662b2c1c31b7b63068
|
value: 01060c075556080e0956597315775b14104e4179282b25662b2c1c31b7b63068
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-4:
|
RecentlyUsedSceneGuid-3:
|
||||||
value: 5b00515154055e035459547042705a44154f1e2c2e2e7f677e7d4567e1b9376d
|
value: 5b00515154055e035459547042705a44154f1e2c2e2e7f677e7d4567e1b9376d
|
||||||
flags: 0
|
flags: 0
|
||||||
|
RecentlyUsedSceneGuid-4:
|
||||||
|
value: 57050d5004060d590f56087046700f4445164c7e7a7824312e7c4e6bb0e1376d
|
||||||
|
flags: 0
|
||||||
vcSharedLogLevel:
|
vcSharedLogLevel:
|
||||||
value: 0d5e400f0650
|
value: 0d5e400f0650
|
||||||
flags: 0
|
flags: 0
|
||||||
|
|||||||
@ -1,30 +1,6 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:yousandi.cn,2023:
|
%TAG !u! tag:yousandi.cn,2023:
|
||||||
--- !u!114 &1
|
--- !u!114 &1
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 52
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_PixelRect:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 2815
|
|
||||||
y: 219
|
|
||||||
width: 1934
|
|
||||||
height: 971
|
|
||||||
m_ShowMode: 0
|
|
||||||
m_Title: Frame Debugger
|
|
||||||
m_RootView: {fileID: 4}
|
|
||||||
m_MinSize: {x: 1000, y: 521}
|
|
||||||
m_MaxSize: {x: 4000, y: 4021}
|
|
||||||
m_Maximized: 0
|
|
||||||
--- !u!114 &2
|
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -38,68 +14,17 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_PixelRect:
|
m_PixelRect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 9
|
||||||
y: 43
|
y: 52
|
||||||
width: 2560
|
width: 2542
|
||||||
height: 1349
|
height: 1331
|
||||||
m_ShowMode: 4
|
m_ShowMode: 4
|
||||||
m_Title: Game
|
m_Title: Console
|
||||||
m_RootView: {fileID: 11}
|
m_RootView: {fileID: 8}
|
||||||
m_MinSize: {x: 875, y: 300}
|
m_MinSize: {x: 875, y: 300}
|
||||||
m_MaxSize: {x: 10000, y: 10000}
|
m_MaxSize: {x: 10000, y: 10000}
|
||||||
m_Maximized: 1
|
m_Maximized: 0
|
||||||
--- !u!114 &3
|
--- !u!114 &2
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 52
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
m_Name: FrameDebuggerWindow
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_Children: []
|
|
||||||
m_Position:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 1934
|
|
||||||
height: 971
|
|
||||||
m_MinSize: {x: 1000, y: 521}
|
|
||||||
m_MaxSize: {x: 4000, y: 4021}
|
|
||||||
m_ActualView: {fileID: 17}
|
|
||||||
m_Panes:
|
|
||||||
- {fileID: 17}
|
|
||||||
m_Selected: 0
|
|
||||||
m_LastSelected: 0
|
|
||||||
--- !u!114 &4
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 52
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 3}
|
|
||||||
m_Position:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 1934
|
|
||||||
height: 971
|
|
||||||
m_MinSize: {x: 1000, y: 521}
|
|
||||||
m_MaxSize: {x: 4000, y: 4021}
|
|
||||||
vertical: 0
|
|
||||||
controlID: 14
|
|
||||||
draggingID: 0
|
|
||||||
--- !u!114 &5
|
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -114,18 +39,18 @@ MonoBehaviour:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 1300
|
x: 1400
|
||||||
y: 0
|
y: 0
|
||||||
width: 650
|
width: 701
|
||||||
height: 529
|
height: 522
|
||||||
m_MinSize: {x: 102, y: 121}
|
m_MinSize: {x: 102, y: 121}
|
||||||
m_MaxSize: {x: 4002, y: 4021}
|
m_MaxSize: {x: 4002, y: 4021}
|
||||||
m_ActualView: {fileID: 23}
|
m_ActualView: {fileID: 19}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 23}
|
- {fileID: 19}
|
||||||
m_Selected: 0
|
m_Selected: 0
|
||||||
m_LastSelected: 0
|
m_LastSelected: 0
|
||||||
--- !u!114 &6
|
--- !u!114 &3
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -138,20 +63,20 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 10}
|
- {fileID: 7}
|
||||||
- {fileID: 5}
|
- {fileID: 2}
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 770
|
y: 759
|
||||||
width: 1950
|
width: 2101
|
||||||
height: 529
|
height: 522
|
||||||
m_MinSize: {x: 200, y: 50}
|
m_MinSize: {x: 200, y: 50}
|
||||||
m_MaxSize: {x: 16192, y: 8096}
|
m_MaxSize: {x: 16192, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 126
|
controlID: 68
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &7
|
--- !u!114 &4
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -164,20 +89,20 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 14}
|
- {fileID: 11}
|
||||||
- {fileID: 8}
|
- {fileID: 5}
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 30
|
y: 30
|
||||||
width: 2560
|
width: 2542
|
||||||
height: 1299
|
height: 1281
|
||||||
m_MinSize: {x: 300, y: 100}
|
m_MinSize: {x: 300, y: 100}
|
||||||
m_MaxSize: {x: 24288, y: 16192}
|
m_MaxSize: {x: 24288, y: 16192}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 162
|
controlID: 171
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &8
|
--- !u!114 &5
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -192,18 +117,18 @@ MonoBehaviour:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 1950
|
x: 2101
|
||||||
y: 0
|
y: 0
|
||||||
width: 610
|
width: 441
|
||||||
height: 1299
|
height: 1281
|
||||||
m_MinSize: {x: 276, y: 71}
|
m_MinSize: {x: 276, y: 71}
|
||||||
m_MaxSize: {x: 4001, y: 4021}
|
m_MaxSize: {x: 4001, y: 4021}
|
||||||
m_ActualView: {fileID: 19}
|
m_ActualView: {fileID: 15}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 19}
|
- {fileID: 15}
|
||||||
m_Selected: 0
|
m_Selected: 0
|
||||||
m_LastSelected: 0
|
m_LastSelected: 0
|
||||||
--- !u!114 &9
|
--- !u!114 &6
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -220,16 +145,16 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 483
|
width: 516
|
||||||
height: 770
|
height: 759
|
||||||
m_MinSize: {x: 201, y: 221}
|
m_MinSize: {x: 201, y: 221}
|
||||||
m_MaxSize: {x: 4001, y: 4021}
|
m_MaxSize: {x: 4001, y: 4021}
|
||||||
m_ActualView: {fileID: 20}
|
m_ActualView: {fileID: 16}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 20}
|
- {fileID: 16}
|
||||||
m_Selected: 0
|
m_Selected: 0
|
||||||
m_LastSelected: 0
|
m_LastSelected: 0
|
||||||
--- !u!114 &10
|
--- !u!114 &7
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -246,16 +171,16 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 1300
|
width: 1400
|
||||||
height: 529
|
height: 522
|
||||||
m_MinSize: {x: 231, y: 271}
|
m_MinSize: {x: 231, y: 271}
|
||||||
m_MaxSize: {x: 10001, y: 10021}
|
m_MaxSize: {x: 10001, y: 10021}
|
||||||
m_ActualView: {fileID: 18}
|
m_ActualView: {fileID: 14}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 18}
|
- {fileID: 14}
|
||||||
m_Selected: 0
|
m_Selected: 0
|
||||||
m_LastSelected: 0
|
m_LastSelected: 0
|
||||||
--- !u!114 &11
|
--- !u!114 &8
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -268,22 +193,22 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 12}
|
- {fileID: 9}
|
||||||
- {fileID: 7}
|
- {fileID: 4}
|
||||||
- {fileID: 13}
|
- {fileID: 10}
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 2560
|
width: 2542
|
||||||
height: 1349
|
height: 1331
|
||||||
m_MinSize: {x: 875, y: 300}
|
m_MinSize: {x: 875, y: 300}
|
||||||
m_MaxSize: {x: 10000, y: 10000}
|
m_MaxSize: {x: 10000, y: 10000}
|
||||||
m_UseTopView: 1
|
m_UseTopView: 1
|
||||||
m_TopViewHeight: 30
|
m_TopViewHeight: 30
|
||||||
m_UseBottomView: 1
|
m_UseBottomView: 1
|
||||||
m_BottomViewHeight: 20
|
m_BottomViewHeight: 20
|
||||||
--- !u!114 &12
|
--- !u!114 &9
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -300,12 +225,12 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 2560
|
width: 2542
|
||||||
height: 30
|
height: 30
|
||||||
m_MinSize: {x: 0, y: 0}
|
m_MinSize: {x: 0, y: 0}
|
||||||
m_MaxSize: {x: 0, y: 0}
|
m_MaxSize: {x: 0, y: 0}
|
||||||
m_LastLoadedLayoutName:
|
m_LastLoadedLayoutName:
|
||||||
--- !u!114 &13
|
--- !u!114 &10
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -321,12 +246,12 @@ MonoBehaviour:
|
|||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 1329
|
y: 1311
|
||||||
width: 2560
|
width: 2542
|
||||||
height: 20
|
height: 20
|
||||||
m_MinSize: {x: 0, y: 0}
|
m_MinSize: {x: 0, y: 0}
|
||||||
m_MaxSize: {x: 0, y: 0}
|
m_MaxSize: {x: 0, y: 0}
|
||||||
--- !u!114 &14
|
--- !u!114 &11
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -339,20 +264,20 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 15}
|
- {fileID: 12}
|
||||||
- {fileID: 6}
|
- {fileID: 3}
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 1950
|
width: 2101
|
||||||
height: 1299
|
height: 1281
|
||||||
m_MinSize: {x: 200, y: 100}
|
m_MinSize: {x: 200, y: 100}
|
||||||
m_MaxSize: {x: 16192, y: 16192}
|
m_MaxSize: {x: 16192, y: 16192}
|
||||||
vertical: 1
|
vertical: 1
|
||||||
controlID: 39
|
controlID: 40
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &15
|
--- !u!114 &12
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -365,20 +290,20 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 9}
|
- {fileID: 6}
|
||||||
- {fileID: 16}
|
- {fileID: 13}
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 1950
|
width: 2101
|
||||||
height: 770
|
height: 759
|
||||||
m_MinSize: {x: 200, y: 50}
|
m_MinSize: {x: 200, y: 50}
|
||||||
m_MaxSize: {x: 16192, y: 8096}
|
m_MaxSize: {x: 16192, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 40
|
controlID: 41
|
||||||
draggingID: 0
|
draggingID: 0
|
||||||
--- !u!114 &16
|
--- !u!114 &13
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -393,76 +318,19 @@ MonoBehaviour:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Position:
|
m_Position:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 483
|
x: 516
|
||||||
y: 0
|
y: 0
|
||||||
width: 1467
|
width: 1585
|
||||||
height: 770
|
height: 759
|
||||||
m_MinSize: {x: 202, y: 221}
|
m_MinSize: {x: 202, y: 221}
|
||||||
m_MaxSize: {x: 4002, y: 4021}
|
m_MaxSize: {x: 4002, y: 4021}
|
||||||
m_ActualView: {fileID: 22}
|
m_ActualView: {fileID: 18}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 21}
|
- {fileID: 17}
|
||||||
- {fileID: 22}
|
- {fileID: 18}
|
||||||
m_Selected: 1
|
m_Selected: 1
|
||||||
m_LastSelected: 0
|
m_LastSelected: 0
|
||||||
--- !u!114 &17
|
--- !u!114 &14
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 52
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 13202, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_MinSize: {x: 1000, y: 500}
|
|
||||||
m_MaxSize: {x: 4000, y: 4000}
|
|
||||||
m_TitleContent:
|
|
||||||
m_Text: Frame Debugger
|
|
||||||
m_Image: {fileID: 0}
|
|
||||||
m_Tooltip:
|
|
||||||
m_Pos:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 2815
|
|
||||||
y: 219
|
|
||||||
width: 1934
|
|
||||||
height: 950
|
|
||||||
m_SerializedDataModeController:
|
|
||||||
m_DataMode: 0
|
|
||||||
m_PreferredDataMode: 0
|
|
||||||
m_SupportedDataModes:
|
|
||||||
isAutomatic: 1
|
|
||||||
m_ViewDataDictionary: {fileID: 0}
|
|
||||||
m_OverlayCanvas:
|
|
||||||
m_LastAppliedPresetName: Default
|
|
||||||
m_SaveData: []
|
|
||||||
m_OverlaysVisible: 1
|
|
||||||
m_TreeWidth: 337.92
|
|
||||||
m_TreeViewState:
|
|
||||||
scrollPos: {x: 0, y: 0}
|
|
||||||
m_SelectedIDs: 1f000000
|
|
||||||
m_LastClickedID: 31
|
|
||||||
m_ExpandedIDs: e4ffffffe5ffffffe9ffffffebffffffecfffffff5fffffff8fffffffdfffffffeffffff00000000
|
|
||||||
m_RenameOverlay:
|
|
||||||
m_UserAcceptedRename: 0
|
|
||||||
m_Name:
|
|
||||||
m_OriginalName:
|
|
||||||
m_EditFieldRect:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 0
|
|
||||||
height: 0
|
|
||||||
m_UserData: 0
|
|
||||||
m_IsWaitingForDelay: 0
|
|
||||||
m_IsRenaming: 0
|
|
||||||
m_OriginalEventType: 11
|
|
||||||
m_IsRenamingFilename: 0
|
|
||||||
m_ClientGUIView: {fileID: 0}
|
|
||||||
m_SearchString:
|
|
||||||
--- !u!114 &18
|
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -482,10 +350,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 9
|
||||||
y: 843
|
y: 841
|
||||||
width: 1299
|
width: 1399
|
||||||
height: 508
|
height: 501
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
@ -507,7 +375,7 @@ MonoBehaviour:
|
|||||||
m_SkipHidden: 0
|
m_SkipHidden: 0
|
||||||
m_SearchArea: 1
|
m_SearchArea: 1
|
||||||
m_Folders:
|
m_Folders:
|
||||||
- Packages/com.unity.render-pipelines.universal/Runtime/SuperRendering/SR/Shader
|
- Assets/Settings/Mobile
|
||||||
m_Globs: []
|
m_Globs: []
|
||||||
m_OriginalText:
|
m_OriginalText:
|
||||||
m_ImportLogFlags: 0
|
m_ImportLogFlags: 0
|
||||||
@ -515,16 +383,16 @@ MonoBehaviour:
|
|||||||
m_ViewMode: 1
|
m_ViewMode: 1
|
||||||
m_StartGridSize: 16
|
m_StartGridSize: 16
|
||||||
m_LastFolders:
|
m_LastFolders:
|
||||||
- Packages/com.unity.render-pipelines.universal/Runtime/SuperRendering/SR/Shader
|
- Assets/Settings/Mobile
|
||||||
m_LastFoldersGridSize: 16
|
m_LastFoldersGridSize: 16
|
||||||
m_LastProjectPath: G:\TJURP
|
m_LastProjectPath: G:\TJURP
|
||||||
m_LockTracker:
|
m_LockTracker:
|
||||||
m_IsLocked: 0
|
m_IsLocked: 0
|
||||||
m_FolderTreeState:
|
m_FolderTreeState:
|
||||||
scrollPos: {x: 0, y: 456}
|
scrollPos: {x: 0, y: 40}
|
||||||
m_SelectedIDs: 30530000
|
m_SelectedIDs: a6800000
|
||||||
m_LastClickedID: 21296
|
m_LastClickedID: 32934
|
||||||
m_ExpandedIDs: 00000000284500005c45000068450000344600008c4600004447000060480000e84a0000104c0000144e0000e84f0000649a010000ca9a3bffffff7f
|
m_ExpandedIDs: 00000000f07d0000f27d0000f47d0000f67d0000f87d0000fa7d0000fc7d0000fe7d0000007e0000027e0000047e0000067e0000087e00000a7e000000ca9a3bffffff7f
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -540,7 +408,7 @@ MonoBehaviour:
|
|||||||
m_IsRenaming: 0
|
m_IsRenaming: 0
|
||||||
m_OriginalEventType: 11
|
m_OriginalEventType: 11
|
||||||
m_IsRenamingFilename: 1
|
m_IsRenamingFilename: 1
|
||||||
m_ClientGUIView: {fileID: 10}
|
m_ClientGUIView: {fileID: 7}
|
||||||
m_SearchString:
|
m_SearchString:
|
||||||
m_CreateAssetUtility:
|
m_CreateAssetUtility:
|
||||||
m_EndAction: {fileID: 0}
|
m_EndAction: {fileID: 0}
|
||||||
@ -552,7 +420,7 @@ MonoBehaviour:
|
|||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs:
|
m_SelectedIDs:
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 00000000cc4400002845000068450000344600008c4600004447000060480000e84a0000104c0000144e0000e84f0000649a0100
|
m_ExpandedIDs: 00000000f07d0000f27d0000f47d0000f67d0000f87d0000fa7d0000fc7d0000fe7d0000007e0000027e0000047e0000067e0000087e00000a7e0000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -579,7 +447,7 @@ MonoBehaviour:
|
|||||||
m_ListAreaState:
|
m_ListAreaState:
|
||||||
m_SelectedInstanceIDs:
|
m_SelectedInstanceIDs:
|
||||||
m_LastClickedInstanceID: 0
|
m_LastClickedInstanceID: 0
|
||||||
m_HadKeyboardFocusLastEvent: 1
|
m_HadKeyboardFocusLastEvent: 0
|
||||||
m_ExpandedInstanceIDs: c623000000000000
|
m_ExpandedInstanceIDs: c623000000000000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
@ -596,7 +464,7 @@ MonoBehaviour:
|
|||||||
m_IsRenaming: 0
|
m_IsRenaming: 0
|
||||||
m_OriginalEventType: 11
|
m_OriginalEventType: 11
|
||||||
m_IsRenamingFilename: 1
|
m_IsRenamingFilename: 1
|
||||||
m_ClientGUIView: {fileID: 10}
|
m_ClientGUIView: {fileID: 7}
|
||||||
m_CreateAssetUtility:
|
m_CreateAssetUtility:
|
||||||
m_EndAction: {fileID: 0}
|
m_EndAction: {fileID: 0}
|
||||||
m_InstanceID: 0
|
m_InstanceID: 0
|
||||||
@ -608,7 +476,7 @@ MonoBehaviour:
|
|||||||
m_GridSize: 16
|
m_GridSize: 16
|
||||||
m_SkipHiddenPackages: 0
|
m_SkipHiddenPackages: 0
|
||||||
m_DirectoriesAreaWidth: 207
|
m_DirectoriesAreaWidth: 207
|
||||||
--- !u!114 &19
|
--- !u!114 &15
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -628,10 +496,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 1950
|
x: 2110
|
||||||
y: 73
|
y: 82
|
||||||
width: 609
|
width: 440
|
||||||
height: 1278
|
height: 1260
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
@ -655,7 +523,7 @@ MonoBehaviour:
|
|||||||
m_LockTracker:
|
m_LockTracker:
|
||||||
m_IsLocked: 0
|
m_IsLocked: 0
|
||||||
m_PreviewWindow: {fileID: 0}
|
m_PreviewWindow: {fileID: 0}
|
||||||
--- !u!114 &20
|
--- !u!114 &16
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -675,10 +543,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 9
|
||||||
y: 73
|
y: 82
|
||||||
width: 482
|
width: 515
|
||||||
height: 749
|
height: 738
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
@ -692,9 +560,9 @@ MonoBehaviour:
|
|||||||
m_SceneHierarchy:
|
m_SceneHierarchy:
|
||||||
m_TreeViewState:
|
m_TreeViewState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs: 48030000
|
m_SelectedIDs:
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 8e95fdff
|
m_ExpandedIDs: 3afaffff
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@ -710,7 +578,7 @@ MonoBehaviour:
|
|||||||
m_IsRenaming: 0
|
m_IsRenaming: 0
|
||||||
m_OriginalEventType: 11
|
m_OriginalEventType: 11
|
||||||
m_IsRenamingFilename: 0
|
m_IsRenamingFilename: 0
|
||||||
m_ClientGUIView: {fileID: 9}
|
m_ClientGUIView: {fileID: 6}
|
||||||
m_SearchString:
|
m_SearchString:
|
||||||
m_ExpandedScenes: []
|
m_ExpandedScenes: []
|
||||||
m_CurrenRootInstanceID: 0
|
m_CurrenRootInstanceID: 0
|
||||||
@ -718,7 +586,7 @@ MonoBehaviour:
|
|||||||
m_IsLocked: 0
|
m_IsLocked: 0
|
||||||
m_CurrentSortingName: TransformSorting
|
m_CurrentSortingName: TransformSorting
|
||||||
m_WindowGUID: 4c969a2b90040154d917609493e03593
|
m_WindowGUID: 4c969a2b90040154d917609493e03593
|
||||||
--- !u!114 &21
|
--- !u!114 &17
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -738,10 +606,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 483
|
x: 525
|
||||||
y: 73
|
y: 82
|
||||||
width: 1465
|
width: 1583
|
||||||
height: 749
|
height: 738
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
@ -756,8 +624,8 @@ MonoBehaviour:
|
|||||||
floating: 0
|
floating: 0
|
||||||
collapsed: 0
|
collapsed: 0
|
||||||
displayed: 1
|
displayed: 1
|
||||||
snapOffset: {x: -166, y: -26}
|
snapOffset: {x: -171, y: -26}
|
||||||
snapOffsetDelta: {x: -5, y: 0}
|
snapOffsetDelta: {x: 0, y: 0}
|
||||||
snapCorner: 3
|
snapCorner: 3
|
||||||
id: Tool Settings
|
id: Tool Settings
|
||||||
index: 0
|
index: 0
|
||||||
@ -1134,14 +1002,14 @@ MonoBehaviour:
|
|||||||
m_OverrideSceneCullingMask: 6917529027641081856
|
m_OverrideSceneCullingMask: 6917529027641081856
|
||||||
m_SceneIsLit: 1
|
m_SceneIsLit: 1
|
||||||
m_SceneLighting: 1
|
m_SceneLighting: 1
|
||||||
m_2DMode: 0
|
m_2DMode: 1
|
||||||
m_isRotationLocked: 0
|
m_isRotationLocked: 0
|
||||||
m_PlayAudio: 0
|
m_PlayAudio: 0
|
||||||
m_AudioPlay: 0
|
m_AudioPlay: 0
|
||||||
m_Position:
|
m_Position:
|
||||||
m_Target: {x: 0.3252655, y: 6.390328, z: -98.436806}
|
m_Target: {x: 741.2015, y: 1097.4281, z: 82.08899}
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: {x: 0.3252655, y: 6.390328, z: -98.436806}
|
m_Value: {x: 741.2015, y: 1097.4281, z: 82.08899}
|
||||||
m_RenderMode: 0
|
m_RenderMode: 0
|
||||||
m_CameraMode:
|
m_CameraMode:
|
||||||
drawMode: 0
|
drawMode: 0
|
||||||
@ -1169,17 +1037,17 @@ MonoBehaviour:
|
|||||||
m_Size: {x: 0, y: 0}
|
m_Size: {x: 0, y: 0}
|
||||||
yGrid:
|
yGrid:
|
||||||
m_Fade:
|
m_Fade:
|
||||||
m_Target: 1
|
m_Target: 0
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 1
|
m_Value: 0
|
||||||
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
||||||
m_Pivot: {x: 0, y: 0, z: 0}
|
m_Pivot: {x: 0, y: 0, z: 0}
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
zGrid:
|
zGrid:
|
||||||
m_Fade:
|
m_Fade:
|
||||||
m_Target: 0
|
m_Target: 1
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 0
|
m_Value: 1
|
||||||
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4}
|
||||||
m_Pivot: {x: 0, y: 0, z: 0}
|
m_Pivot: {x: 0, y: 0, z: 0}
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
@ -1187,17 +1055,17 @@ MonoBehaviour:
|
|||||||
m_GridAxis: 1
|
m_GridAxis: 1
|
||||||
m_gridOpacity: 0.5
|
m_gridOpacity: 0.5
|
||||||
m_Rotation:
|
m_Rotation:
|
||||||
m_Target: {x: 0.10873414, y: -0.42024752, z: 0.050804242, w: 0.89943933}
|
m_Target: {x: 0, y: 0, z: 0, w: 1}
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: {x: 0.10873396, y: -0.4202468, z: 0.050804157, w: 0.89943784}
|
m_Value: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_Size:
|
m_Size:
|
||||||
m_Target: 1.4466168
|
m_Target: 890.40814
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 1.4466168
|
m_Value: 890.40814
|
||||||
m_Ortho:
|
m_Ortho:
|
||||||
m_Target: 0
|
m_Target: 1
|
||||||
speed: 2
|
speed: 2
|
||||||
m_Value: 0
|
m_Value: 1
|
||||||
m_CameraSettings:
|
m_CameraSettings:
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_SpeedNormalized: 0.5
|
m_SpeedNormalized: 0.5
|
||||||
@ -1213,14 +1081,14 @@ MonoBehaviour:
|
|||||||
m_OcclusionCulling: 0
|
m_OcclusionCulling: 0
|
||||||
m_EnableGDRP: 1
|
m_EnableGDRP: 1
|
||||||
m_BackfaceCulling: 0
|
m_BackfaceCulling: 0
|
||||||
m_LastSceneViewRotation: {x: -0.015300392, y: 0.033586923, z: -0.0005142884, w: -0.9993189}
|
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
|
||||||
m_LastSceneViewOrtho: 0
|
m_LastSceneViewOrtho: 0
|
||||||
m_ReplacementShader: {fileID: 0}
|
m_ReplacementShader: {fileID: 0}
|
||||||
m_ReplacementString:
|
m_ReplacementString:
|
||||||
m_SceneVisActive: 1
|
m_SceneVisActive: 1
|
||||||
m_LastLockedObject: {fileID: 0}
|
m_LastLockedObject: {fileID: 0}
|
||||||
m_ViewIsLockedToObject: 0
|
m_ViewIsLockedToObject: 0
|
||||||
--- !u!114 &22
|
--- !u!114 &18
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -1240,10 +1108,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 483
|
x: 525
|
||||||
y: 73
|
y: 82
|
||||||
width: 1465
|
width: 1583
|
||||||
height: 749
|
height: 738
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
@ -1268,7 +1136,7 @@ MonoBehaviour:
|
|||||||
m_UseMipMap: 0
|
m_UseMipMap: 0
|
||||||
m_VSyncEnabled: 0
|
m_VSyncEnabled: 0
|
||||||
m_Gizmos: 0
|
m_Gizmos: 0
|
||||||
m_Stats: 0
|
m_Stats: 1
|
||||||
m_SelectedSizes: 0000000000000000000000000a000000000000000000000000000000000000000000000000000000
|
m_SelectedSizes: 0000000000000000000000000a000000000000000000000000000000000000000000000000000000
|
||||||
m_ZoomArea:
|
m_ZoomArea:
|
||||||
m_HRangeLocked: 0
|
m_HRangeLocked: 0
|
||||||
@ -1296,29 +1164,29 @@ MonoBehaviour:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 21
|
y: 21
|
||||||
width: 1465
|
width: 1583
|
||||||
height: 728
|
height: 717
|
||||||
m_Scale: {x: 0.50555557, y: 0.50555557}
|
m_Scale: {x: 0.49791667, y: 0.49791667}
|
||||||
m_Translation: {x: 732.5, y: 364}
|
m_Translation: {x: 791.5, y: 358.5}
|
||||||
m_MarginLeft: 0
|
m_MarginLeft: 0
|
||||||
m_MarginRight: 0
|
m_MarginRight: 0
|
||||||
m_MarginTop: 0
|
m_MarginTop: 0
|
||||||
m_MarginBottom: 0
|
m_MarginBottom: 0
|
||||||
m_LastShownAreaInsideMargins:
|
m_LastShownAreaInsideMargins:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: -1448.901
|
x: -1589.6234
|
||||||
y: -720
|
y: -720
|
||||||
width: 2897.802
|
width: 3179.2468
|
||||||
height: 1440
|
height: 1440
|
||||||
m_MinimalGUI: 1
|
m_MinimalGUI: 1
|
||||||
m_defaultScale: 0.50555557
|
m_defaultScale: 0.49791667
|
||||||
m_LastWindowPixelSize: {x: 1465, y: 749}
|
m_LastWindowPixelSize: {x: 1583, y: 738}
|
||||||
m_ClearInEditMode: 1
|
m_ClearInEditMode: 1
|
||||||
m_NoCameraWarning: 1
|
m_NoCameraWarning: 1
|
||||||
m_LowResolutionForAspectRatios: 00000001000000000000
|
m_LowResolutionForAspectRatios: 00000001000000000000
|
||||||
m_XRRenderMode: 0
|
m_XRRenderMode: 0
|
||||||
m_RenderTexture: {fileID: 0}
|
m_RenderTexture: {fileID: 0}
|
||||||
--- !u!114 &23
|
--- !u!114 &19
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -1338,10 +1206,10 @@ MonoBehaviour:
|
|||||||
m_Tooltip:
|
m_Tooltip:
|
||||||
m_Pos:
|
m_Pos:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 1300
|
x: 1409
|
||||||
y: 843
|
y: 841
|
||||||
width: 648
|
width: 699
|
||||||
height: 508
|
height: 501
|
||||||
m_SerializedDataModeController:
|
m_SerializedDataModeController:
|
||||||
m_DataMode: 0
|
m_DataMode: 0
|
||||||
m_PreferredDataMode: 0
|
m_PreferredDataMode: 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user