custom rt added for split-screen

This commit is contained in:
2024-05-06 13:55:55 +01:00
parent 9a9096a57d
commit 811e97547b
25 changed files with 3590 additions and 1049 deletions

View File

@@ -660,10 +660,10 @@
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -860.9999389648438,
"y": 261.9999694824219,
"width": 207.9998779296875,
"height": 434.9999084472656
"x": -851.9998779296875,
"y": 222.99993896484376,
"width": 207.99993896484376,
"height": 435.0
}
},
"m_Slots": [

View File

@@ -15,5 +15,5 @@ MonoBehaviour:
colorMode: 2
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 0, a: 1}
bottomRight: {r: 1, g: 1, b: 0, a: 1}
bottomLeft: {r: 1, g: 1, b: 0, a: 0.8392157}
bottomRight: {r: 1, g: 1, b: 0, a: 0.8392157}

View File

@@ -46,9 +46,9 @@ Material:
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _Bevel: 0.95
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelOffset: 0.5
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
@@ -59,8 +59,8 @@ Material:
- _FaceDilate: 0
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowInner: 0.228
- _GlowOffset: -0.53
- _GlowOuter: 0.05
- _GlowPower: 0.75
- _GradientScale: 6
@@ -86,12 +86,12 @@ Material:
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 512
- _TextureWidth: 512
- _TextureHeight: 256
- _TextureWidth: 256
- _UnderlayDilate: 0
- _UnderlayOffsetX: 0
- _UnderlayOffsetX: -0.52
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _UnderlaySoftness: 0.058
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.75
@@ -100,7 +100,7 @@ Material:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
- _GlowColor: {r: 0, g: 0, b: 0, a: 0.5}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0d7593b3a9277ac4696b20006c21dde2, type: 3}
m_Name: VisualEnvironment
m_EditorClassIdentifier:
active: 1
active: 0
skyType:
m_OverrideState: 1
m_Value: 1
@@ -43,7 +43,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d877a03bef431a847adca8ab343db3e1, type: 3}
m_Name: RayTracingSettings
m_EditorClassIdentifier:
active: 1
active: 0
rayBias:
m_OverrideState: 1
m_Value: 0.001
@@ -83,7 +83,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 42ef2681fa3dc8c4fa031f044e68c63f, type: 3}
m_Name: GlobalIllumination
m_EditorClassIdentifier:
active: 1
active: 0
quality:
m_OverrideState: 1
m_Value: 3
@@ -330,7 +330,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name: HDRISky
m_EditorClassIdentifier:
active: 1
active: 0
rotation:
m_OverrideState: 0
m_Value: 0

File diff suppressed because it is too large Load Diff

