浏览代码

added scene populated to a large grid of capsules

/batch_rendering
Arnaud Carre 8 年前
当前提交
e81123d0
共有 10 个文件被更改,包括 255 次插入8 次删除
  1. 51
      Assets/BasicRenderBatching/BasicBatching.unity
  2. 42
      ProjectSettings/ProjectSettings.asset
  3. 9
      Assets/BasicRenderBatching/Prefabs.meta
  4. 9
      Assets/BasicRenderBatching/Scripts.meta
  5. 82
      Assets/BasicRenderBatching/Prefabs/Capsule.prefab
  6. 8
      Assets/BasicRenderBatching/Prefabs/Capsule.prefab.meta
  7. 50
      Assets/BasicRenderBatching/Scripts/PopulateScene.cs
  8. 12
      Assets/BasicRenderBatching/Scripts/PopulateScene.cs.meta

51
Assets/BasicRenderBatching/BasicBatching.unity


- component: {fileID: 870320115}
- component: {fileID: 870320114}
- component: {fileID: 870320113}
- component: {fileID: 870320118}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera

m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowMSAA: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10

m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 870320112}
m_LocalRotation: {x: 0.2672005, y: -0.21772358, z: 0.060980394, w: 0.93674}
m_LocalPosition: {x: 5.91, y: 8.58, z: -18.38}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 31.813, y: -26.21, z: -0.142}
--- !u!114 &870320118
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 870320112}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9dcd15e6e67bc6e44a4583f4d53cdcf8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ObjectPrefab: {fileID: 1877103646185790, guid: b764b667902787f459cc591ec15679db,
type: 2}
m_CenterPoint: {fileID: 970523335}
m_GridWidth: 64
m_Spacing: 0.7
--- !u!1 &970523334
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 970523335}
m_Layer: 0
m_Name: CenterPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &970523335
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 970523334}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalPosition: {x: -2.0520718, y: 0.3634019, z: 1.7976766}
m_RootOrder: 0
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

42
ProjectSettings/ProjectSettings.asset


m_SplashScreenBackgroundPortrait: {fileID: 0}
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidth: 1280
defaultScreenHeight: 720
m_StereoRenderingPath: 0
m_ActiveColorSpace: 1
m_MTRendering: 1
m_MobileMTRendering: 0

metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 0
singlePassStereoRendering: 0
xboxOneEnable7thCore: 0
vrSettings:
cardboard:
depthFormat: 0
enableTransitionView: 0
daydream:
depthFormat: 0
useSustainedPerformanceMode: 0
useHDRDisplay: 0
apiCompatibilityLevel: 2
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0

tvOSSmallIconLayers: []
tvOSLargeIconLayers: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageWideLayers: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}

iOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
appleEnableAutomaticSigning: 0
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}

cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchApplicationID: 0x0005000C10000001
switchNSODependencies:
XboxTitleId:
XboxImageXexPath:
XboxSpaPath:

ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 120
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:

ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
monoEnv:
psp2Splashimage: {fileID: 0}

spritePackerPolicy:
webGLMemorySize: 256
webGLExceptionSupport: 1
webGLNameFilesAsHashes: 0
webGLDataCaching: 0
webGLDebugSymbols: 0
webGLEmscriptenArgs:

incrementalIl2cppBuild:
iOS: 0
additionalIl2CppArgs:
apiCompatibilityLevelPerPlatform: {}
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: dev

XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
vrEditorSettings: {}
xboxOneScriptCompiler: 0
vrEditorSettings:
daydream:
daydreamIconForeground: {fileID: 0}
daydreamIconBackground: {fileID: 0}
cloudServicesEnabled:
Analytics: 0
Build: 0

UNet: 0
Unity_Ads: 0
facebookSdkVersion: 7.8.2
apiCompatibilityLevel: 2
enableNewInputSystem: 0

9
Assets/BasicRenderBatching/Prefabs.meta


fileFormatVersion: 2
guid: 1bc64cc5d7e1dc84793a00cf950d5dbd
folderAsset: yes
timeCreated: 1481128088
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/BasicRenderBatching/Scripts.meta


fileFormatVersion: 2
guid: 97a08e566e8f5c14c80ceecb48f9d409
folderAsset: yes
timeCreated: 1481128135
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

82
Assets/BasicRenderBatching/Prefabs/Capsule.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1877103646185790}
m_IsPrefabParent: 1
--- !u!1 &1877103646185790
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4091326064044868}
- component: {fileID: 33444527381260124}
- component: {fileID: 23341644023392824}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4091326064044868
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1877103646185790}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.0520718, y: 0.3634019, z: 1.7976766}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23341644023392824
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1877103646185790}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 2100000, guid: de48705454e39554fb09f6cd7f8e9cdf, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33444527381260124
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1877103646185790}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}

8
Assets/BasicRenderBatching/Prefabs/Capsule.prefab.meta


fileFormatVersion: 2
guid: b764b667902787f459cc591ec15679db
timeCreated: 1481128093
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

50
Assets/BasicRenderBatching/Scripts/PopulateScene.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PopulateScene : MonoBehaviour {
public GameObject m_ObjectPrefab; //
public Transform m_CenterPoint;
public int m_GridWidth = 16;
public float m_Spacing = 0.6f;
private GameObject[] m_Objects; //
// Use this for initialization
void Start()
{
m_Objects = new GameObject[m_GridWidth * m_GridWidth];
int iIndex = 0;
for (int z = 0; z < m_GridWidth; z++)
{
for (int x = 0; x < m_GridWidth; x++)
{
// int i = z * m_CubesRow + x;
float fX = (x - (m_GridWidth / 2)) * 2;
float fY = 0.0f;
float fZ = (z - (m_GridWidth / 2)) * 2;
Vector3 vPos = new Vector3(fX * m_Spacing, fY, fZ * m_Spacing);
vPos += m_CenterPoint.position;
m_Objects[iIndex] = Instantiate(m_ObjectPrefab, vPos, m_CenterPoint.rotation) as GameObject;
iIndex++;
}
}
}
// Update is called once per frame
void Update ()
{
}
}

12
Assets/BasicRenderBatching/Scripts/PopulateScene.cs.meta


fileFormatVersion: 2
guid: 9dcd15e6e67bc6e44a4583f4d53cdcf8
timeCreated: 1481128119
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存