8
Assets/7_Shaders/Render Textures.meta generated Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2981530e70e9aa448ab5785a445bb1ac
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 226712f58cdd00644aa5c56c6967767c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@@ -0,0 +1,54 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!86 &8600000
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Input
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 1920
m_Height: 1080
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
m_Material: {fileID: 0}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 1, g: 1, b: 1, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 0
m_InitializationMode: 2
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_WrapUpdateZones: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c4323b1b338033241bb85686dee60610
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8600000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!86 &8600000
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Output
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 1920
m_Height: 1080
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
m_Material: {fileID: 2100000, guid: 37c193d8fedadef4ba101049d13a57da, type: 2}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 1, g: 1, b: 1, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 1
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_WrapUpdateZones: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fcb0aa764eb9d3f46a1154cad303f173
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8600000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,37 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Output
m_Shader: {fileID: -6465566751694194690, guid: 226712f58cdd00644aa5c56c6967767c,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 8600000, guid: c4323b1b338033241bb85686dee60610, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Fuzz: 0.05
- _Range: 0.4
m_Colors:
- _Fuzzines: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37c193d8fedadef4ba101049d13a57da
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,6 +3,7 @@ using FMODUnity;
using System.Collections;
using System.Collections.Generic;
using System.Xml.Serialization;
using Unity.Barracuda;
using UnityEngine;
public class CameraManager : MonoBehaviour
@@ -10,6 +11,7 @@ public class CameraManager : MonoBehaviour
public static CameraManager _instance { get; private set; }
private GameObject m_Brain;
private GameObject m_BrainPose;
private Camera m_Camera;
@@ -49,7 +51,7 @@ public class CameraManager : MonoBehaviour
[Header("Shader")]
public Material m_HumanoidMaterial;
public Color m_BackgroundColor;
public GameObject m_PoseCanvas;
private void Awake()
{
if(_instance != null)
@@ -114,28 +116,39 @@ public class CameraManager : MonoBehaviour
private void SetCullingMask()
{
m_Camera = m_Brain.GetComponent<Camera>();
string currentTag = m_ActiveCamera.tag;
switch (currentTag)
{
case "vc_Agent":
m_Camera.cullingMask = m_Agent;
m_PoseCanvas.SetActive(false);
m_BrainPose.SetActive(false);
m_Rewards.SetActive(true);
break;
case "vc_Body":
m_Camera.cullingMask = m_Bodies;
m_PoseCanvas.SetActive(false);
m_BrainPose.SetActive(false);
m_Rewards.SetActive(false);
break;
case "vc_Environment":
m_Camera.cullingMask = m_Environment;
m_PoseCanvas.SetActive(false);
m_BrainPose.SetActive(false);
m_Rewards.SetActive(false);
break;
case "vc_Actuations":
m_Camera.cullingMask = m_Actuations;
m_PoseCanvas.SetActive(false);
m_BrainPose.SetActive(false);
m_Rewards.SetActive(true);
break;
case "vc_Compare":
m_BrainPose.SetActive(true);
m_Camera.cullingMask = m_Compare;
m_PoseCanvas.SetActive(true);
m_Rewards.SetActive(true);
break;
}
@@ -212,7 +225,7 @@ public class CameraManager : MonoBehaviour
if (AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Body")
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Environment") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Body") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Body")
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Environment") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Agent") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Actuations") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Actuations", "vc_Compare")
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Compare", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Compare"))
|| AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Compare", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Environment", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Body", "vc_Compare") || AreDifferentPairs(pastCamera.tag, m_ActiveCamera.tag, "vc_Agent", "vc_Compare"))
blendtime = 0;
cmBrain.m_DefaultBlend.m_Time = blendtime;
@@ -252,6 +265,8 @@ public class CameraManager : MonoBehaviour
try
{
m_Brain = GameObject.Find("CM Brain");
m_BrainPose = GameObject.Find("CM Brain Compare");
m_BrainPose.SetActive(false);
// Set dissapear color same as sky color
m_Brain.GetComponent<Camera>().backgroundColor = m_BackgroundColor;
Debug.Log(m_BackgroundColor);

View File

@@ -136,7 +136,7 @@ Material:
m_Floats:
- Boolean_43476D73: 1
- Boolean_D258FF8E: 0
- Vector1_B2CC132F: 150
- Vector1_B2CC132F: 100
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1

28
Assets/LockTarget.cs Normal file
View File

@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LockTarget : MonoBehaviour
{
public Transform m_Object;
private Vector3 m_Position;
private Quaternion m_Rotation;
private void OnEnable(){
m_Position = m_Object.position;
m_Rotation = m_Object.rotation;
Debug.Log($"{m_Position} pos");
}
void FixedUpdate()
{
Vector3 newPosition = m_Object.position;
Vector3 normPosition = new Vector3(newPosition.x, m_Position.y, newPosition.z);
this.transform.position = normPosition;
Quaternion newRotation = m_Object.rotation;
this.transform.rotation = new Quaternion(m_Rotation.x, newRotation.y, m_Rotation.z, m_Rotation.w);
}
}

11
Assets/LockTarget.cs.meta generated Normal file
View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c62f8ce80ff3a614081b38c92965d2e8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1 +1 @@
{"count":1,"self":272.99686399999996,"total":284.6023555,"children":{"InitializeActuators":{"count":1,"self":0.0019219999999999999,"total":0.0019219999999999999,"children":null},"InitializeSensors":{"count":1,"self":0.0010068,"total":0.0010068,"children":null},"AgentSendState":{"count":15939,"self":0.1131654,"total":3.3211584,"children":{"CollectObservations":{"count":7970,"self":3.1549168,"total":3.1549169,"children":null},"WriteActionMask":{"count":7970,"self":0.0127637,"total":0.0127637,"children":null},"RequestDecision":{"count":7970,"self":0.0403124,"total":0.0403124,"children":null}}},"DecideAction":{"count":15939,"self":5.5549684,"total":5.5549684999999993,"children":null},"AgentAct":{"count":15939,"self":2.7264304,"total":2.7264304999999998,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714664785","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId 248251cd-5a9d-4a44-91c6-3370a1b135fe -accessToken BnQiYrkvRzpz0grwCj15aMOktGBObxw7xMhcprI-7p8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1714665070"}}
{"count":1,"self":104.7428032,"total":108.5208207,"children":{"InitializeActuators":{"count":1,"self":0.0010069999999999999,"total":0.0010069999999999999,"children":null},"InitializeSensors":{"count":1,"self":0.0010061999999999998,"total":0.0010061999999999998,"children":null},"AgentSendState":{"count":6062,"self":0.0447559,"total":0.8942901,"children":{"CollectObservations":{"count":3031,"self":0.8284363,"total":0.8284363,"children":null},"WriteActionMask":{"count":3031,"self":0.0049813,"total":0.0049813,"children":null},"RequestDecision":{"count":3031,"self":0.0161166,"total":0.0161166,"children":null}}},"DecideAction":{"count":6062,"self":2.023058,"total":2.023058,"children":null},"AgentAct":{"count":6062,"self":0.8586533,"total":0.8586533,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1715000019","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\drecon-unity -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-cail -hubSessionId 82a25a73-b97d-4e4f-9ce1-4f9d1a407a8a -accessToken WbefIG1m4YyKBMpiig8QNXYYo0ekcIpB29rlm8ghtks005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1715000127"}}

View File

@@ -1,78 +1,113 @@
fileFormatVersion: 2
guid: 684d4d47a018ed14080e15f4c99b8e86
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
Linux:
enabled: 1
settings:
CPU: None
Linux64:
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel:
enabled: 1
settings:
CPU: None
OSXIntel64:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
enabled: 0
settings:
STV_MODEL: STANDARD_13
WP8:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
Win:
enabled: 0
settings:
CPU: None
Win64:
enabled: 1
settings:
CPU: AnyCPU
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
iOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 684d4d47a018ed14080e15f4c99b8e86
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Linux
second:
enabled: 1
settings:
CPU: None
- first:
: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
: OSXIntel
second:
enabled: 1
settings:
CPU: None
- first:
: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
: SamsungTV
second:
enabled: 0
settings:
STV_MODEL: STANDARD_13
- first:
: WP8
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
- first:
Android: Android
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -22,6 +22,7 @@ PluginImporter:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Win64