Add Bakery
This commit is contained in:
parent
2b9669daac
commit
fdd88dc640
9
Assets/Bakery.meta
Normal file
9
Assets/Bakery.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ef503d75f14abe345b5bedf4d40fa2dd
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
6
Assets/Bakery/BakeryAlwaysRender.cs
Normal file
6
Assets/Bakery/BakeryAlwaysRender.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class BakeryAlwaysRender : MonoBehaviour {
|
||||||
|
}
|
12
Assets/Bakery/BakeryAlwaysRender.cs.meta
Normal file
12
Assets/Bakery/BakeryAlwaysRender.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e2d6e02e134906942bad71c1434453fa
|
||||||
|
timeCreated: 1561146394
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
107
Assets/Bakery/BakeryDirectLight.cs
Normal file
107
Assets/Bakery/BakeryDirectLight.cs
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class BakeryDirectLight : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Color color = Color.white;
|
||||||
|
public float intensity = 1.0f;
|
||||||
|
public float shadowSpread = 0.01f;//0.05f;
|
||||||
|
public int samples = 16;
|
||||||
|
//public uint bitmask = 1;
|
||||||
|
public int bitmask = 1;
|
||||||
|
public bool bakeToIndirect = false;
|
||||||
|
public bool shadowmask = false;
|
||||||
|
public bool shadowmaskDenoise = false;
|
||||||
|
public float indirectIntensity = 1.0f;
|
||||||
|
public Texture2D cloudShadow;
|
||||||
|
public float cloudShadowTilingX = 0.01f;
|
||||||
|
public float cloudShadowTilingY = 0.01f;
|
||||||
|
public float cloudShadowOffsetX, cloudShadowOffsetY;
|
||||||
|
|
||||||
|
public int UID;
|
||||||
|
|
||||||
|
public static int lightsChanged = 0; // 1 = const, 2 = full
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
void OnValidate()
|
||||||
|
{
|
||||||
|
if (lightsChanged == 0) lightsChanged = 1;
|
||||||
|
}
|
||||||
|
void OnEnable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (gameObject.GetComponent<BakerySkyLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryPointLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryLightMesh>() != null)
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Bakery", "Can't have more than one Bakery light on one object", "OK");
|
||||||
|
DestroyImmediate(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (UID == 0) UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
if (UID == 0) return;
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
ftUniqueIDRegistry.Deregister(UID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (!ftUniqueIDRegistry.Mapping.ContainsKey(UID)) ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
if (gameObject.GetInstanceID() != ftUniqueIDRegistry.GetInstanceId(UID))
|
||||||
|
{
|
||||||
|
UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
Gizmos.color = Color.yellow;
|
||||||
|
Gizmos.DrawSphere(transform.position, 0.1f);
|
||||||
|
|
||||||
|
//Gizmos.DrawWireSphere(transform.position, 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmosSelected()
|
||||||
|
{
|
||||||
|
Gizmos.color = Color.yellow;
|
||||||
|
var endPoint = transform.position + transform.forward * 2;
|
||||||
|
Gizmos.DrawLine(transform.position, endPoint);
|
||||||
|
|
||||||
|
//Gizmos.color = Color.blue;
|
||||||
|
Gizmos.DrawWireSphere(transform.position, 0.2f);
|
||||||
|
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position + transform.right - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position - transform.right - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position + transform.up - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position - transform.up - endPoint).normalized * 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/BakeryDirectLight.cs.meta
Normal file
12
Assets/Bakery/BakeryDirectLight.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c74ce2158ae608549902afb4112fd042
|
||||||
|
timeCreated: 1526382158
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
83
Assets/Bakery/BakeryLightMesh.cs
Normal file
83
Assets/Bakery/BakeryLightMesh.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class BakeryLightMesh : MonoBehaviour
|
||||||
|
{
|
||||||
|
public int UID;
|
||||||
|
|
||||||
|
public Color color = Color.white;
|
||||||
|
public float intensity = 1.0f;
|
||||||
|
public Texture2D texture = null;
|
||||||
|
public float cutoff = 100;
|
||||||
|
public int samples = 256;
|
||||||
|
public int samples2 = 16;
|
||||||
|
public int bitmask = 1;
|
||||||
|
public bool selfShadow = true;
|
||||||
|
public bool bakeToIndirect = true;
|
||||||
|
public float indirectIntensity = 1.0f;
|
||||||
|
|
||||||
|
public int lmid = -2;
|
||||||
|
|
||||||
|
public static int lightsChanged = 0;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
void OnValidate()
|
||||||
|
{
|
||||||
|
if (lightsChanged == 0) lightsChanged = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (gameObject.GetComponent<BakeryDirectLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryPointLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakerySkyLight>() != null)
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Bakery", "Can't have more than one Bakery light on one object", "OK");
|
||||||
|
DestroyImmediate(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
|
||||||
|
if (UID == 0) UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
if (UID == 0) return;
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
ftUniqueIDRegistry.Deregister(UID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (!ftUniqueIDRegistry.Mapping.ContainsKey(UID)) ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
if (gameObject.GetInstanceID() != ftUniqueIDRegistry.GetInstanceId(UID))
|
||||||
|
{
|
||||||
|
UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void OnDrawGizmosSelected()
|
||||||
|
{
|
||||||
|
Gizmos.color = Color.yellow;
|
||||||
|
var mr = gameObject.GetComponent<MeshRenderer>();
|
||||||
|
if (mr!=null) Gizmos.DrawWireSphere(mr.bounds.center, cutoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
12
Assets/Bakery/BakeryLightMesh.cs.meta
Normal file
12
Assets/Bakery/BakeryLightMesh.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a28e27cacfc7e70479097f0a63c37217
|
||||||
|
timeCreated: 1526382158
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
174
Assets/Bakery/BakeryLightmapGroup.cs
Normal file
174
Assets/Bakery/BakeryLightmapGroup.cs
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public struct BakeryLightmapGroupPlain
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public int resolution, id, renderMode, renderDirMode, atlasPacker;
|
||||||
|
public bool vertexBake;
|
||||||
|
public bool containsTerrains;
|
||||||
|
public bool probes;
|
||||||
|
public bool isImplicit;
|
||||||
|
public bool computeSSS;
|
||||||
|
public int sssSamples;
|
||||||
|
public float sssDensity;
|
||||||
|
public float sssR, sssG, sssB;
|
||||||
|
public float fakeShadowBias;
|
||||||
|
public bool transparentSelfShadow;
|
||||||
|
public bool flipNormal;
|
||||||
|
public string parentName;
|
||||||
|
public int sceneLodLevel;
|
||||||
|
};
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Bakery lightmap group")]
|
||||||
|
public class BakeryLightmapGroup : ScriptableObject
|
||||||
|
{
|
||||||
|
public enum ftLMGroupMode
|
||||||
|
{
|
||||||
|
OriginalUV = 0,
|
||||||
|
PackAtlas = 1,
|
||||||
|
Vertex = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
public enum RenderMode
|
||||||
|
{
|
||||||
|
FullLighting = 0,
|
||||||
|
Indirect = 1,
|
||||||
|
Shadowmask = 2,
|
||||||
|
Subtractive = 3,
|
||||||
|
AmbientOcclusionOnly = 4,
|
||||||
|
Auto = 1000
|
||||||
|
};
|
||||||
|
|
||||||
|
public enum RenderDirMode
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
BakedNormalMaps = 1,
|
||||||
|
DominantDirection = 2,
|
||||||
|
RNM = 3,
|
||||||
|
SH = 4,
|
||||||
|
ProbeSH = 5,
|
||||||
|
Auto = 1000
|
||||||
|
};
|
||||||
|
|
||||||
|
public enum AtlasPacker
|
||||||
|
{
|
||||||
|
Default = 0,
|
||||||
|
xatlas = 1,
|
||||||
|
Auto = 1000
|
||||||
|
};
|
||||||
|
|
||||||
|
[SerializeField, Range(1, 8192)]
|
||||||
|
public int resolution = 512;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int bitmask = 1;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int id = -1;
|
||||||
|
|
||||||
|
public int sortingID = -1;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool isImplicit = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public float area = 0.0f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int totalVertexCount = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int vertexCounter = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int sceneLodLevel = -1;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string sceneName;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool containsTerrains;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool probes;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public ftLMGroupMode mode = ftLMGroupMode.PackAtlas;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public RenderMode renderMode = RenderMode.Auto;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public RenderDirMode renderDirMode = RenderDirMode.Auto;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public AtlasPacker atlasPacker = AtlasPacker.Auto;
|
||||||
|
|
||||||
|
//[SerializeField]
|
||||||
|
//public bool aoIsThickness = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool computeSSS = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public int sssSamples = 16;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public float sssDensity = 10;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public Color sssColor = Color.white;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public float fakeShadowBias = 0.0f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool transparentSelfShadow = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool flipNormal = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string parentName;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string overridePath = "";
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool fixPos3D = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public Vector3 voxelSize = Vector3.one;
|
||||||
|
|
||||||
|
public BakeryLightmapGroupPlain GetPlainStruct()
|
||||||
|
{
|
||||||
|
BakeryLightmapGroupPlain str;
|
||||||
|
str.name = name;
|
||||||
|
str.id = id;
|
||||||
|
str.resolution = resolution;
|
||||||
|
str.vertexBake = mode == ftLMGroupMode.Vertex;
|
||||||
|
str.isImplicit = isImplicit;
|
||||||
|
str.renderMode = (int)renderMode;
|
||||||
|
str.renderDirMode = (int)renderDirMode;
|
||||||
|
str.atlasPacker = (int)atlasPacker;
|
||||||
|
str.computeSSS = computeSSS;
|
||||||
|
str.sssSamples = sssSamples;
|
||||||
|
str.sssDensity = sssDensity;
|
||||||
|
str.sssR = sssColor.r;
|
||||||
|
str.sssG = sssColor.g;
|
||||||
|
str.sssB = sssColor.b;
|
||||||
|
str.containsTerrains = containsTerrains;
|
||||||
|
str.probes = probes;
|
||||||
|
str.fakeShadowBias = fakeShadowBias;
|
||||||
|
str.transparentSelfShadow = transparentSelfShadow;
|
||||||
|
str.flipNormal = flipNormal;
|
||||||
|
str.parentName = parentName;
|
||||||
|
str.sceneLodLevel = sceneLodLevel;
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/BakeryLightmapGroup.cs.meta
Normal file
12
Assets/Bakery/BakeryLightmapGroup.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ec0b4dd729a12d046982652f834580a2
|
||||||
|
timeCreated: 1526381368
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Bakery/BakeryLightmapGroupSelector.cs
Normal file
9
Assets/Bakery/BakeryLightmapGroupSelector.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class BakeryLightmapGroupSelector : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Object lmgroupAsset;
|
||||||
|
public bool instanceResolutionOverride = false;
|
||||||
|
public int instanceResolution = 256;
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/BakeryLightmapGroupSelector.cs.meta
Normal file
12
Assets/Bakery/BakeryLightmapGroupSelector.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a747f33c53bd3042af4ac90fc2a1fd3
|
||||||
|
timeCreated: 1526383988
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
130
Assets/Bakery/BakeryLightmappedPrefab.cs
Normal file
130
Assets/Bakery/BakeryLightmappedPrefab.cs
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Disable 'obsolete' warnings
|
||||||
|
#pragma warning disable 0618
|
||||||
|
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class BakeryLightmappedPrefab : MonoBehaviour
|
||||||
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public bool enableBaking = true;
|
||||||
|
public string errorMessage;
|
||||||
|
|
||||||
|
public bool IsValid()
|
||||||
|
{
|
||||||
|
errorMessage = "";
|
||||||
|
|
||||||
|
if (!enableBaking)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isPartOfPrefab = PrefabUtility.GetPrefabType(gameObject) == PrefabType.PrefabInstance;
|
||||||
|
if (!isPartOfPrefab)
|
||||||
|
{
|
||||||
|
errorMessage = "this GameObject is not a prefab";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool prefabIsRoot = PrefabUtility.FindPrefabRoot(gameObject) == gameObject;
|
||||||
|
if (!prefabIsRoot)
|
||||||
|
{
|
||||||
|
errorMessage = "this GameObject is not a root prefab object";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var transforms = GetComponentsInChildren<Transform>();
|
||||||
|
for(int i=0; i<transforms.Length; i++)
|
||||||
|
{
|
||||||
|
if (PrefabUtility.FindPrefabRoot(transforms[i].gameObject) != gameObject)
|
||||||
|
{
|
||||||
|
errorMessage = "prefab contains unapplied object (" + transforms[i].name + ")";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var prefabRootObj = PrefabUtility.GetPrefabObject(gameObject);
|
||||||
|
//var prefabRootObj2 = PrefabUtility.FindPrefabRoot(gameObject);
|
||||||
|
|
||||||
|
var mods = PrefabUtility.GetPropertyModifications(gameObject);
|
||||||
|
if (mods != null)
|
||||||
|
{
|
||||||
|
for(int i=0; i<mods.Length; i++)
|
||||||
|
{
|
||||||
|
if (mods[i] == null) continue;
|
||||||
|
#if UNITY_2018_3_OR_NEWER
|
||||||
|
if (PrefabUtility.IsDefaultOverride(mods[i])) continue;
|
||||||
|
#endif
|
||||||
|
if (mods[i].propertyPath == "m_RootOrder") continue;
|
||||||
|
if (mods[i].propertyPath == "errorMessage") continue;
|
||||||
|
if (mods[i].propertyPath == "enableBaking") continue;
|
||||||
|
if (mods[i].propertyPath.IndexOf("idremap") >= 0) continue;
|
||||||
|
if (mods[i].target != null && mods[i].target.name == gameObject.name)
|
||||||
|
{
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalPosition")) continue;
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalRotation")) continue;
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalScale")) continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
errorMessage = "prefab contains unapplied data (" + mods[i].target+"."+mods[i].propertyPath + ")";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var comps = gameObject.GetComponents<Component>();
|
||||||
|
var comps2 = gameObject.GetComponentsInChildren<Component>();
|
||||||
|
|
||||||
|
for(int t=0; t<2; t++)
|
||||||
|
{
|
||||||
|
var comps3 = t == 0 ? comps : comps2;
|
||||||
|
for(int c=0; c<comps3.Length; c++)
|
||||||
|
{
|
||||||
|
var prefabObj = PrefabUtility.GetPrefabObject(comps3[c]);
|
||||||
|
if (prefabObj != prefabRootObj)
|
||||||
|
{
|
||||||
|
errorMessage = "prefab contains unapplied component (" + comps3[c] + ")";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*bool isRoot = comps3[c].gameObject == gameObject;
|
||||||
|
|
||||||
|
var mods = PrefabUtility.GetPropertyModifications(comps3[c]);
|
||||||
|
if (mods == null) continue;
|
||||||
|
for(int i=0; i<mods.Length; i++)
|
||||||
|
{
|
||||||
|
if (mods[i].propertyPath == "m_RootOrder") continue;
|
||||||
|
if (isRoot)
|
||||||
|
{
|
||||||
|
if (mods[i].propertyPath == "errorMessage") continue;
|
||||||
|
if (mods[i].propertyPath == "enableBaking") continue;
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalPosition")) continue;
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalRotation")) continue;
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalScale")) continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mods[i].propertyPath.Contains("m_LocalPosition"))
|
||||||
|
{
|
||||||
|
var dist = (comps3[c].transform.position - (PrefabUtility.GetPrefabParent(comps3[c].gameObject) as GameObject).transform.position).sqrMagnitude;
|
||||||
|
Debug.LogError(dist);
|
||||||
|
if (dist < 0.001f) continue;
|
||||||
|
}
|
||||||
|
else if (mods[i].propertyPath.Contains("m_LocalRotation"))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
errorMessage = "Error: prefab contains unapplied data (" + mods[i].target+"."+mods[i].propertyPath + ")";
|
||||||
|
return false;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/BakeryLightmappedPrefab.cs.meta
Normal file
12
Assets/Bakery/BakeryLightmappedPrefab.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6090ef81e51c0ad4da5a1a37e6cf65cf
|
||||||
|
timeCreated: 1541703042
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
68
Assets/Bakery/BakeryMetaPass.cginc
Normal file
68
Assets/Bakery/BakeryMetaPass.cginc
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
#ifndef BAKERY_META
|
||||||
|
#define BAKERY_META
|
||||||
|
|
||||||
|
Texture2D bestFitNormalMap;
|
||||||
|
|
||||||
|
struct BakeryMetaInput
|
||||||
|
{
|
||||||
|
float2 uv0 : TEXCOORD0;
|
||||||
|
float2 uv1 : TEXCOORD1;
|
||||||
|
float3 normal : NORMAL;
|
||||||
|
#ifndef _TERRAIN_NORMAL_MAP
|
||||||
|
float4 tangent : TANGENT;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f_bakeryMeta
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float3 normal : TEXCOORD1;
|
||||||
|
float3 tangent : TEXCOORD2;
|
||||||
|
float3 binormal : TEXCOORD3;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f_bakeryMeta vert_bakerymt (BakeryMetaInput v)
|
||||||
|
{
|
||||||
|
v2f_bakeryMeta o;
|
||||||
|
o.pos = float4(((v.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw)*2-1) * float2(1,-1), 0.5, 1);
|
||||||
|
o.uv = v.uv0;
|
||||||
|
o.normal = normalize(mul((float3x3)unity_ObjectToWorld, v.normal).xyz);
|
||||||
|
|
||||||
|
#ifdef _TERRAIN_NORMAL_MAP
|
||||||
|
o.tangent = cross(o.normal, float3(0,0,1));
|
||||||
|
o.binormal = cross(o.normal, o.tangent) * -1;
|
||||||
|
#else
|
||||||
|
o.tangent = normalize(mul((float3x3)unity_ObjectToWorld, v.tangent.xyz).xyz);
|
||||||
|
o.binormal = cross(o.normal, o.tangent) * v.tangent.w;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
float3 EncodeNormalBestFit(float3 n)
|
||||||
|
{
|
||||||
|
float3 nU = abs(n);
|
||||||
|
float maxNAbs = max(nU.z, max(nU.x, nU.y));
|
||||||
|
float2 TC = nU.z<maxNAbs? (nU.y<maxNAbs? nU.yz : nU.xz) : nU.xy;
|
||||||
|
//if (TC.x != TC.y)
|
||||||
|
//{
|
||||||
|
TC = TC.x<TC.y? TC.yx : TC.xy;
|
||||||
|
TC.y /= TC.x;
|
||||||
|
|
||||||
|
n /= maxNAbs;
|
||||||
|
float fittingScale = bestFitNormalMap.Load(int3(TC.x*1023, TC.y*1023, 0)).a;
|
||||||
|
n *= fittingScale;
|
||||||
|
//}
|
||||||
|
return n*0.5+0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
float3 TransformNormalMapToWorld(v2f_bakeryMeta i, float3 tangentNormalMap)
|
||||||
|
{
|
||||||
|
float3x3 TBN = float3x3(normalize(i.tangent), normalize(i.binormal), normalize(i.normal));
|
||||||
|
return mul(tangentNormalMap, TBN);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BakeryEncodeNormal EncodeNormalBestFit
|
||||||
|
|
||||||
|
#endif
|
9
Assets/Bakery/BakeryMetaPass.cginc.meta
Normal file
9
Assets/Bakery/BakeryMetaPass.cginc.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1d6fa63b3a54ade469dc0fa038f0c81b
|
||||||
|
timeCreated: 1538849880
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
6
Assets/Bakery/BakeryPackAsSingleSquare.cs
Normal file
6
Assets/Bakery/BakeryPackAsSingleSquare.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class BakeryPackAsSingleSquare : MonoBehaviour {
|
||||||
|
}
|
12
Assets/Bakery/BakeryPackAsSingleSquare.cs.meta
Normal file
12
Assets/Bakery/BakeryPackAsSingleSquare.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cf72c611dfa77174e811af15d6ba69da
|
||||||
|
timeCreated: 1580818526
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
177
Assets/Bakery/BakeryPointLight.cs
Normal file
177
Assets/Bakery/BakeryPointLight.cs
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class BakeryPointLight : MonoBehaviour
|
||||||
|
{
|
||||||
|
public enum ftLightProjectionMode
|
||||||
|
{
|
||||||
|
Omni = 0,
|
||||||
|
Cookie = 1,
|
||||||
|
Cubemap = 2,
|
||||||
|
IES = 3,
|
||||||
|
Cone = 4
|
||||||
|
};
|
||||||
|
|
||||||
|
public int UID;
|
||||||
|
public Color color = Color.white;
|
||||||
|
public float intensity = 1.0f;
|
||||||
|
public float shadowSpread = 0.05f;
|
||||||
|
public float cutoff = 10.0f;
|
||||||
|
public bool realisticFalloff = false;
|
||||||
|
public int samples = 8;
|
||||||
|
public ftLightProjectionMode projMode;
|
||||||
|
public Texture2D cookie;
|
||||||
|
public float angle = 30.0f;
|
||||||
|
public float innerAngle = 0;
|
||||||
|
public Cubemap cubemap;
|
||||||
|
public UnityEngine.Object iesFile;
|
||||||
|
public int bitmask = 1;
|
||||||
|
public bool bakeToIndirect = false;
|
||||||
|
public bool shadowmask = false;
|
||||||
|
public float indirectIntensity = 1.0f;
|
||||||
|
public float falloffMinRadius = 1.0f;
|
||||||
|
public int shadowmaskGroupID = 0;
|
||||||
|
|
||||||
|
const float GIZMO_MAXSIZE = 0.1f;
|
||||||
|
const float GIZMO_SCALE = 0.01f;
|
||||||
|
float screenRadius = GIZMO_MAXSIZE;
|
||||||
|
|
||||||
|
public static int lightsChanged = 0; // 1 = const, 2 = full
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
void OnValidate()
|
||||||
|
{
|
||||||
|
if (lightsChanged == 0) lightsChanged = 1;
|
||||||
|
}
|
||||||
|
void OnEnable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (gameObject.GetComponent<BakeryDirectLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakerySkyLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryLightMesh>() != null)
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Bakery", "Can't have more than one Bakery light on one object", "OK");
|
||||||
|
DestroyImmediate(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (UID == 0) UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
if (UID == 0) return;
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
ftUniqueIDRegistry.Deregister(UID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (!ftUniqueIDRegistry.Mapping.ContainsKey(UID)) ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
if (gameObject.GetInstanceID() != ftUniqueIDRegistry.GetInstanceId(UID))
|
||||||
|
{
|
||||||
|
UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
Gizmos.color = color;
|
||||||
|
var curCam = Camera.current;
|
||||||
|
if (curCam != null)
|
||||||
|
{
|
||||||
|
screenRadius = Mathf.Min((transform.position - curCam.transform.position).magnitude * GIZMO_SCALE, GIZMO_MAXSIZE);
|
||||||
|
}
|
||||||
|
Gizmos.DrawSphere(transform.position, screenRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawArrow(Vector3 a, Vector3 b)
|
||||||
|
{
|
||||||
|
//const float len = 0.125f;
|
||||||
|
|
||||||
|
b = a + b * (shadowSpread + 0.05f);
|
||||||
|
Gizmos.DrawLine(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmosSelected()
|
||||||
|
{
|
||||||
|
Gizmos.color = color;//Color.yellow;
|
||||||
|
Gizmos.DrawWireSphere(transform.position, shadowSpread);
|
||||||
|
|
||||||
|
Gizmos.color = new Color(color.r, color.g, color.b, 0.25f);//Color.gray;
|
||||||
|
if (projMode != ftLightProjectionMode.Cookie && projMode != ftLightProjectionMode.Cone) Gizmos.DrawWireSphere(transform.position, cutoff);
|
||||||
|
|
||||||
|
if (projMode != 0)
|
||||||
|
{
|
||||||
|
Gizmos.color = color;//Color.yellow;
|
||||||
|
Vector3 endPoint;
|
||||||
|
if (projMode == ftLightProjectionMode.Cookie || projMode == ftLightProjectionMode.Cone)
|
||||||
|
{
|
||||||
|
endPoint = transform.forward * 2;
|
||||||
|
Gizmos.DrawRay(transform.position, endPoint);
|
||||||
|
|
||||||
|
float angle2 = (180 - angle) * Mathf.Deg2Rad * 0.5f;
|
||||||
|
//float x = Mathf.Cos(angle2);
|
||||||
|
//float radius = x * cutoff;
|
||||||
|
|
||||||
|
float x = 1 / Mathf.Sin(angle2);
|
||||||
|
x = Mathf.Sqrt(x * x - 1);
|
||||||
|
float radius = x * cutoff;
|
||||||
|
|
||||||
|
const int segments = 16;
|
||||||
|
for(int i=0; i<segments; i++)
|
||||||
|
{
|
||||||
|
float p1 = i / (float)segments;
|
||||||
|
float p2 = (i+1) / (float)segments;
|
||||||
|
|
||||||
|
float x1 = Mathf.Cos(p1 * Mathf.PI*2);
|
||||||
|
float y1 = Mathf.Sin(p1 * Mathf.PI*2);
|
||||||
|
|
||||||
|
float x2 = Mathf.Cos(p2 * Mathf.PI*2);
|
||||||
|
float y2 = Mathf.Sin(p2 * Mathf.PI*2);
|
||||||
|
|
||||||
|
Vector3 A = transform.position + transform.forward * cutoff + transform.right * x1 * radius + transform.up * y1 * radius;
|
||||||
|
Vector3 B = transform.position + transform.forward * cutoff + transform.right * x2 * radius + transform.up * y2 * radius;
|
||||||
|
Gizmos.DrawLine(A, B);
|
||||||
|
|
||||||
|
if (i % 4 == 0) Gizmos.DrawLine(transform.position, A);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
endPoint = -transform.up * 2;
|
||||||
|
Gizmos.DrawRay(transform.position, endPoint);
|
||||||
|
}
|
||||||
|
endPoint += transform.position;
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position + transform.right - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position - transform.right - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position + transform.up - endPoint).normalized * 0.5f);
|
||||||
|
Gizmos.DrawLine(endPoint, endPoint + (transform.position - transform.up - endPoint).normalized * 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
12
Assets/Bakery/BakeryPointLight.cs.meta
Normal file
12
Assets/Bakery/BakeryPointLight.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 57f24a4aaa0761b45ba25e7e5108e2c7
|
||||||
|
timeCreated: 1526382158
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
3
Assets/Bakery/BakeryRuntimeAssembly.asmdef
Normal file
3
Assets/Bakery/BakeryRuntimeAssembly.asmdef
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"name": "BakeryRuntimeAssembly"
|
||||||
|
}
|
8
Assets/Bakery/BakeryRuntimeAssembly.asmdef.meta
Normal file
8
Assets/Bakery/BakeryRuntimeAssembly.asmdef.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a1653399f63795746b1857281d1e400d
|
||||||
|
timeCreated: 1551814785
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
120
Assets/Bakery/BakerySkyLight.cs
Normal file
120
Assets/Bakery/BakerySkyLight.cs
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[DisallowMultipleComponent]
|
||||||
|
public class BakerySkyLight : MonoBehaviour
|
||||||
|
{
|
||||||
|
public string texName = "sky.dds";
|
||||||
|
public Color color = Color.white;
|
||||||
|
public float intensity = 1.0f;
|
||||||
|
public int samples = 32;
|
||||||
|
public bool hemispherical = false;
|
||||||
|
public int bitmask = 1;
|
||||||
|
public bool bakeToIndirect = true;
|
||||||
|
public float indirectIntensity = 1.0f;
|
||||||
|
public bool tangentSH = false;
|
||||||
|
public bool correctRotation = false;
|
||||||
|
|
||||||
|
public Cubemap cubemap;
|
||||||
|
|
||||||
|
public int UID;
|
||||||
|
|
||||||
|
public static int lightsChanged = 0; // 1 = const, 2 = full
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
void OnValidate()
|
||||||
|
{
|
||||||
|
if (lightsChanged == 0) lightsChanged = 1;
|
||||||
|
}
|
||||||
|
void OnEnable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
lightsChanged = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (gameObject.GetComponent<BakeryDirectLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryPointLight>() != null ||
|
||||||
|
gameObject.GetComponent<BakeryLightMesh>() != null)
|
||||||
|
{
|
||||||
|
EditorUtility.DisplayDialog("Bakery", "Can't have more than one Bakery light on one object", "OK");
|
||||||
|
DestroyImmediate(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (UID == 0) UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
if (UID == 0) return;
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
ftUniqueIDRegistry.Deregister(UID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode) return;
|
||||||
|
if (!ftUniqueIDRegistry.Mapping.ContainsKey(UID)) ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
if (gameObject.GetInstanceID() != ftUniqueIDRegistry.GetInstanceId(UID))
|
||||||
|
{
|
||||||
|
UID = Guid.NewGuid().GetHashCode();
|
||||||
|
ftUniqueIDRegistry.Register(UID, gameObject.GetInstanceID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
Gizmos.color = new Color(49/255.0f, 91/255.0f, 191/255.0f);
|
||||||
|
Gizmos.DrawSphere(transform.position, 0.1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDrawGizmosSelected()
|
||||||
|
{
|
||||||
|
Gizmos.color = new Color(49/255.0f, 91/255.0f, 191/255.0f);
|
||||||
|
Vector3 origin = transform.position;
|
||||||
|
const int segments = 16;
|
||||||
|
for(int i=0; i<segments; i++)
|
||||||
|
{
|
||||||
|
float p1 = i / (float)segments;
|
||||||
|
float p2 = (i+1) / (float)segments;
|
||||||
|
|
||||||
|
float x1 = Mathf.Cos(p1 * Mathf.PI*2);
|
||||||
|
float y1 = Mathf.Sin(p1 * Mathf.PI*2);
|
||||||
|
|
||||||
|
float x2 = Mathf.Cos(p2 * Mathf.PI*2);
|
||||||
|
float y2 = Mathf.Sin(p2 * Mathf.PI*2);
|
||||||
|
|
||||||
|
Gizmos.DrawLine(origin + new Vector3(x1,0,y1), origin + new Vector3(x2,0,y2));
|
||||||
|
|
||||||
|
if (hemispherical)
|
||||||
|
{
|
||||||
|
x1 = Mathf.Cos(p1 * Mathf.PI);
|
||||||
|
y1 = Mathf.Sin(p1 * Mathf.PI);
|
||||||
|
|
||||||
|
x2 = Mathf.Cos(p2 * Mathf.PI);
|
||||||
|
y2 = Mathf.Sin(p2 * Mathf.PI);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gizmos.DrawLine(origin + new Vector3(x1,y1,0), origin + new Vector3(x2,y2,0));
|
||||||
|
Gizmos.DrawLine(origin + new Vector3(0,y1,x1), origin + new Vector3(0,y2,x2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/BakerySkyLight.cs.meta
Normal file
12
Assets/Bakery/BakerySkyLight.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 306a56f30ff21b5439963fc745cfe9cc
|
||||||
|
timeCreated: 1526382158
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
260
Assets/Bakery/BakeryVolume.cs
Normal file
260
Assets/Bakery/BakeryVolume.cs
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.IMGUI.Controls;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class BakeryVolume : MonoBehaviour
|
||||||
|
{
|
||||||
|
public enum Encoding
|
||||||
|
{
|
||||||
|
// HDR L1 SH, half-float:
|
||||||
|
// Tex0 = L0, L1z.r
|
||||||
|
// Tex1 = L1x, L1z.g
|
||||||
|
// Tex2 = L1y, L1z.b
|
||||||
|
Half4,
|
||||||
|
|
||||||
|
// LDR L1 SH, 8-bit. Components are stored the same way as in Half4,
|
||||||
|
// but L1 must be unpacked following way:
|
||||||
|
// L1n = (L1n * 2 - 1) * L0 * 0.5 + 0.5
|
||||||
|
RGBA8,
|
||||||
|
|
||||||
|
// LDR L1 SH with monochrome directional component (= single color and direction), 8-bit.
|
||||||
|
// Tex0 = L0 (alpha unused)
|
||||||
|
// Tex1 = L1xyz (alpha unused)
|
||||||
|
RGBA8Mono
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ShadowmaskEncoding
|
||||||
|
{
|
||||||
|
RGBA8,
|
||||||
|
A8
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool enableBaking = true;
|
||||||
|
public Bounds bounds = new Bounds(Vector3.zero, Vector3.one);
|
||||||
|
public bool adaptiveRes = true;
|
||||||
|
public float voxelsPerUnit = 0.5f;
|
||||||
|
public int resolutionX = 16;
|
||||||
|
public int resolutionY = 16;
|
||||||
|
public int resolutionZ = 16;
|
||||||
|
public Encoding encoding = Encoding.Half4;
|
||||||
|
public ShadowmaskEncoding shadowmaskEncoding = ShadowmaskEncoding.RGBA8;
|
||||||
|
public bool denoise = false;
|
||||||
|
public bool isGlobal = false;
|
||||||
|
public Texture3D bakedTexture0, bakedTexture1, bakedTexture2, bakedMask;
|
||||||
|
|
||||||
|
public static BakeryVolume globalVolume;
|
||||||
|
|
||||||
|
//public bool adjustSamples = true;
|
||||||
|
|
||||||
|
public Vector3 GetMin()
|
||||||
|
{
|
||||||
|
return bounds.min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetInvSize()
|
||||||
|
{
|
||||||
|
var b = bounds;
|
||||||
|
return new Vector3(1.0f/b.size.x, 1.0f/b.size.y, 1.0f/b.size.z);;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGlobalParams()
|
||||||
|
{
|
||||||
|
Shader.SetGlobalTexture("_Volume0", bakedTexture0);
|
||||||
|
Shader.SetGlobalTexture("_Volume1", bakedTexture1);
|
||||||
|
Shader.SetGlobalTexture("_Volume2", bakedTexture2);
|
||||||
|
Shader.SetGlobalTexture("_VolumeMask", bakedMask);
|
||||||
|
var b = bounds;
|
||||||
|
var bmin = b.min;
|
||||||
|
var bis = new Vector3(1.0f/b.size.x, 1.0f/b.size.y, 1.0f/b.size.z);;
|
||||||
|
Shader.SetGlobalVector("_GlobalVolumeMin", bmin);
|
||||||
|
Shader.SetGlobalVector("_GlobalVolumeInvSize", bis);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateBounds()
|
||||||
|
{
|
||||||
|
var pos = transform.position;
|
||||||
|
var size = bounds.size;
|
||||||
|
bounds = new Bounds(pos, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Awake()
|
||||||
|
{
|
||||||
|
if (isGlobal)
|
||||||
|
{
|
||||||
|
globalVolume = this;
|
||||||
|
SetGlobalParams();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[CustomEditor(typeof(BakeryVolume))]
|
||||||
|
public class BakeryVolumeInspector : Editor
|
||||||
|
{
|
||||||
|
BoxBoundsHandle boundsHandle = new BoxBoundsHandle(typeof(BakeryVolumeInspector).GetHashCode());
|
||||||
|
|
||||||
|
SerializedProperty ftraceAdaptiveRes, ftraceResX, ftraceResY, ftraceResZ, ftraceVoxelsPerUnit, ftraceAdjustSamples, ftraceEnableBaking, ftraceEncoding, ftraceShadowmaskEncoding, ftraceDenoise, ftraceGlobal;
|
||||||
|
|
||||||
|
bool showExperimental = false;
|
||||||
|
|
||||||
|
void OnEnable()
|
||||||
|
{
|
||||||
|
ftraceAdaptiveRes = serializedObject.FindProperty("adaptiveRes");
|
||||||
|
ftraceVoxelsPerUnit = serializedObject.FindProperty("voxelsPerUnit");
|
||||||
|
ftraceResX = serializedObject.FindProperty("resolutionX");
|
||||||
|
ftraceResY = serializedObject.FindProperty("resolutionY");
|
||||||
|
ftraceResZ = serializedObject.FindProperty("resolutionZ");
|
||||||
|
ftraceEnableBaking = serializedObject.FindProperty("enableBaking");
|
||||||
|
ftraceEncoding = serializedObject.FindProperty("encoding");
|
||||||
|
ftraceShadowmaskEncoding = serializedObject.FindProperty("shadowmaskEncoding");
|
||||||
|
ftraceDenoise = serializedObject.FindProperty("denoise");
|
||||||
|
ftraceGlobal = serializedObject.FindProperty("isGlobal");
|
||||||
|
//ftraceAdjustSamples = serializedObject.FindProperty("adjustSamples");
|
||||||
|
}
|
||||||
|
|
||||||
|
string F(float f)
|
||||||
|
{
|
||||||
|
// Unity keeps using comma for float printing on some systems since ~2018, even if system-wide decimal symbol is "."
|
||||||
|
return (f + "").Replace(",", ".");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
serializedObject.Update();
|
||||||
|
var vol = target as BakeryVolume;
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(ftraceEnableBaking, new GUIContent("Enable baking", "Should the volume be (re)computed? Disable to prevent overwriting existing data."));
|
||||||
|
bool wasGlobal = ftraceGlobal.boolValue;
|
||||||
|
EditorGUILayout.PropertyField(ftraceGlobal, new GUIContent("Global", "Automatically assign this volume to all volume-compatible shaders, unless they have overrides."));
|
||||||
|
if (!wasGlobal && ftraceGlobal.boolValue)
|
||||||
|
{
|
||||||
|
(target as BakeryVolume).SetGlobalParams();
|
||||||
|
}
|
||||||
|
EditorGUILayout.PropertyField(ftraceDenoise, new GUIContent("Denoise", "Apply denoising after baking the volume."));
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(ftraceAdaptiveRes, new GUIContent("Adaptive resolution", "Calculate voxel resolution based on size?"));
|
||||||
|
if (ftraceAdaptiveRes.boolValue)
|
||||||
|
{
|
||||||
|
EditorGUILayout.PropertyField(ftraceVoxelsPerUnit, new GUIContent("Voxels per unit"));
|
||||||
|
|
||||||
|
GUI.enabled = false;
|
||||||
|
var size = vol.bounds.size;
|
||||||
|
ftraceResX.intValue = System.Math.Max((int)(size.x * vol.voxelsPerUnit), 1);
|
||||||
|
ftraceResY.intValue = System.Math.Max((int)(size.y * vol.voxelsPerUnit), 1);
|
||||||
|
ftraceResZ.intValue = System.Math.Max((int)(size.z * vol.voxelsPerUnit), 1);
|
||||||
|
}
|
||||||
|
EditorGUILayout.PropertyField(ftraceResX, new GUIContent("Resolution X"));
|
||||||
|
EditorGUILayout.PropertyField(ftraceResY, new GUIContent("Resolution Y"));
|
||||||
|
EditorGUILayout.PropertyField(ftraceResZ, new GUIContent("Resolution Z"));
|
||||||
|
GUI.enabled = true;
|
||||||
|
|
||||||
|
//EditorGUILayout.PropertyField(ftraceAdjustSamples, new GUIContent("Adjust sample positions", "Fixes light leaking from inside surfaces"));
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
showExperimental = EditorGUILayout.Foldout(showExperimental, "Experimental", EditorStyles.foldout);
|
||||||
|
if (showExperimental)
|
||||||
|
{
|
||||||
|
EditorGUILayout.PropertyField(ftraceEncoding, new GUIContent("Encoding"));
|
||||||
|
EditorGUILayout.PropertyField(ftraceShadowmaskEncoding, new GUIContent("Shadowmask Encoding"));
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
if (vol.bakedTexture0 == null)
|
||||||
|
{
|
||||||
|
EditorGUILayout.LabelField("Baked texture: none");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EditorGUILayout.LabelField("Baked texture: " + vol.bakedTexture0.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
var wrapObj = EditorGUILayout.ObjectField("Wrap to object", null, typeof(GameObject), true) as GameObject;
|
||||||
|
if (wrapObj != null)
|
||||||
|
{
|
||||||
|
var mrs = wrapObj.GetComponentsInChildren<MeshRenderer>() as MeshRenderer[];
|
||||||
|
if (mrs.Length > 0)
|
||||||
|
{
|
||||||
|
var b = mrs[0].bounds;
|
||||||
|
for(int i=1; i<mrs.Length; i++)
|
||||||
|
{
|
||||||
|
b.Encapsulate(mrs[i].bounds);
|
||||||
|
}
|
||||||
|
Undo.RecordObject(vol, "Change Bounds");
|
||||||
|
vol.transform.position = b.center;
|
||||||
|
vol.bounds = b;
|
||||||
|
Debug.Log("Bounds set");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("No mesh renderers to wrap to");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var boxCol = vol.GetComponent<BoxCollider>();
|
||||||
|
if (boxCol != null)
|
||||||
|
{
|
||||||
|
if (GUILayout.Button("Set from box collider"))
|
||||||
|
{
|
||||||
|
Undo.RecordObject(vol, "Change Bounds");
|
||||||
|
vol.bounds = boxCol.bounds;
|
||||||
|
}
|
||||||
|
if (GUILayout.Button("Set to box collider"))
|
||||||
|
{
|
||||||
|
boxCol.center = Vector3.zero;
|
||||||
|
boxCol.size = vol.bounds.size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var bmin = vol.bounds.min;
|
||||||
|
var bmax = vol.bounds.max;
|
||||||
|
var bsize = vol.bounds.size;
|
||||||
|
EditorGUILayout.LabelField("Min: " + bmin.x+", "+bmin.y+", "+bmin.z);
|
||||||
|
EditorGUILayout.LabelField("Max: " + bmax.x+", "+bmax.y+", "+bmax.z);
|
||||||
|
|
||||||
|
if (GUILayout.Button("Copy bounds to clipboard"))
|
||||||
|
{
|
||||||
|
GUIUtility.systemCopyBuffer = "float3 bmin = float3(" + F(bmin.x)+", "+F(bmin.y)+", "+F(bmin.z) + "); float3 bmax = float3(" + F(bmax.x)+", "+F(bmax.y)+", "+F(bmax.z) + "); float3 binvsize = float3(" + F(1.0f/bsize.x)+", "+F(1.0f/bsize.y)+", "+F(1.0f/bsize.z) + ");";
|
||||||
|
}
|
||||||
|
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnSceneGUI()
|
||||||
|
{
|
||||||
|
var vol = (BakeryVolume)target;
|
||||||
|
|
||||||
|
boundsHandle.center = vol.transform.position;
|
||||||
|
boundsHandle.size = vol.bounds.size;
|
||||||
|
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
boundsHandle.DrawHandle();
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
Undo.RecordObject(vol, "Change Bounds");
|
||||||
|
|
||||||
|
Bounds newBounds = new Bounds();
|
||||||
|
newBounds.center = boundsHandle.center;
|
||||||
|
newBounds.size = boundsHandle.size;
|
||||||
|
vol.bounds = newBounds;
|
||||||
|
vol.transform.position = boundsHandle.center;
|
||||||
|
}
|
||||||
|
else if ((vol.bounds.center - boundsHandle.center).sqrMagnitude > 0.0001f)
|
||||||
|
{
|
||||||
|
Bounds newBounds = new Bounds();
|
||||||
|
newBounds.center = boundsHandle.center;
|
||||||
|
newBounds.size = boundsHandle.size;
|
||||||
|
vol.bounds = newBounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
12
Assets/Bakery/BakeryVolume.cs.meta
Normal file
12
Assets/Bakery/BakeryVolume.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 17ce3c1d3490b7143a67ebdc73cab6c1
|
||||||
|
timeCreated: 1589618132
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Bakery/docs.meta
Normal file
9
Assets/Bakery/docs.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab12b7d692d7ee34eaf8dab0da156ff0
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Bakery/docs/Bakery_manual.pdf
Normal file
BIN
Assets/Bakery/docs/Bakery_manual.pdf
Normal file
Binary file not shown.
8
Assets/Bakery/docs/Bakery_manual.pdf.meta
Normal file
8
Assets/Bakery/docs/Bakery_manual.pdf.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d2aec06f3f96cab4b822ed687e9e5ad4
|
||||||
|
timeCreated: 1531146949
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Bakery/emptyDirection.tga
(Stored with Git LFS)
Normal file
BIN
Assets/Bakery/emptyDirection.tga
(Stored with Git LFS)
Normal file
Binary file not shown.
100
Assets/Bakery/emptyDirection.tga.meta
Normal file
100
Assets/Bakery/emptyDirection.tga.meta
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 04afea73344b7d049b5b7ac5ae315dd5
|
||||||
|
timeCreated: 1539193964
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 0
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
- buildTarget: iPhone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
- buildTarget: Android
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
- buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Bakery/emptyLightingData.asset
Normal file
BIN
Assets/Bakery/emptyLightingData.asset
Normal file
Binary file not shown.
9
Assets/Bakery/emptyLightingData.asset.meta
Normal file
9
Assets/Bakery/emptyLightingData.asset.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8b4edc58204bf354c9dd12ceacc42350
|
||||||
|
timeCreated: 1534495245
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
mainObjectFileID: -1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
42
Assets/Bakery/ftBlack.shader
Normal file
42
Assets/Bakery/ftBlack.shader
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
Shader "Hidden/ftBlack"
|
||||||
|
{
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags {"LightMode"="Meta"}
|
||||||
|
Cull Off
|
||||||
|
CGPROGRAM
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct VertexInput
|
||||||
|
{
|
||||||
|
float2 uv1 : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f_meta2
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f_meta2 vert_meta2 (VertexInput v)
|
||||||
|
{
|
||||||
|
v2f_meta2 o;
|
||||||
|
o.pos = float4(((v.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw)*2-1) * float2(1,-1), 0.5, 1);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 frag_meta2 (v2f_meta2 i): SV_Target
|
||||||
|
{
|
||||||
|
return float4(0,0,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vertex vert_meta2
|
||||||
|
#pragma fragment frag_meta2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
9
Assets/Bakery/ftBlack.shader.meta
Normal file
9
Assets/Bakery/ftBlack.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e6fa4030aa9e5fd499a934ca8bf68034
|
||||||
|
timeCreated: 1541957594
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
80
Assets/Bakery/ftCubemap2Strip.shader
Normal file
80
Assets/Bakery/ftCubemap2Strip.shader
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
Shader "Hidden/ftCubemap2Strip"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
// No culling or depth
|
||||||
|
Cull Off ZWrite Off ZTest Always
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.uv = v.uv;
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
o.uv.y = 1-o.uv.y;
|
||||||
|
#endif
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
samplerCUBE _MainTex;
|
||||||
|
float gammaMode;
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
float3 vec;
|
||||||
|
int quad = floor(i.uv.x * 6);
|
||||||
|
|
||||||
|
float2 st = frac(i.uv * float2(6,1)) * 2.0 - 1.0;
|
||||||
|
st.x = -st.x;
|
||||||
|
//st.y = -st.y;
|
||||||
|
|
||||||
|
if (quad == 0) {
|
||||||
|
vec = float3(1, -st.y, st.x);
|
||||||
|
} else if (quad == 1) {
|
||||||
|
vec = float3(-1, -st.y, -st.x);
|
||||||
|
} else if (quad == 2) {
|
||||||
|
vec = float3(-st.y, 1, -st.x);
|
||||||
|
} else if (quad == 3) {
|
||||||
|
vec = float3(-st.y, -1, st.x);
|
||||||
|
} else if (quad == 4) {
|
||||||
|
vec = float3(-st.x, -st.y, 1);
|
||||||
|
} else {
|
||||||
|
vec = float3(st.x, -st.y, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec = -vec;
|
||||||
|
|
||||||
|
float4 col = texCUBE(_MainTex, vec);
|
||||||
|
|
||||||
|
if (gammaMode > 0.5f) col.rgb = pow(col.rgb, 2.2f);
|
||||||
|
|
||||||
|
return col;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftCubemap2Strip.shader.meta
Normal file
9
Assets/Bakery/ftCubemap2Strip.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c73e5686bbd8c334da43020465ac8360
|
||||||
|
timeCreated: 1526836856
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
79
Assets/Bakery/ftDefaultAreaLightMat.mat
Normal file
79
Assets/Bakery/ftDefaultAreaLightMat.mat
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: ftDefaultAreaLightMat
|
||||||
|
m_Shader: {fileID: 4800000, guid: 44078aff4de957844a86ead7ad169295, type: 3}
|
||||||
|
m_ShaderKeywords:
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 1
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 0
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 1
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 1
|
||||||
|
- intensity: 1
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
9
Assets/Bakery/ftDefaultAreaLightMat.mat.meta
Normal file
9
Assets/Bakery/ftDefaultAreaLightMat.mat.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ea803d5e2c877f84e8ca6599c9cefb15
|
||||||
|
timeCreated: 1527799464
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
489
Assets/Bakery/ftDefaultGlobalStorage.asset
Normal file
489
Assets/Bakery/ftDefaultGlobalStorage.asset
Normal file
@ -0,0 +1,489 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: c789d55c4f1cff34799abba03737e8f7, type: 3}
|
||||||
|
m_Name: ftDefaultGlobalStorage
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
modifiedAssetPathList:
|
||||||
|
- Assets/Bakery/examples/content/sponza/sponza.FBX
|
||||||
|
modifiedAssetPaddingHash:
|
||||||
|
modifiedMeshList: []
|
||||||
|
modifiedMeshPaddingList:
|
||||||
|
modifiedAssets:
|
||||||
|
- meshName:
|
||||||
|
- sponza_00
|
||||||
|
- sponza_01
|
||||||
|
- sponza_03
|
||||||
|
- sponza_05
|
||||||
|
- sponza_06
|
||||||
|
- sponza_07
|
||||||
|
- sponza_08
|
||||||
|
- sponza_09
|
||||||
|
- sponza_10
|
||||||
|
- sponza_11
|
||||||
|
- sponza_12
|
||||||
|
- sponza_13
|
||||||
|
- sponza_14
|
||||||
|
- sponza_15
|
||||||
|
- sponza_16
|
||||||
|
- sponza_17
|
||||||
|
- sponza_18
|
||||||
|
- sponza_19
|
||||||
|
- sponza_20
|
||||||
|
- sponza_21
|
||||||
|
- sponza_22
|
||||||
|
- sponza_23
|
||||||
|
- sponza_24
|
||||||
|
- sponza_25
|
||||||
|
- sponza_26
|
||||||
|
- sponza_27
|
||||||
|
- sponza_28
|
||||||
|
- sponza_29
|
||||||
|
- sponza_30
|
||||||
|
- sponza_31
|
||||||
|
- sponza_32
|
||||||
|
- sponza_33
|
||||||
|
- sponza_34
|
||||||
|
- sponza_35
|
||||||
|
- sponza_36
|
||||||
|
- sponza_37
|
||||||
|
- sponza_38
|
||||||
|
- sponza_39
|
||||||
|
- sponza_40
|
||||||
|
- sponza_41
|
||||||
|
- sponza_42
|
||||||
|
- sponza_43
|
||||||
|
- sponza_44
|
||||||
|
- sponza_45
|
||||||
|
- sponza_46
|
||||||
|
- sponza_47
|
||||||
|
- sponza_48
|
||||||
|
- sponza_49
|
||||||
|
- sponza_50
|
||||||
|
- sponza_51
|
||||||
|
- sponza_52
|
||||||
|
- sponza_53
|
||||||
|
- sponza_54
|
||||||
|
- sponza_55
|
||||||
|
- sponza_56
|
||||||
|
- sponza_57
|
||||||
|
- sponza_58
|
||||||
|
- sponza_59
|
||||||
|
- sponza_60
|
||||||
|
- sponza_61
|
||||||
|
- sponza_62
|
||||||
|
- sponza_63
|
||||||
|
- sponza_64
|
||||||
|
- sponza_65
|
||||||
|
- sponza_67
|
||||||
|
- sponza_68
|
||||||
|
- sponza_69
|
||||||
|
- sponza_70
|
||||||
|
- sponza_71
|
||||||
|
- sponza_72
|
||||||
|
- sponza_73
|
||||||
|
- sponza_74
|
||||||
|
- sponza_75
|
||||||
|
- sponza_76
|
||||||
|
- sponza_77
|
||||||
|
- sponza_78
|
||||||
|
- sponza_79
|
||||||
|
- sponza_80
|
||||||
|
- sponza_81
|
||||||
|
- sponza_82
|
||||||
|
- sponza_83
|
||||||
|
- sponza_84
|
||||||
|
- sponza_85
|
||||||
|
- sponza_86
|
||||||
|
- sponza_87
|
||||||
|
- sponza_88
|
||||||
|
- sponza_89
|
||||||
|
- sponza_90
|
||||||
|
- sponza_91
|
||||||
|
- sponza_92
|
||||||
|
- sponza_93
|
||||||
|
- sponza_94
|
||||||
|
- sponza_95
|
||||||
|
- sponza_96
|
||||||
|
- sponza_97
|
||||||
|
- sponza_98
|
||||||
|
- sponza_99
|
||||||
|
- sponza_100
|
||||||
|
- sponza_101
|
||||||
|
- sponza_102
|
||||||
|
- sponza_103
|
||||||
|
- sponza_104
|
||||||
|
- sponza_105
|
||||||
|
- sponza_106
|
||||||
|
- sponza_107
|
||||||
|
- sponza_108
|
||||||
|
- sponza_109
|
||||||
|
- sponza_110
|
||||||
|
- sponza_111
|
||||||
|
- sponza_112
|
||||||
|
- sponza_113
|
||||||
|
- sponza_114
|
||||||
|
- sponza_115
|
||||||
|
- sponza_116
|
||||||
|
- sponza_117
|
||||||
|
- sponza_118
|
||||||
|
- sponza_119
|
||||||
|
- sponza_120
|
||||||
|
- sponza_121
|
||||||
|
- sponza_122
|
||||||
|
- sponza_123
|
||||||
|
- sponza_124
|
||||||
|
- sponza_125
|
||||||
|
- sponza_126
|
||||||
|
- sponza_127
|
||||||
|
- sponza_128
|
||||||
|
- sponza_129
|
||||||
|
- sponza_130
|
||||||
|
- sponza_131
|
||||||
|
- sponza_132
|
||||||
|
- sponza_133
|
||||||
|
- sponza_134
|
||||||
|
- sponza_135
|
||||||
|
- sponza_136
|
||||||
|
- sponza_137
|
||||||
|
- sponza_138
|
||||||
|
- sponza_139
|
||||||
|
- sponza_140
|
||||||
|
- sponza_141
|
||||||
|
- sponza_142
|
||||||
|
- sponza_143
|
||||||
|
- sponza_144
|
||||||
|
- sponza_145
|
||||||
|
- sponza_146
|
||||||
|
- sponza_147
|
||||||
|
- sponza_148
|
||||||
|
- sponza_149
|
||||||
|
- sponza_150
|
||||||
|
- sponza_151
|
||||||
|
- sponza_152
|
||||||
|
- sponza_153
|
||||||
|
- sponza_154
|
||||||
|
- sponza_155
|
||||||
|
- sponza_156
|
||||||
|
- sponza_157
|
||||||
|
- sponza_158
|
||||||
|
- sponza_159
|
||||||
|
- sponza_160
|
||||||
|
- sponza_161
|
||||||
|
- sponza_162
|
||||||
|
- sponza_163
|
||||||
|
- sponza_164
|
||||||
|
- sponza_165
|
||||||
|
- sponza_166
|
||||||
|
- sponza_167
|
||||||
|
- sponza_168
|
||||||
|
- sponza_169
|
||||||
|
- sponza_170
|
||||||
|
- sponza_171
|
||||||
|
- sponza_172
|
||||||
|
- sponza_173
|
||||||
|
- sponza_174
|
||||||
|
- sponza_175
|
||||||
|
- sponza_176
|
||||||
|
- sponza_177
|
||||||
|
- sponza_178
|
||||||
|
- sponza_179
|
||||||
|
- sponza_180
|
||||||
|
- sponza_181
|
||||||
|
- sponza_182
|
||||||
|
- sponza_183
|
||||||
|
- sponza_184
|
||||||
|
- sponza_185
|
||||||
|
- sponza_186
|
||||||
|
- sponza_187
|
||||||
|
- sponza_188
|
||||||
|
- sponza_189
|
||||||
|
- sponza_190
|
||||||
|
- sponza_191
|
||||||
|
- sponza_192
|
||||||
|
- sponza_193
|
||||||
|
- sponza_194
|
||||||
|
- sponza_195
|
||||||
|
- sponza_196
|
||||||
|
- sponza_197
|
||||||
|
- sponza_198
|
||||||
|
- sponza_199
|
||||||
|
- sponza_200
|
||||||
|
- sponza_201
|
||||||
|
- sponza_202
|
||||||
|
- sponza_203
|
||||||
|
- sponza_204
|
||||||
|
- sponza_205
|
||||||
|
- sponza_206
|
||||||
|
- sponza_207
|
||||||
|
- sponza_208
|
||||||
|
- sponza_209
|
||||||
|
- sponza_210
|
||||||
|
- sponza_211
|
||||||
|
- sponza_212
|
||||||
|
- sponza_213
|
||||||
|
- sponza_214
|
||||||
|
- sponza_215
|
||||||
|
- sponza_216
|
||||||
|
- sponza_217
|
||||||
|
- sponza_218
|
||||||
|
- sponza_219
|
||||||
|
- sponza_220
|
||||||
|
- sponza_221
|
||||||
|
- sponza_222
|
||||||
|
- sponza_223
|
||||||
|
- sponza_224
|
||||||
|
- sponza_225
|
||||||
|
- sponza_226
|
||||||
|
- sponza_227
|
||||||
|
- sponza_228
|
||||||
|
- sponza_229
|
||||||
|
- sponza_230
|
||||||
|
- sponza_231
|
||||||
|
- sponza_232
|
||||||
|
- sponza_233
|
||||||
|
- sponza_234
|
||||||
|
- sponza_235
|
||||||
|
- sponza_236
|
||||||
|
- sponza_237
|
||||||
|
- sponza_238
|
||||||
|
- sponza_239
|
||||||
|
- sponza_240
|
||||||
|
- sponza_241
|
||||||
|
- sponza_242
|
||||||
|
- sponza_243
|
||||||
|
- sponza_244
|
||||||
|
- sponza_245
|
||||||
|
- sponza_246
|
||||||
|
- sponza_247
|
||||||
|
- sponza_248
|
||||||
|
- sponza_249
|
||||||
|
- sponza_250
|
||||||
|
- sponza_251
|
||||||
|
- sponza_252
|
||||||
|
- sponza_253
|
||||||
|
- sponza_254
|
||||||
|
- sponza_255
|
||||||
|
- sponza_256
|
||||||
|
- sponza_257
|
||||||
|
- sponza_259
|
||||||
|
- sponza_260
|
||||||
|
- sponza_261
|
||||||
|
- sponza_262
|
||||||
|
- sponza_263
|
||||||
|
- sponza_264
|
||||||
|
- sponza_265
|
||||||
|
- sponza_266
|
||||||
|
- sponza_267
|
||||||
|
- sponza_268
|
||||||
|
- sponza_269
|
||||||
|
- sponza_270
|
||||||
|
- sponza_271
|
||||||
|
- sponza_272
|
||||||
|
- sponza_273
|
||||||
|
- sponza_274
|
||||||
|
- sponza_275
|
||||||
|
- sponza_276
|
||||||
|
- sponza_277
|
||||||
|
- sponza_278
|
||||||
|
- sponza_279
|
||||||
|
- sponza_280
|
||||||
|
- sponza_281
|
||||||
|
- sponza_282
|
||||||
|
- sponza_283
|
||||||
|
- sponza_284
|
||||||
|
- sponza_285
|
||||||
|
- sponza_286
|
||||||
|
- sponza_287
|
||||||
|
- sponza_288
|
||||||
|
- sponza_289
|
||||||
|
- sponza_290
|
||||||
|
- sponza_291
|
||||||
|
- sponza_292
|
||||||
|
- sponza_293
|
||||||
|
- sponza_294
|
||||||
|
- sponza_295
|
||||||
|
- sponza_296
|
||||||
|
- sponza_297
|
||||||
|
- sponza_298
|
||||||
|
- sponza_299
|
||||||
|
- sponza_300
|
||||||
|
- sponza_301
|
||||||
|
- sponza_302
|
||||||
|
- sponza_303
|
||||||
|
- sponza_304
|
||||||
|
- sponza_305
|
||||||
|
- sponza_306
|
||||||
|
- sponza_307
|
||||||
|
- sponza_308
|
||||||
|
- sponza_309
|
||||||
|
- sponza_310
|
||||||
|
- sponza_311
|
||||||
|
- sponza_312
|
||||||
|
- sponza_313
|
||||||
|
- sponza_314
|
||||||
|
- sponza_315
|
||||||
|
- sponza_316
|
||||||
|
- sponza_317
|
||||||
|
- sponza_318
|
||||||
|
- sponza_319
|
||||||
|
- sponza_320
|
||||||
|
- sponza_321
|
||||||
|
- sponza_322
|
||||||
|
- sponza_323
|
||||||
|
- sponza_324
|
||||||
|
- sponza_325
|
||||||
|
- sponza_326
|
||||||
|
- sponza_327
|
||||||
|
- sponza_328
|
||||||
|
- sponza_329
|
||||||
|
- sponza_330
|
||||||
|
- sponza_331
|
||||||
|
- sponza_332
|
||||||
|
- sponza_333
|
||||||
|
- sponza_334
|
||||||
|
- sponza_335
|
||||||
|
- sponza_336
|
||||||
|
- sponza_337
|
||||||
|
- sponza_338
|
||||||
|
- sponza_339
|
||||||
|
- sponza_340
|
||||||
|
- sponza_341
|
||||||
|
- sponza_342
|
||||||
|
- sponza_343
|
||||||
|
- sponza_344
|
||||||
|
- sponza_345
|
||||||
|
- sponza_346
|
||||||
|
- sponza_347
|
||||||
|
- sponza_348
|
||||||
|
- sponza_349
|
||||||
|
- sponza_350
|
||||||
|
- sponza_351
|
||||||
|
- sponza_352
|
||||||
|
- sponza_353
|
||||||
|
- sponza_354
|
||||||
|
- sponza_355
|
||||||
|
- sponza_356
|
||||||
|
- sponza_357
|
||||||
|
- sponza_358
|
||||||
|
- sponza_359
|
||||||
|
- sponza_360
|
||||||
|
- sponza_361
|
||||||
|
- sponza_362
|
||||||
|
- sponza_363
|
||||||
|
- sponza_364
|
||||||
|
- sponza_365
|
||||||
|
- sponza_366
|
||||||
|
- sponza_367
|
||||||
|
- sponza_368
|
||||||
|
- sponza_369
|
||||||
|
- sponza_370
|
||||||
|
- sponza_371
|
||||||
|
- sponza_372
|
||||||
|
- sponza_373
|
||||||
|
- sponza_374
|
||||||
|
- sponza_375
|
||||||
|
- sponza_376
|
||||||
|
- sponza_377
|
||||||
|
- sponza_378
|
||||||
|
- sponza_381
|
||||||
|
padding: 2e000000460000002a000000110000000e0000000c0000000400000033000000330000003300000033000000330000003300000033000000330000000a00000007000000060000002b0000002b00000011000000140000001400000014000000140000002a0000001d000000320000003200000032000000320000002a000000080000000d0000000500000087000000fa00000087000000fa00000087000000fa00000087000000fa00000087000000fb00000087000000fb00000087000000fb00000087000000fb00000087000000fb00000051000000510000005100000051000000510000005100000051000000510000005100000051000000510000000c00000006000000060000002700000028000000390000002b000000150000002700000000010000ba0000009b0000009b000000b70000009d000000b7000000b7000000b70000009b000000b70000009d000000b7000000b7000000b70000009b0000009b0000009b00000083000000ba00000000010000ba0000009b0000009b000000b70000009d000000b7000000b7000000b70000009b000000b70000009d000000b7000000b7000000b70000009b0000009b0000009b00000083000000000100002700000006000000270000002700000027000000270000002d0000001000000010000000230000006a000000000100006a000000000100006a000000000100006a000000000100001e0000002c000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000230000006a000000000100006a000000000100006a000000000100006a000000000100001e0000002c000000630000004300000000010000000100004300000000010000430000000001000043000000430000009400000094000000430000009400000043000000940000004300000024000000270000004600000030000000360000002d000000360000001d0000001d0000001d0000001d0000001d0000001d0000001d0000001d00000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad000000000100001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b000000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c000000000100000001000000010000000100004600000046000000460000004900000049000000490000004900000024000000240000002400000024000000220000001800000004000000
|
||||||
|
unwrapper:
|
||||||
|
assetList:
|
||||||
|
- Assets/Bakery/examples/content/sponza/bush.FBX
|
||||||
|
- Assets/Bakery/examples/content/floor_lamp.FBX
|
||||||
|
uvOverlapAssetList: 00000000ffffffff
|
||||||
|
xatlasWarningShown: 0
|
||||||
|
foundCompatibleSetup: 0
|
||||||
|
gpuName:
|
||||||
|
runsNonRTX: 1
|
||||||
|
runsOptix5: 1
|
||||||
|
runsOptix6: 1
|
||||||
|
runsOptix7: 1
|
||||||
|
runsOIDN: 1
|
||||||
|
alwaysEnableRTX: 0
|
||||||
|
checkerPreviewOn: 0
|
||||||
|
rtSceneViewPreviewOn: 0
|
||||||
|
renderSettingsBounces: 5
|
||||||
|
renderSettingsGISamples: 16
|
||||||
|
renderSettingsGIBackFaceWeight: 0
|
||||||
|
renderSettingsTileSize: 512
|
||||||
|
renderSettingsPriority: 2
|
||||||
|
renderSettingsTexelsPerUnit: 20
|
||||||
|
renderSettingsForceRefresh: 1
|
||||||
|
renderSettingsForceRebuildGeometry: 1
|
||||||
|
renderSettingsPerformRendering: 1
|
||||||
|
renderSettingsUserRenderMode: 0
|
||||||
|
renderSettingsDistanceShadowmask: 0
|
||||||
|
renderSettingsSettingsMode: 0
|
||||||
|
renderSettingsFixSeams: 1
|
||||||
|
renderSettingsDenoise: 1
|
||||||
|
renderSettingsDenoise2x: 0
|
||||||
|
renderSettingsEncode: 1
|
||||||
|
renderSettingsEncodeMode: 0
|
||||||
|
renderSettingsOverwriteWarning: 0
|
||||||
|
renderSettingsAutoAtlas: 1
|
||||||
|
renderSettingsUnwrapUVs: 1
|
||||||
|
renderSettingsForceDisableUnwrapUVs: 0
|
||||||
|
renderSettingsMaxAutoResolution: 4096
|
||||||
|
renderSettingsMinAutoResolution: 16
|
||||||
|
renderSettingsUnloadScenes: 1
|
||||||
|
renderSettingsAdjustSamples: 1
|
||||||
|
renderSettingsGILODMode: 0
|
||||||
|
renderSettingsGILODModeEnabled: 1
|
||||||
|
renderSettingsCheckOverlaps: 0
|
||||||
|
renderSettingsSkipOutOfBoundsUVs: 1
|
||||||
|
renderSettingsHackEmissiveBoost: 1
|
||||||
|
renderSettingsHackIndirectBoost: 1
|
||||||
|
renderSettingsTempPath:
|
||||||
|
renderSettingsOutPath:
|
||||||
|
renderSettingsUseScenePath: 0
|
||||||
|
renderSettingsHackAOIntensity: 0
|
||||||
|
renderSettingsHackAOSamples: 16
|
||||||
|
renderSettingsHackAORadius: 1
|
||||||
|
renderSettingsShowAOSettings: 0
|
||||||
|
renderSettingsShowTasks: 1
|
||||||
|
renderSettingsShowTasks2: 0
|
||||||
|
renderSettingsShowPaths: 1
|
||||||
|
renderSettingsShowNet: 1
|
||||||
|
renderSettingsOcclusionProbes: 0
|
||||||
|
renderSettingsTexelsPerMap: 0
|
||||||
|
renderSettingsTexelsColor: 1
|
||||||
|
renderSettingsTexelsMask: 1
|
||||||
|
renderSettingsTexelsDir: 1
|
||||||
|
renderSettingsShowDirWarning: 1
|
||||||
|
renderSettingsRenderDirMode: 0
|
||||||
|
renderSettingsShowCheckerSettings: 0
|
||||||
|
renderSettingsSamplesWarning: 1
|
||||||
|
renderSettingsPrefabWarning: 1
|
||||||
|
renderSettingsSplitByScene: 0
|
||||||
|
renderSettingsUVPaddingMax: 0
|
||||||
|
renderSettingsPostPacking: 1
|
||||||
|
renderSettingsHoleFilling: 0
|
||||||
|
renderSettingsBeepOnFinish: 0
|
||||||
|
renderSettingsExportTerrainAsHeightmap: 1
|
||||||
|
renderSettingsRTXMode: 0
|
||||||
|
renderSettingsLightProbeMode: 1
|
||||||
|
renderSettingsClientMode: 0
|
||||||
|
renderSettingsServerAddress: 127.0.0.1
|
||||||
|
renderSettingsUnwrapper: 0
|
||||||
|
renderSettingsDenoiserType: 100
|
||||||
|
renderSettingsExportTerrainTrees: 0
|
||||||
|
renderSettingsShowPerf: 1
|
||||||
|
renderSettingsSampleDiv: 1
|
||||||
|
renderSettingsAtlasPacker: 0
|
||||||
|
renderSettingsBatchPoints: 1
|
||||||
|
renderSettingsRTPVExport: 1
|
||||||
|
renderSettingsRTPVSceneView: 0
|
||||||
|
renderSettingsRTPVWidth: 640
|
||||||
|
renderSettingsRTPVHeight: 360
|
||||||
|
modifiedMeshPaddingArray:
|
||||||
|
modifiedMeshUnwrapperArray:
|
9
Assets/Bakery/ftDefaultGlobalStorage.asset.meta
Normal file
9
Assets/Bakery/ftDefaultGlobalStorage.asset.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f4b25053f1346cc4e8e1208e07ec0360
|
||||||
|
timeCreated: 1536946135
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
mainObjectFileID: -1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
106
Assets/Bakery/ftDilate.shader
Normal file
106
Assets/Bakery/ftDilate.shader
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
Shader "Hidden/ftDilate"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
// No culling or depth
|
||||||
|
Cull Off ZWrite Off ZTest Always
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.uv = v.uv;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
UNITY_DECLARE_TEX2D(_MainTex);
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
uint width, height;
|
||||||
|
_MainTex.GetDimensions(width, height);
|
||||||
|
int3 center = int3(i.vertex.xy, 0);
|
||||||
|
|
||||||
|
float4 c = _MainTex.Load(center);
|
||||||
|
if (c.w > 0) return c;
|
||||||
|
|
||||||
|
uint total = 0;
|
||||||
|
float4 c2 = _MainTex.Load(center, int2(-1,-1));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(0,-1));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(1,-1));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(-1,0));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(1,0));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(-1,1));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
c2 = _MainTex.Load(center, int2(1,1));
|
||||||
|
if (c2.w>0) {
|
||||||
|
c += c2;
|
||||||
|
total++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (total > 0)
|
||||||
|
{
|
||||||
|
c /= total;
|
||||||
|
return float4(c.rgb, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
return float4(0,0,0,0);
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
9
Assets/Bakery/ftDilate.shader.meta
Normal file
9
Assets/Bakery/ftDilate.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 966cd9feaf442e64b9154c34e29787e1
|
||||||
|
timeCreated: 1595076643
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
503
Assets/Bakery/ftGlobalStorage.asset
Normal file
503
Assets/Bakery/ftGlobalStorage.asset
Normal file
@ -0,0 +1,503 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: c789d55c4f1cff34799abba03737e8f7, type: 3}
|
||||||
|
m_Name: ftGlobalStorage
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
modifiedAssetPathList:
|
||||||
|
- Assets/Bakery/examples/content/sponza/sponza.FBX
|
||||||
|
- Assets/Models/Delta_Building_Model_Old.blend
|
||||||
|
modifiedAssetPaddingHash: aaf8cc2e24c96996
|
||||||
|
modifiedMeshList: []
|
||||||
|
modifiedMeshPaddingList:
|
||||||
|
modifiedAssets:
|
||||||
|
- meshName:
|
||||||
|
- sponza_00
|
||||||
|
- sponza_01
|
||||||
|
- sponza_03
|
||||||
|
- sponza_05
|
||||||
|
- sponza_06
|
||||||
|
- sponza_07
|
||||||
|
- sponza_08
|
||||||
|
- sponza_09
|
||||||
|
- sponza_10
|
||||||
|
- sponza_11
|
||||||
|
- sponza_12
|
||||||
|
- sponza_13
|
||||||
|
- sponza_14
|
||||||
|
- sponza_15
|
||||||
|
- sponza_16
|
||||||
|
- sponza_17
|
||||||
|
- sponza_18
|
||||||
|
- sponza_19
|
||||||
|
- sponza_20
|
||||||
|
- sponza_21
|
||||||
|
- sponza_22
|
||||||
|
- sponza_23
|
||||||
|
- sponza_24
|
||||||
|
- sponza_25
|
||||||
|
- sponza_26
|
||||||
|
- sponza_27
|
||||||
|
- sponza_28
|
||||||
|
- sponza_29
|
||||||
|
- sponza_30
|
||||||
|
- sponza_31
|
||||||
|
- sponza_32
|
||||||
|
- sponza_33
|
||||||
|
- sponza_34
|
||||||
|
- sponza_35
|
||||||
|
- sponza_36
|
||||||
|
- sponza_37
|
||||||
|
- sponza_38
|
||||||
|
- sponza_39
|
||||||
|
- sponza_40
|
||||||
|
- sponza_41
|
||||||
|
- sponza_42
|
||||||
|
- sponza_43
|
||||||
|
- sponza_44
|
||||||
|
- sponza_45
|
||||||
|
- sponza_46
|
||||||
|
- sponza_47
|
||||||
|
- sponza_48
|
||||||
|
- sponza_49
|
||||||
|
- sponza_50
|
||||||
|
- sponza_51
|
||||||
|
- sponza_52
|
||||||
|
- sponza_53
|
||||||
|
- sponza_54
|
||||||
|
- sponza_55
|
||||||
|
- sponza_56
|
||||||
|
- sponza_57
|
||||||
|
- sponza_58
|
||||||
|
- sponza_59
|
||||||
|
- sponza_60
|
||||||
|
- sponza_61
|
||||||
|
- sponza_62
|
||||||
|
- sponza_63
|
||||||
|
- sponza_64
|
||||||
|
- sponza_65
|
||||||
|
- sponza_67
|
||||||
|
- sponza_68
|
||||||
|
- sponza_69
|
||||||
|
- sponza_70
|
||||||
|
- sponza_71
|
||||||
|
- sponza_72
|
||||||
|
- sponza_73
|
||||||
|
- sponza_74
|
||||||
|
- sponza_75
|
||||||
|
- sponza_76
|
||||||
|
- sponza_77
|
||||||
|
- sponza_78
|
||||||
|
- sponza_79
|
||||||
|
- sponza_80
|
||||||
|
- sponza_81
|
||||||
|
- sponza_82
|
||||||
|
- sponza_83
|
||||||
|
- sponza_84
|
||||||
|
- sponza_85
|
||||||
|
- sponza_86
|
||||||
|
- sponza_87
|
||||||
|
- sponza_88
|
||||||
|
- sponza_89
|
||||||
|
- sponza_90
|
||||||
|
- sponza_91
|
||||||
|
- sponza_92
|
||||||
|
- sponza_93
|
||||||
|
- sponza_94
|
||||||
|
- sponza_95
|
||||||
|
- sponza_96
|
||||||
|
- sponza_97
|
||||||
|
- sponza_98
|
||||||
|
- sponza_99
|
||||||
|
- sponza_100
|
||||||
|
- sponza_101
|
||||||
|
- sponza_102
|
||||||
|
- sponza_103
|
||||||
|
- sponza_104
|
||||||
|
- sponza_105
|
||||||
|
- sponza_106
|
||||||
|
- sponza_107
|
||||||
|
- sponza_108
|
||||||
|
- sponza_109
|
||||||
|
- sponza_110
|
||||||
|
- sponza_111
|
||||||
|
- sponza_112
|
||||||
|
- sponza_113
|
||||||
|
- sponza_114
|
||||||
|
- sponza_115
|
||||||
|
- sponza_116
|
||||||
|
- sponza_117
|
||||||
|
- sponza_118
|
||||||
|
- sponza_119
|
||||||
|
- sponza_120
|
||||||
|
- sponza_121
|
||||||
|
- sponza_122
|
||||||
|
- sponza_123
|
||||||
|
- sponza_124
|
||||||
|
- sponza_125
|
||||||
|
- sponza_126
|
||||||
|
- sponza_127
|
||||||
|
- sponza_128
|
||||||
|
- sponza_129
|
||||||
|
- sponza_130
|
||||||
|
- sponza_131
|
||||||
|
- sponza_132
|
||||||
|
- sponza_133
|
||||||
|
- sponza_134
|
||||||
|
- sponza_135
|
||||||
|
- sponza_136
|
||||||
|
- sponza_137
|
||||||
|
- sponza_138
|
||||||
|
- sponza_139
|
||||||
|
- sponza_140
|
||||||
|
- sponza_141
|
||||||
|
- sponza_142
|
||||||
|
- sponza_143
|
||||||
|
- sponza_144
|
||||||
|
- sponza_145
|
||||||
|
- sponza_146
|
||||||
|
- sponza_147
|
||||||
|
- sponza_148
|
||||||
|
- sponza_149
|
||||||
|
- sponza_150
|
||||||
|
- sponza_151
|
||||||
|
- sponza_152
|
||||||
|
- sponza_153
|
||||||
|
- sponza_154
|
||||||
|
- sponza_155
|
||||||
|
- sponza_156
|
||||||
|
- sponza_157
|
||||||
|
- sponza_158
|
||||||
|
- sponza_159
|
||||||
|
- sponza_160
|
||||||
|
- sponza_161
|
||||||
|
- sponza_162
|
||||||
|
- sponza_163
|
||||||
|
- sponza_164
|
||||||
|
- sponza_165
|
||||||
|
- sponza_166
|
||||||
|
- sponza_167
|
||||||
|
- sponza_168
|
||||||
|
- sponza_169
|
||||||
|
- sponza_170
|
||||||
|
- sponza_171
|
||||||
|
- sponza_172
|
||||||
|
- sponza_173
|
||||||
|
- sponza_174
|
||||||
|
- sponza_175
|
||||||
|
- sponza_176
|
||||||
|
- sponza_177
|
||||||
|
- sponza_178
|
||||||
|
- sponza_179
|
||||||
|
- sponza_180
|
||||||
|
- sponza_181
|
||||||
|
- sponza_182
|
||||||
|
- sponza_183
|
||||||
|
- sponza_184
|
||||||
|
- sponza_185
|
||||||
|
- sponza_186
|
||||||
|
- sponza_187
|
||||||
|
- sponza_188
|
||||||
|
- sponza_189
|
||||||
|
- sponza_190
|
||||||
|
- sponza_191
|
||||||
|
- sponza_192
|
||||||
|
- sponza_193
|
||||||
|
- sponza_194
|
||||||
|
- sponza_195
|
||||||
|
- sponza_196
|
||||||
|
- sponza_197
|
||||||
|
- sponza_198
|
||||||
|
- sponza_199
|
||||||
|
- sponza_200
|
||||||
|
- sponza_201
|
||||||
|
- sponza_202
|
||||||
|
- sponza_203
|
||||||
|
- sponza_204
|
||||||
|
- sponza_205
|
||||||
|
- sponza_206
|
||||||
|
- sponza_207
|
||||||
|
- sponza_208
|
||||||
|
- sponza_209
|
||||||
|
- sponza_210
|
||||||
|
- sponza_211
|
||||||
|
- sponza_212
|
||||||
|
- sponza_213
|
||||||
|
- sponza_214
|
||||||
|
- sponza_215
|
||||||
|
- sponza_216
|
||||||
|
- sponza_217
|
||||||
|
- sponza_218
|
||||||
|
- sponza_219
|
||||||
|
- sponza_220
|
||||||
|
- sponza_221
|
||||||
|
- sponza_222
|
||||||
|
- sponza_223
|
||||||
|
- sponza_224
|
||||||
|
- sponza_225
|
||||||
|
- sponza_226
|
||||||
|
- sponza_227
|
||||||
|
- sponza_228
|
||||||
|
- sponza_229
|
||||||
|
- sponza_230
|
||||||
|
- sponza_231
|
||||||
|
- sponza_232
|
||||||
|
- sponza_233
|
||||||
|
- sponza_234
|
||||||
|
- sponza_235
|
||||||
|
- sponza_236
|
||||||
|
- sponza_237
|
||||||
|
- sponza_238
|
||||||
|
- sponza_239
|
||||||
|
- sponza_240
|
||||||
|
- sponza_241
|
||||||
|
- sponza_242
|
||||||
|
- sponza_243
|
||||||
|
- sponza_244
|
||||||
|
- sponza_245
|
||||||
|
- sponza_246
|
||||||
|
- sponza_247
|
||||||
|
- sponza_248
|
||||||
|
- sponza_249
|
||||||
|
- sponza_250
|
||||||
|
- sponza_251
|
||||||
|
- sponza_252
|
||||||
|
- sponza_253
|
||||||
|
- sponza_254
|
||||||
|
- sponza_255
|
||||||
|
- sponza_256
|
||||||
|
- sponza_257
|
||||||
|
- sponza_259
|
||||||
|
- sponza_260
|
||||||
|
- sponza_261
|
||||||
|
- sponza_262
|
||||||
|
- sponza_263
|
||||||
|
- sponza_264
|
||||||
|
- sponza_265
|
||||||
|
- sponza_266
|
||||||
|
- sponza_267
|
||||||
|
- sponza_268
|
||||||
|
- sponza_269
|
||||||
|
- sponza_270
|
||||||
|
- sponza_271
|
||||||
|
- sponza_272
|
||||||
|
- sponza_273
|
||||||
|
- sponza_274
|
||||||
|
- sponza_275
|
||||||
|
- sponza_276
|
||||||
|
- sponza_277
|
||||||
|
- sponza_278
|
||||||
|
- sponza_279
|
||||||
|
- sponza_280
|
||||||
|
- sponza_281
|
||||||
|
- sponza_282
|
||||||
|
- sponza_283
|
||||||
|
- sponza_284
|
||||||
|
- sponza_285
|
||||||
|
- sponza_286
|
||||||
|
- sponza_287
|
||||||
|
- sponza_288
|
||||||
|
- sponza_289
|
||||||
|
- sponza_290
|
||||||
|
- sponza_291
|
||||||
|
- sponza_292
|
||||||
|
- sponza_293
|
||||||
|
- sponza_294
|
||||||
|
- sponza_295
|
||||||
|
- sponza_296
|
||||||
|
- sponza_297
|
||||||
|
- sponza_298
|
||||||
|
- sponza_299
|
||||||
|
- sponza_300
|
||||||
|
- sponza_301
|
||||||
|
- sponza_302
|
||||||
|
- sponza_303
|
||||||
|
- sponza_304
|
||||||
|
- sponza_305
|
||||||
|
- sponza_306
|
||||||
|
- sponza_307
|
||||||
|
- sponza_308
|
||||||
|
- sponza_309
|
||||||
|
- sponza_310
|
||||||
|
- sponza_311
|
||||||
|
- sponza_312
|
||||||
|
- sponza_313
|
||||||
|
- sponza_314
|
||||||
|
- sponza_315
|
||||||
|
- sponza_316
|
||||||
|
- sponza_317
|
||||||
|
- sponza_318
|
||||||
|
- sponza_319
|
||||||
|
- sponza_320
|
||||||
|
- sponza_321
|
||||||
|
- sponza_322
|
||||||
|
- sponza_323
|
||||||
|
- sponza_324
|
||||||
|
- sponza_325
|
||||||
|
- sponza_326
|
||||||
|
- sponza_327
|
||||||
|
- sponza_328
|
||||||
|
- sponza_329
|
||||||
|
- sponza_330
|
||||||
|
- sponza_331
|
||||||
|
- sponza_332
|
||||||
|
- sponza_333
|
||||||
|
- sponza_334
|
||||||
|
- sponza_335
|
||||||
|
- sponza_336
|
||||||
|
- sponza_337
|
||||||
|
- sponza_338
|
||||||
|
- sponza_339
|
||||||
|
- sponza_340
|
||||||
|
- sponza_341
|
||||||
|
- sponza_342
|
||||||
|
- sponza_343
|
||||||
|
- sponza_344
|
||||||
|
- sponza_345
|
||||||
|
- sponza_346
|
||||||
|
- sponza_347
|
||||||
|
- sponza_348
|
||||||
|
- sponza_349
|
||||||
|
- sponza_350
|
||||||
|
- sponza_351
|
||||||
|
- sponza_352
|
||||||
|
- sponza_353
|
||||||
|
- sponza_354
|
||||||
|
- sponza_355
|
||||||
|
- sponza_356
|
||||||
|
- sponza_357
|
||||||
|
- sponza_358
|
||||||
|
- sponza_359
|
||||||
|
- sponza_360
|
||||||
|
- sponza_361
|
||||||
|
- sponza_362
|
||||||
|
- sponza_363
|
||||||
|
- sponza_364
|
||||||
|
- sponza_365
|
||||||
|
- sponza_366
|
||||||
|
- sponza_367
|
||||||
|
- sponza_368
|
||||||
|
- sponza_369
|
||||||
|
- sponza_370
|
||||||
|
- sponza_371
|
||||||
|
- sponza_372
|
||||||
|
- sponza_373
|
||||||
|
- sponza_374
|
||||||
|
- sponza_375
|
||||||
|
- sponza_376
|
||||||
|
- sponza_377
|
||||||
|
- sponza_378
|
||||||
|
- sponza_381
|
||||||
|
padding: 2e000000460000002a000000110000000e0000000c0000000400000033000000330000003300000033000000330000003300000033000000330000000a00000007000000060000002b0000002b00000011000000140000001400000014000000140000002a0000001d000000320000003200000032000000320000002a000000080000000d0000000500000087000000fa00000087000000fa00000087000000fa00000087000000fa00000087000000fb00000087000000fb00000087000000fb00000087000000fb00000087000000fb00000051000000510000005100000051000000510000005100000051000000510000005100000051000000510000000c00000006000000060000002700000028000000390000002b000000150000002700000000010000ba0000009b0000009b000000b70000009d000000b7000000b7000000b70000009b000000b70000009d000000b7000000b7000000b70000009b0000009b0000009b00000083000000ba00000000010000ba0000009b0000009b000000b70000009d000000b7000000b7000000b70000009b000000b70000009d000000b7000000b7000000b70000009b0000009b0000009b00000083000000000100002700000006000000270000002700000027000000270000002d0000001000000010000000230000006a000000000100006a000000000100006a000000000100006a000000000100001e0000002c000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000210000005c000000000100005c000000000100005c000000000100005c000000000100001a00000026000000230000006a000000000100006a000000000100006a000000000100006a000000000100001e0000002c000000630000004300000000010000000100004300000000010000430000000001000043000000430000009400000094000000430000009400000043000000940000004300000024000000270000004600000030000000360000002d000000360000001d0000001d0000001d0000001d0000001d0000001d0000001d0000001d00000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad0000000001000000010000ad000000000100001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b0000001b000000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c00000000010000000100000001000000010000000100000001000000010000000100008c000000000100000001000000010000000100004600000046000000460000004900000049000000490000004900000024000000240000002400000024000000220000001800000004000000
|
||||||
|
unwrapper:
|
||||||
|
- meshName:
|
||||||
|
- VU.1.01-2
|
||||||
|
- VU.1.01-1
|
||||||
|
- VU.1.15-1
|
||||||
|
- VU.013
|
||||||
|
- VU.008
|
||||||
|
padding: 390000003900000034000000310000002d000000
|
||||||
|
unwrapper: 0000000000000000000000000000000000000000
|
||||||
|
assetList:
|
||||||
|
- Assets/Bakery/examples/content/sponza/bush.FBX
|
||||||
|
- Assets/Bakery/examples/content/floor_lamp.FBX
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-09.1.blend
|
||||||
|
- Assets/Models/Ceiling light CGVR.fbx
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-09.2.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-16.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-23.blend
|
||||||
|
uvOverlapAssetList: 00000000ffffffff0000000001010000000000000101000001010000
|
||||||
|
xatlasWarningShown: 0
|
||||||
|
foundCompatibleSetup: 1
|
||||||
|
gpuName: NVIDIA GeForce GTX 1660
|
||||||
|
runsNonRTX: 1
|
||||||
|
runsOptix5: 1
|
||||||
|
runsOptix6: 1
|
||||||
|
runsOptix7: 1
|
||||||
|
runsOIDN: 1
|
||||||
|
alwaysEnableRTX: 0
|
||||||
|
checkerPreviewOn: 0
|
||||||
|
rtSceneViewPreviewOn: 0
|
||||||
|
renderSettingsBounces: 5
|
||||||
|
renderSettingsGISamples: 16
|
||||||
|
renderSettingsGIBackFaceWeight: 0
|
||||||
|
renderSettingsTileSize: 512
|
||||||
|
renderSettingsPriority: 2
|
||||||
|
renderSettingsTexelsPerUnit: 20
|
||||||
|
renderSettingsForceRefresh: 1
|
||||||
|
renderSettingsForceRebuildGeometry: 1
|
||||||
|
renderSettingsPerformRendering: 1
|
||||||
|
renderSettingsUserRenderMode: 0
|
||||||
|
renderSettingsDistanceShadowmask: 0
|
||||||
|
renderSettingsSettingsMode: 0
|
||||||
|
renderSettingsFixSeams: 1
|
||||||
|
renderSettingsDenoise: 1
|
||||||
|
renderSettingsDenoise2x: 0
|
||||||
|
renderSettingsEncode: 1
|
||||||
|
renderSettingsEncodeMode: 0
|
||||||
|
renderSettingsOverwriteWarning: 0
|
||||||
|
renderSettingsAutoAtlas: 1
|
||||||
|
renderSettingsUnwrapUVs: 1
|
||||||
|
renderSettingsForceDisableUnwrapUVs: 0
|
||||||
|
renderSettingsMaxAutoResolution: 4096
|
||||||
|
renderSettingsMinAutoResolution: 16
|
||||||
|
renderSettingsUnloadScenes: 1
|
||||||
|
renderSettingsAdjustSamples: 1
|
||||||
|
renderSettingsGILODMode: 0
|
||||||
|
renderSettingsGILODModeEnabled: 1
|
||||||
|
renderSettingsCheckOverlaps: 0
|
||||||
|
renderSettingsSkipOutOfBoundsUVs: 1
|
||||||
|
renderSettingsHackEmissiveBoost: 1
|
||||||
|
renderSettingsHackIndirectBoost: 1
|
||||||
|
renderSettingsTempPath:
|
||||||
|
renderSettingsOutPath:
|
||||||
|
renderSettingsUseScenePath: 0
|
||||||
|
renderSettingsHackAOIntensity: 0
|
||||||
|
renderSettingsHackAOSamples: 16
|
||||||
|
renderSettingsHackAORadius: 1
|
||||||
|
renderSettingsShowAOSettings: 0
|
||||||
|
renderSettingsShowTasks: 1
|
||||||
|
renderSettingsShowTasks2: 0
|
||||||
|
renderSettingsShowPaths: 1
|
||||||
|
renderSettingsShowNet: 1
|
||||||
|
renderSettingsOcclusionProbes: 0
|
||||||
|
renderSettingsTexelsPerMap: 0
|
||||||
|
renderSettingsTexelsColor: 1
|
||||||
|
renderSettingsTexelsMask: 1
|
||||||
|
renderSettingsTexelsDir: 1
|
||||||
|
renderSettingsShowDirWarning: 1
|
||||||
|
renderSettingsRenderDirMode: 0
|
||||||
|
renderSettingsShowCheckerSettings: 0
|
||||||
|
renderSettingsSamplesWarning: 1
|
||||||
|
renderSettingsPrefabWarning: 1
|
||||||
|
renderSettingsSplitByScene: 0
|
||||||
|
renderSettingsUVPaddingMax: 0
|
||||||
|
renderSettingsPostPacking: 1
|
||||||
|
renderSettingsHoleFilling: 0
|
||||||
|
renderSettingsBeepOnFinish: 0
|
||||||
|
renderSettingsExportTerrainAsHeightmap: 1
|
||||||
|
renderSettingsRTXMode: 0
|
||||||
|
renderSettingsLightProbeMode: 1
|
||||||
|
renderSettingsClientMode: 0
|
||||||
|
renderSettingsServerAddress: 127.0.0.1
|
||||||
|
renderSettingsUnwrapper: 0
|
||||||
|
renderSettingsDenoiserType: 5
|
||||||
|
renderSettingsExportTerrainTrees: 0
|
||||||
|
renderSettingsShowPerf: 1
|
||||||
|
renderSettingsSampleDiv: 1
|
||||||
|
renderSettingsAtlasPacker: 0
|
||||||
|
renderSettingsBatchPoints: 1
|
||||||
|
renderSettingsRTPVExport: 1
|
||||||
|
renderSettingsRTPVSceneView: 0
|
||||||
|
renderSettingsRTPVWidth: 640
|
||||||
|
renderSettingsRTPVHeight: 360
|
||||||
|
modifiedMeshPaddingArray: 35000000
|
||||||
|
modifiedMeshUnwrapperArray: 00000000
|
9
Assets/Bakery/ftGlobalStorage.asset.meta
Normal file
9
Assets/Bakery/ftGlobalStorage.asset.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8f263a97448c55c4e82049cc6cf970c3
|
||||||
|
timeCreated: 1536946135
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
mainObjectFileID: -1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
397
Assets/Bakery/ftGlobalStorage.cs
Normal file
397
Assets/Bakery/ftGlobalStorage.cs
Normal file
@ -0,0 +1,397 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public class ftGlobalStorage : ScriptableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public struct AdjustedMesh
|
||||||
|
{
|
||||||
|
//[SerializeField]
|
||||||
|
//public string assetPath;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<string> meshName;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> padding;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> unwrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public enum Unwrapper
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
xatlas
|
||||||
|
};
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public enum AtlasPacker
|
||||||
|
{
|
||||||
|
Default,
|
||||||
|
xatlas
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public enum DenoiserType
|
||||||
|
{
|
||||||
|
Optix5 = 5, // "Legacy denoiser"
|
||||||
|
Optix6 = 6, // Default denoiser
|
||||||
|
Optix7 = 7, // New denoiser
|
||||||
|
OpenImageDenoise = 100
|
||||||
|
};
|
||||||
|
|
||||||
|
// UV adjustment
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<string> modifiedAssetPathList = new List<string>();
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> modifiedAssetPaddingHash = new List<int>();
|
||||||
|
|
||||||
|
// Legacy
|
||||||
|
[SerializeField]
|
||||||
|
public List<Mesh> modifiedMeshList = new List<Mesh>();
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> modifiedMeshPaddingList = new List<int>();
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<AdjustedMesh> modifiedAssets = new List<AdjustedMesh>();
|
||||||
|
|
||||||
|
// UV overlap marks
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<string> assetList = new List<string>();
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> uvOverlapAssetList = new List<int>(); // -1 = no UV1, 0 = no overlap, 1 = overlap
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool xatlasWarningShown = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool foundCompatibleSetup = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public string gpuName = "";
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool runsNonRTX = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool runsOptix5 = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool runsOptix6 = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool runsOptix7 = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool runsOIDN = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool alwaysEnableRTX = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool checkerPreviewOn = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public bool rtSceneViewPreviewOn = false;
|
||||||
|
|
||||||
|
// Defaults
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsBounces = 5;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsGISamples = 16;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsGIBackFaceWeight = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsTileSize = 512;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsPriority = 2;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsTexelsPerUnit = 20;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsForceRefresh = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsForceRebuildGeometry = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsPerformRendering = true;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsUserRenderMode = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsDistanceShadowmask = false;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsSettingsMode = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsFixSeams = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsDenoise = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsDenoise2x = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsEncode = true;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsEncodeMode = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsOverwriteWarning = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsAutoAtlas = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsUnwrapUVs = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsForceDisableUnwrapUVs = false;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsMaxAutoResolution = 4096;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsMinAutoResolution = 16;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsUnloadScenes = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsAdjustSamples = true;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsGILODMode = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsGILODModeEnabled = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsCheckOverlaps = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsSkipOutOfBoundsUVs = true;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsHackEmissiveBoost = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsHackIndirectBoost = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public string renderSettingsTempPath = "";
|
||||||
|
[SerializeField]
|
||||||
|
public string renderSettingsOutPath = "";
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsUseScenePath = false;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsHackAOIntensity = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsHackAOSamples = 16;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsHackAORadius = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowAOSettings = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowTasks = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowTasks2 = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowPaths = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowNet = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsOcclusionProbes = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsTexelsPerMap = false;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsTexelsColor = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsTexelsMask = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public float renderSettingsTexelsDir = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowDirWarning = true;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsRenderDirMode = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowCheckerSettings = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsSamplesWarning = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsPrefabWarning = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsSplitByScene = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsUVPaddingMax = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsPostPacking = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsHoleFilling = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsBeepOnFinish = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsExportTerrainAsHeightmap = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsRTXMode = false;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsLightProbeMode = 1;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsClientMode = false;
|
||||||
|
[SerializeField]
|
||||||
|
public string renderSettingsServerAddress = "127.0.0.1";
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsUnwrapper = 0;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsDenoiserType = (int)DenoiserType.OpenImageDenoise;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsExportTerrainTrees = false;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsShowPerf = true;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsSampleDiv = 1;
|
||||||
|
//[SerializeField]
|
||||||
|
//public bool renderSettingsLegacyDenoiser = false;
|
||||||
|
[SerializeField]
|
||||||
|
public AtlasPacker renderSettingsAtlasPacker = AtlasPacker.Default;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsBatchPoints = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsRTPVExport = true;
|
||||||
|
[SerializeField]
|
||||||
|
public bool renderSettingsRTPVSceneView = false;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsRTPVWidth = 640;
|
||||||
|
[SerializeField]
|
||||||
|
public int renderSettingsRTPVHeight = 360;
|
||||||
|
|
||||||
|
// Temp
|
||||||
|
|
||||||
|
public Dictionary<string, int> modifiedMeshMap;
|
||||||
|
//public string modifiedMeshPaddingMapAssetName;
|
||||||
|
public List<int> modifiedMeshPaddingArray;
|
||||||
|
public List<int> modifiedMeshUnwrapperArray;
|
||||||
|
|
||||||
|
public void InitModifiedMeshMap(string assetPath) {
|
||||||
|
|
||||||
|
modifiedMeshMap = new Dictionary<string, int>();
|
||||||
|
|
||||||
|
var index = modifiedAssetPathList.IndexOf(assetPath);
|
||||||
|
if (index < 0) return;
|
||||||
|
var m = modifiedAssets[index];
|
||||||
|
for(int j=0; j<m.meshName.Count; j++)
|
||||||
|
{
|
||||||
|
modifiedMeshMap[m.meshName[j]] = j;//m.padding[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
modifiedMeshPaddingArray = m.padding;
|
||||||
|
modifiedMeshUnwrapperArray = m.unwrapper;
|
||||||
|
|
||||||
|
//modifiedMeshPaddingMapAssetName = assetPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ConvertFromLegacy()
|
||||||
|
{
|
||||||
|
for(int a=0; a<modifiedAssetPathList.Count; a++)
|
||||||
|
{
|
||||||
|
while(modifiedAssets.Count <= a)
|
||||||
|
{
|
||||||
|
var str = new AdjustedMesh();
|
||||||
|
str.meshName = new List<string>();
|
||||||
|
str.padding = new List<int>();
|
||||||
|
modifiedAssets.Add(str);
|
||||||
|
}
|
||||||
|
var assetPath = modifiedAssetPathList[a];
|
||||||
|
for(int i=0; i<modifiedMeshList.Count; i++) {
|
||||||
|
var m = modifiedMeshList[i];
|
||||||
|
if (m == null) continue;
|
||||||
|
var mpath = AssetDatabase.GetAssetPath(m);
|
||||||
|
if (mpath != assetPath) continue;
|
||||||
|
|
||||||
|
modifiedAssets[a].meshName.Add(m.name);
|
||||||
|
modifiedAssets[a].padding.Add(modifiedMeshPaddingList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modifiedMeshList = new List<Mesh>();
|
||||||
|
modifiedMeshPaddingList = new List<int>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CalculatePaddingHash(int id)
|
||||||
|
{
|
||||||
|
string s = "";
|
||||||
|
var list = modifiedAssets[id].padding;
|
||||||
|
for(int i=0; i<list.Count; i++) s += list[i]+"_";
|
||||||
|
return s.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
public void SyncModifiedAsset(int index)
|
||||||
|
{
|
||||||
|
var importer = AssetImporter.GetAtPath(modifiedAssetPathList[index]) as ModelImporter;
|
||||||
|
if (importer == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Can't get importer for " + modifiedAssetPathList[index]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var data = modifiedAssets[index];
|
||||||
|
var str = JsonUtility.ToJson(data);
|
||||||
|
var props = importer.extraUserProperties;
|
||||||
|
|
||||||
|
// check if Bakery properties already present
|
||||||
|
int propID = -1;
|
||||||
|
for(int i=0; i<props.Length; i++)
|
||||||
|
{
|
||||||
|
if (props[i].Substring(0,7) == "#BAKERY")
|
||||||
|
{
|
||||||
|
propID = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (propID < 0)
|
||||||
|
{
|
||||||
|
// keep existing properties
|
||||||
|
var newProps = new string[props.Length + 1];
|
||||||
|
for(int i=0; i<props.Length; i++) newProps[i] = props[i];
|
||||||
|
props = newProps;
|
||||||
|
propID = props.Length - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
props[propID] = "#BAKERY" + str;
|
||||||
|
|
||||||
|
importer.extraUserProperties = props;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public void ClearAssetModifications(int index)
|
||||||
|
{
|
||||||
|
var importer = AssetImporter.GetAtPath(modifiedAssetPathList[index]) as ModelImporter;
|
||||||
|
if (importer == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Can't get importer for " + modifiedAssetPathList[index]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
modifiedAssetPathList.RemoveAt(index);
|
||||||
|
modifiedAssets.RemoveAt(index);
|
||||||
|
modifiedAssetPaddingHash.RemoveAt(index);
|
||||||
|
EditorUtility.SetDirty(this);
|
||||||
|
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
var props = importer.extraUserProperties;
|
||||||
|
if (props == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("extraUserProperties is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var newProps = new List<string>();
|
||||||
|
for(int i=0; i<props.Length; i++)
|
||||||
|
{
|
||||||
|
var prop = props[i];
|
||||||
|
if (prop.Substring(0,7) != "#BAKERY")
|
||||||
|
{
|
||||||
|
newProps.Add(prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
importer.extraUserProperties = newProps.ToArray();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
importer.SaveAndReimport();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/ftGlobalStorage.cs.meta
Normal file
12
Assets/Bakery/ftGlobalStorage.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c789d55c4f1cff34799abba03737e8f7
|
||||||
|
timeCreated: 1531245591
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
50
Assets/Bakery/ftLight.shader
Normal file
50
Assets/Bakery/ftLight.shader
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
Shader "Bakery/Light"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_Color ("Main Color", Color) = (1,1,1,1)
|
||||||
|
intensity ("intensity", Float) = 1.0
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" }
|
||||||
|
LOD 100
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
float2 texCoords : TEXCOORD0;
|
||||||
|
UNITY_VERTEX_OUTPUT_STEREO
|
||||||
|
};
|
||||||
|
|
||||||
|
float4 _Color;
|
||||||
|
float intensity;
|
||||||
|
sampler2D _MainTex;
|
||||||
|
|
||||||
|
v2f vert (appdata_full v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
UNITY_SETUP_INSTANCE_ID(v);
|
||||||
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.texCoords = v.texcoord;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
return _Color * intensity * tex2D(_MainTex, i.texCoords);
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftLight.shader.meta
Normal file
9
Assets/Bakery/ftLight.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 44078aff4de957844a86ead7ad169295
|
||||||
|
timeCreated: 1496604962
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
900
Assets/Bakery/ftLightmaps.cs
Normal file
900
Assets/Bakery/ftLightmaps.cs
Normal file
@ -0,0 +1,900 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
// Disable 'obsolete' warnings
|
||||||
|
#pragma warning disable 0618
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.SceneManagement;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.IO;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[InitializeOnLoad]
|
||||||
|
#endif
|
||||||
|
public class ftLightmaps {
|
||||||
|
|
||||||
|
struct LightmapAdditionalData
|
||||||
|
{
|
||||||
|
public Texture2D rnm0, rnm1, rnm2;
|
||||||
|
public int mode;
|
||||||
|
};
|
||||||
|
|
||||||
|
static List<int> lightmapRefCount;
|
||||||
|
static List<LightmapAdditionalData> globalMapsAdditional;
|
||||||
|
static int directionalMode; // -1 undefined, 0 off, 1 on
|
||||||
|
//static List<ftLightmapsStorage> loadedStorages;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public static bool mustReloadRenderSettings = false;
|
||||||
|
static ftGlobalStorage gstorage;
|
||||||
|
static ftLocalStorage lstorage;
|
||||||
|
static bool editorUpdateCalled = false;
|
||||||
|
|
||||||
|
public static string _bakeryRuntimePath = "";
|
||||||
|
public static string _bakeryEditorPath = "";
|
||||||
|
public static string GetRuntimePath()
|
||||||
|
{
|
||||||
|
if (_bakeryRuntimePath.Length == 0)
|
||||||
|
{
|
||||||
|
// Try default path
|
||||||
|
// (start with AssetDatabase assuming it's faster than GetFiles)
|
||||||
|
var a = AssetDatabase.LoadAssetAtPath("Assets/Bakery/ftDefaultAreaLightMat.mat", typeof(Texture2D)) as Texture2D;
|
||||||
|
if (a == null)
|
||||||
|
{
|
||||||
|
// Find elsewhere
|
||||||
|
var assetGUIDs = AssetDatabase.FindAssets("ftDefaultAreaLightMat", null);
|
||||||
|
if (assetGUIDs.Length == 0)
|
||||||
|
{
|
||||||
|
// No extra data present - find the script at least
|
||||||
|
var res = Directory.GetFiles(Application.dataPath, "ftLightmaps.cs", SearchOption.AllDirectories);
|
||||||
|
if (res.Length == 0)
|
||||||
|
{
|
||||||
|
Debug.LogError("Can't locate Bakery folder");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return "Assets" + res[0].Replace("ftLightmaps.cs", "").Replace("\\", "/").Replace(Application.dataPath, "");
|
||||||
|
}
|
||||||
|
if (assetGUIDs.Length > 1)
|
||||||
|
{
|
||||||
|
Debug.LogError("ftDefaultAreaLightMat was found in more than one folder. Do you have multiple installations of Bakery?");
|
||||||
|
}
|
||||||
|
var guid = assetGUIDs[0];
|
||||||
|
_bakeryRuntimePath = System.IO.Path.GetDirectoryName(AssetDatabase.GUIDToAssetPath(guid)) + "/";
|
||||||
|
return _bakeryRuntimePath;
|
||||||
|
}
|
||||||
|
_bakeryRuntimePath = "Assets/Bakery/";
|
||||||
|
}
|
||||||
|
return _bakeryRuntimePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetEditorPath()
|
||||||
|
{
|
||||||
|
if (_bakeryEditorPath.Length == 0)
|
||||||
|
{
|
||||||
|
// Try default path
|
||||||
|
var a = AssetDatabase.LoadAssetAtPath("Assets/Editor/x64/Bakery/NormalsFittingTexture_dds", typeof(Object));
|
||||||
|
if (a == null)
|
||||||
|
{
|
||||||
|
// Find elsewhere
|
||||||
|
var assetGUIDs = AssetDatabase.FindAssets("NormalsFittingTexture_dds", null);
|
||||||
|
if (assetGUIDs.Length == 0)
|
||||||
|
{
|
||||||
|
// No extra data present - find ftModelPostProcessor at least (minimum required editor script)
|
||||||
|
var res = Directory.GetFiles(Application.dataPath, "ftModelPostProcessor.cs", SearchOption.AllDirectories);
|
||||||
|
if (res.Length == 0)
|
||||||
|
{
|
||||||
|
Debug.LogError("Can't locate Bakery folder");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return "Assets" + res[0].Replace("ftModelPostProcessor.cs", "").Replace("\\", "/").Replace(Application.dataPath, "");
|
||||||
|
}
|
||||||
|
if (assetGUIDs.Length > 1)
|
||||||
|
{
|
||||||
|
Debug.LogError("NormalsFittingTexture_dds was found in more than one folder. Do you have multiple installations of Bakery?");
|
||||||
|
}
|
||||||
|
var guid = assetGUIDs[0];
|
||||||
|
_bakeryEditorPath = System.IO.Path.GetDirectoryName(AssetDatabase.GUIDToAssetPath(guid)) + "/";
|
||||||
|
return _bakeryEditorPath;
|
||||||
|
}
|
||||||
|
_bakeryEditorPath = "Assets/Editor/x64/Bakery/";
|
||||||
|
}
|
||||||
|
return _bakeryEditorPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ftGlobalStorage GetGlobalStorage()
|
||||||
|
{
|
||||||
|
if (gstorage != null) return gstorage;
|
||||||
|
var bakeryRuntimePath = GetRuntimePath();
|
||||||
|
gstorage = AssetDatabase.LoadAssetAtPath(bakeryRuntimePath + "ftGlobalStorage.asset", typeof(ftGlobalStorage)) as ftGlobalStorage;
|
||||||
|
if (gstorage == null && editorUpdateCalled) // if editorUpdateCalled==false, it may be not imported yet
|
||||||
|
{
|
||||||
|
var gstorageDefault = AssetDatabase.LoadAssetAtPath(bakeryRuntimePath + "ftDefaultGlobalStorage.asset", typeof(ftGlobalStorage)) as ftGlobalStorage;
|
||||||
|
|
||||||
|
if (gstorageDefault != null)
|
||||||
|
{
|
||||||
|
if (AssetDatabase.CopyAsset(bakeryRuntimePath + "ftDefaultGlobalStorage.asset", bakeryRuntimePath + "ftGlobalStorage.asset"))
|
||||||
|
{
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
gstorage = AssetDatabase.LoadAssetAtPath(bakeryRuntimePath + "ftGlobalStorage.asset", typeof(ftGlobalStorage)) as ftGlobalStorage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gstorage == null)
|
||||||
|
{
|
||||||
|
Debug.Log("Created Bakery GlobalStorage");
|
||||||
|
gstorage = ScriptableObject.CreateInstance<ftGlobalStorage>();
|
||||||
|
AssetDatabase.CreateAsset(gstorage, bakeryRuntimePath + "ftGlobalStorage.asset");
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log("Created Bakery GlobalStorage from DefaultGlobalStorage");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gstorage != null)
|
||||||
|
{
|
||||||
|
if (gstorage.modifiedMeshList.Count > 0)
|
||||||
|
{
|
||||||
|
gstorage.ConvertFromLegacy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return gstorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ftLocalStorage GetLocalStorage()
|
||||||
|
{
|
||||||
|
if (lstorage != null) return lstorage;
|
||||||
|
var bakeryRuntimePath = GetRuntimePath();
|
||||||
|
lstorage = AssetDatabase.LoadAssetAtPath(bakeryRuntimePath + "ftLocalStorage.asset", typeof(ftLocalStorage)) as ftLocalStorage;
|
||||||
|
if (lstorage == null)
|
||||||
|
{
|
||||||
|
Debug.Log("Created Bakery LocalStorage");
|
||||||
|
lstorage = ScriptableObject.CreateInstance<ftLocalStorage>();
|
||||||
|
AssetDatabase.CreateAsset(lstorage, bakeryRuntimePath + "ftLocalStorage.asset");
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
}
|
||||||
|
return lstorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CreateGlobalStorageAsset()
|
||||||
|
{
|
||||||
|
if (gstorage == null) gstorage = GetGlobalStorage();
|
||||||
|
if (lstorage == null) lstorage = GetLocalStorage();
|
||||||
|
|
||||||
|
if (Application.isPlaying) return;
|
||||||
|
|
||||||
|
var listToProccess = gstorage.modifiedAssetPathList;
|
||||||
|
var listToProcessHash = gstorage.modifiedAssetPaddingHash;
|
||||||
|
var listProcessed = lstorage.modifiedAssetPathList;
|
||||||
|
var listProcessedHash = lstorage.modifiedAssetPaddingHash;
|
||||||
|
for(int i=0; i<listToProccess.Count; i++)
|
||||||
|
{
|
||||||
|
int localID = listProcessed.IndexOf(listToProccess[i]);
|
||||||
|
if (localID >= 0)
|
||||||
|
{
|
||||||
|
if (listToProcessHash.Count > i)
|
||||||
|
{
|
||||||
|
int globalPaddingHash = listToProcessHash[i];
|
||||||
|
if (listProcessedHash.Count > localID)
|
||||||
|
{
|
||||||
|
int localPaddingHash = listProcessedHash[localID];
|
||||||
|
if (globalPaddingHash == localPaddingHash)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Hash is not initialized = legacy
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
var importer = AssetImporter.GetAtPath(listToProccess[i]) as ModelImporter;
|
||||||
|
if (importer != null)
|
||||||
|
{
|
||||||
|
var props = importer.extraUserProperties;
|
||||||
|
int propID = -1;
|
||||||
|
for(int p=0; p<props.Length; p++)
|
||||||
|
{
|
||||||
|
if (props[p].Substring(0,7) == "#BAKERY")
|
||||||
|
{
|
||||||
|
propID = p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (propID >= 0) continue; // should be fine without additional reimport - metadata is always loaded with model
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
var asset = AssetDatabase.LoadAssetAtPath(listToProccess[i], typeof(GameObject)) as GameObject;
|
||||||
|
if (asset == null) continue;
|
||||||
|
if (asset.tag == "BakeryProcessed") continue; // legacy
|
||||||
|
//if (asset.tag != "BakeryProcessed") AssetDatabase.ImportAsset(list[i], ImportAssetOptions.ForceUpdate);
|
||||||
|
Debug.Log("Reimporting to adjust UVs: " + listToProccess[i]);
|
||||||
|
AssetDatabase.ImportAsset(listToProccess[i], ImportAssetOptions.ForceUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public static bool IsModelProcessed(string path)
|
||||||
|
{
|
||||||
|
if (lstorage == null) lstorage = GetLocalStorage();
|
||||||
|
var listProcessed = lstorage.modifiedAssetPathList;
|
||||||
|
return listProcessed.Contains(path);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public static void MarkModelProcessed(string path, bool enabled)
|
||||||
|
{
|
||||||
|
if (lstorage == null) lstorage = GetLocalStorage();
|
||||||
|
if (gstorage == null) gstorage = GetGlobalStorage();
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
int gid = gstorage.modifiedAssetPathList.IndexOf(path);
|
||||||
|
if (gid < 0) return;
|
||||||
|
int hash = gstorage.CalculatePaddingHash(gid);
|
||||||
|
while(gstorage.modifiedAssetPaddingHash.Count <= gid) gstorage.modifiedAssetPaddingHash.Add(0);
|
||||||
|
gstorage.modifiedAssetPaddingHash[gid] = hash;
|
||||||
|
|
||||||
|
int id = lstorage.modifiedAssetPathList.IndexOf(path);
|
||||||
|
if (id < 0)
|
||||||
|
{
|
||||||
|
lstorage.modifiedAssetPathList.Add(path);
|
||||||
|
id = lstorage.modifiedAssetPathList.Count - 1;
|
||||||
|
}
|
||||||
|
while(lstorage.modifiedAssetPaddingHash.Count <= id) lstorage.modifiedAssetPaddingHash.Add(0);
|
||||||
|
lstorage.modifiedAssetPaddingHash[id] = hash;
|
||||||
|
EditorUtility.SetDirty(gstorage);
|
||||||
|
EditorSceneManager.MarkAllScenesDirty();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int id = lstorage.modifiedAssetPathList.IndexOf(path);
|
||||||
|
if (id >= 0)
|
||||||
|
{
|
||||||
|
lstorage.modifiedAssetPathList.RemoveAt(id);
|
||||||
|
if (lstorage.modifiedAssetPaddingHash.Count > id) lstorage.modifiedAssetPaddingHash.RemoveAt(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EditorUtility.SetDirty(lstorage);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static ftLightmaps() {
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
EditorSceneManager.sceneOpening -= OnSceneOpening; // Andrew fix
|
||||||
|
EditorSceneManager.sceneOpening += OnSceneOpening;
|
||||||
|
|
||||||
|
EditorApplication.update -= FirstUpdate; // Andrew fix
|
||||||
|
EditorApplication.update += FirstUpdate;
|
||||||
|
|
||||||
|
EditorApplication.hierarchyWindowChanged -= OnSceneChangedEditor;
|
||||||
|
EditorApplication.hierarchyWindowChanged += OnSceneChangedEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SceneManager.activeSceneChanged -= OnSceneChangedPlay;
|
||||||
|
SceneManager.activeSceneChanged += OnSceneChangedPlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
static void FirstUpdate()
|
||||||
|
{
|
||||||
|
editorUpdateCalled = true;
|
||||||
|
CreateGlobalStorageAsset();
|
||||||
|
EditorApplication.update -= FirstUpdate;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void SetDirectionalMode()
|
||||||
|
{
|
||||||
|
if (directionalMode >= 0) LightmapSettings.lightmapsMode = directionalMode==1 ? LightmapsMode.CombinedDirectional : LightmapsMode.NonDirectional;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void OnSceneChangedPlay(Scene prev, Scene next) {
|
||||||
|
//if (Lightmapping.lightingDataAsset == null) {
|
||||||
|
SetDirectionalMode();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
static void OnSceneChangedEditor() {
|
||||||
|
// Unity can modify directional mode on scene change, have to force the correct one
|
||||||
|
// activeSceneChangedInEditMode isn't always available
|
||||||
|
//if (Lightmapping.lightingDataAsset == null) {
|
||||||
|
SetDirectionalMode();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
// using Opening instead of Opened because it's called before lightmap data is loaded and proper directional mode is set
|
||||||
|
//static void OnSceneOpened(Scene scene, OpenSceneMode mode) {
|
||||||
|
static void OnSceneOpening(string path, OpenSceneMode mode) {
|
||||||
|
//Refresh();
|
||||||
|
//if (scene.name == "_tempScene") return;
|
||||||
|
if (Path.GetFileNameWithoutExtension(path) == "_tempScene") return;
|
||||||
|
mustReloadRenderSettings = true;
|
||||||
|
directionalMode = -1;
|
||||||
|
/*if (!finalInitDone)
|
||||||
|
{
|
||||||
|
CreateGlobalStorageAsset();
|
||||||
|
finalInitDone = true;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public static void RefreshFull() {
|
||||||
|
var activeScene = SceneManager.GetActiveScene();
|
||||||
|
var sceneCount = SceneManager.sceneCount;
|
||||||
|
|
||||||
|
for(int i=0; i<sceneCount; i++)
|
||||||
|
{
|
||||||
|
var scene = SceneManager.GetSceneAt(i);
|
||||||
|
if (!scene.isLoaded) continue;
|
||||||
|
SceneManager.SetActiveScene(scene);
|
||||||
|
LightmapSettings.lightmaps = new LightmapData[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<sceneCount; i++)
|
||||||
|
{
|
||||||
|
RefreshScene(SceneManager.GetSceneAt(i), null, true);
|
||||||
|
}
|
||||||
|
SceneManager.SetActiveScene(activeScene);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GameObject FindInScene(string nm, Scene scn)
|
||||||
|
{
|
||||||
|
var objs = scn.GetRootGameObjects();
|
||||||
|
for(int i=0; i<objs.Length; i++)
|
||||||
|
{
|
||||||
|
if (objs[i].name == nm) return objs[i];
|
||||||
|
var obj = objs[i].transform.Find(nm);
|
||||||
|
if (obj != null) return obj.gameObject;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public static void RefreshScene(int sceneID, ref List<LightmapData> lmaps, int lmCounter) {
|
||||||
|
RefreshScene(scene);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
static Texture2D GetEmptyDirectionTex(ftLightmapsStorage storage)
|
||||||
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (storage.emptyDirectionTex == null)
|
||||||
|
{
|
||||||
|
var bakeryRuntimePath = GetRuntimePath();
|
||||||
|
storage.emptyDirectionTex = AssetDatabase.LoadAssetAtPath(bakeryRuntimePath + "emptyDirection.tga", typeof(Texture2D)) as Texture2D;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return storage.emptyDirectionTex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RefreshScene(Scene scene, ftLightmapsStorage storage = null, bool updateNonBaked = false) {
|
||||||
|
var sceneCount = SceneManager.sceneCount;
|
||||||
|
|
||||||
|
if (globalMapsAdditional == null) globalMapsAdditional = new List<LightmapAdditionalData>();
|
||||||
|
|
||||||
|
var lmaps = new List<LightmapData>();
|
||||||
|
var lmapsAdditional = new List<LightmapAdditionalData>();
|
||||||
|
var existingLmaps = LightmapSettings.lightmaps;
|
||||||
|
var existingLmapsAdditional = globalMapsAdditional;
|
||||||
|
|
||||||
|
// Acquire storage
|
||||||
|
if (storage == null)
|
||||||
|
{
|
||||||
|
if (!scene.isLoaded)
|
||||||
|
{
|
||||||
|
//Debug.LogError("dbg: Scene not loaded");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SceneManager.SetActiveScene(scene);
|
||||||
|
|
||||||
|
var go = FindInScene("!ftraceLightmaps", scene);
|
||||||
|
if (go==null) {
|
||||||
|
//Debug.LogError("dbg: no storage");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
storage = go.GetComponent<ftLightmapsStorage>();
|
||||||
|
if (storage == null) {
|
||||||
|
//Debug.LogError("dbg: no storage 2");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (storage.idremap == null || storage.idremap.Length != storage.maps.Count)
|
||||||
|
{
|
||||||
|
storage.idremap = new int[storage.maps.Count];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decide which global engine lightmapping mode to use
|
||||||
|
// TODO: allow mixing different modes
|
||||||
|
directionalMode = storage.dirMaps.Count != 0 ? 1 : 0;
|
||||||
|
bool patchedDirection = false;
|
||||||
|
SetDirectionalMode();
|
||||||
|
|
||||||
|
// Set dummy directional tex for non-directional lightmaps in directional mode
|
||||||
|
if (directionalMode == 1)
|
||||||
|
{
|
||||||
|
for(int i=0; i<existingLmaps.Length; i++)
|
||||||
|
{
|
||||||
|
if (existingLmaps[i].lightmapDir == null)
|
||||||
|
{
|
||||||
|
var lm = existingLmaps[i];
|
||||||
|
lm.lightmapDir = GetEmptyDirectionTex(storage);
|
||||||
|
existingLmaps[i] = lm;
|
||||||
|
patchedDirection = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect if changes to lightmap array are necessary
|
||||||
|
bool sameArray = false;
|
||||||
|
if (existingLmaps.Length == storage.maps.Count)
|
||||||
|
{
|
||||||
|
sameArray = true;
|
||||||
|
for(int i=0; i<storage.maps.Count; i++)
|
||||||
|
{
|
||||||
|
if (existingLmaps[i].lightmapColor != storage.maps[i])
|
||||||
|
{
|
||||||
|
sameArray = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (storage.rnmMaps0.Count > i && (existingLmapsAdditional.Count <= i || existingLmapsAdditional[i].rnm0 != storage.rnmMaps0[i]))
|
||||||
|
{
|
||||||
|
sameArray = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sameArray) // create new lightmap array
|
||||||
|
{
|
||||||
|
if (sceneCount >= 1)
|
||||||
|
{
|
||||||
|
// first add old
|
||||||
|
for(int i=0; i<existingLmaps.Length; i++) {
|
||||||
|
// skip empty lightmaps (can be created by 5.6 ldata asset or vertex color)
|
||||||
|
// ... unless there are valid lightmaps around them
|
||||||
|
bool lightmapIsEmpty = existingLmaps[i] == null || (existingLmaps[i].lightmapColor == null && existingLmaps[i].shadowMask == null);
|
||||||
|
bool lightmapCanBeSkipped = lightmapIsEmpty && (i == 0 || i == existingLmaps.Length - 1);
|
||||||
|
if (!lightmapCanBeSkipped)
|
||||||
|
{
|
||||||
|
lmaps.Add(existingLmaps[i]);
|
||||||
|
if (existingLmapsAdditional.Count > i) lmapsAdditional.Add(existingLmapsAdditional[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<storage.maps.Count; i++) {
|
||||||
|
|
||||||
|
var texlm = storage.maps[i];
|
||||||
|
Texture2D texmask = null;
|
||||||
|
Texture2D texdir = null;
|
||||||
|
Texture2D texrnm0 = null;
|
||||||
|
Texture2D texrnm1 = null;
|
||||||
|
Texture2D texrnm2 = null;
|
||||||
|
int mapMode = 0;
|
||||||
|
if (storage.masks.Count > i) texmask = storage.masks[i];
|
||||||
|
if (storage.dirMaps.Count > i) texdir = storage.dirMaps[i];
|
||||||
|
if (storage.rnmMaps0.Count > i)
|
||||||
|
{
|
||||||
|
texrnm0 = storage.rnmMaps0[i];
|
||||||
|
texrnm1 = storage.rnmMaps1[i];
|
||||||
|
texrnm2 = storage.rnmMaps2[i];
|
||||||
|
mapMode = storage.mapsMode[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
int firstEmpty = -1;
|
||||||
|
for(int j=0; j<lmaps.Count; j++) {
|
||||||
|
if (lmaps[j].lightmapColor == texlm && lmaps[j].shadowMask == texmask)
|
||||||
|
{
|
||||||
|
// lightmap already added - reuse
|
||||||
|
storage.idremap[i] = j;
|
||||||
|
found = true;
|
||||||
|
|
||||||
|
//Debug.LogError("reused "+j);
|
||||||
|
|
||||||
|
// additional maps array could be flushed due to script recompilation - recover
|
||||||
|
if (texrnm0 != null && (lmapsAdditional.Count <= j || lmapsAdditional[j].rnm0 == null))
|
||||||
|
{
|
||||||
|
while(lmapsAdditional.Count <= j) lmapsAdditional.Add(new LightmapAdditionalData());
|
||||||
|
var l = new LightmapAdditionalData();
|
||||||
|
l.rnm0 = texrnm0;
|
||||||
|
l.rnm1 = texrnm1;
|
||||||
|
l.rnm2 = texrnm2;
|
||||||
|
l.mode = mapMode;
|
||||||
|
lmapsAdditional[j] = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (firstEmpty < 0 && lmaps[j].lightmapColor == null && lmaps[j].shadowMask == null)
|
||||||
|
{
|
||||||
|
// free (deleted) entry in existing lightmap list - possibly reuse
|
||||||
|
storage.idremap[i] = j;
|
||||||
|
firstEmpty = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
LightmapData lm;
|
||||||
|
if (firstEmpty >= 0)
|
||||||
|
{
|
||||||
|
lm = lmaps[firstEmpty];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lm = new LightmapData();
|
||||||
|
}
|
||||||
|
|
||||||
|
lm.lightmapColor = texlm;
|
||||||
|
if (storage.masks.Count > i)
|
||||||
|
{
|
||||||
|
lm.shadowMask = texmask;
|
||||||
|
}
|
||||||
|
if (storage.dirMaps.Count > i && texdir != null)
|
||||||
|
{
|
||||||
|
lm.lightmapDir = texdir;
|
||||||
|
}
|
||||||
|
else if (directionalMode == 1)
|
||||||
|
{
|
||||||
|
lm.lightmapDir = GetEmptyDirectionTex(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstEmpty < 0)
|
||||||
|
{
|
||||||
|
lmaps.Add(lm);
|
||||||
|
storage.idremap[i] = lmaps.Count - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lmaps[firstEmpty] = lm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (storage.rnmMaps0.Count > i)
|
||||||
|
{
|
||||||
|
var l = new LightmapAdditionalData();
|
||||||
|
l.rnm0 = texrnm0;
|
||||||
|
l.rnm1 = texrnm1;
|
||||||
|
l.rnm2 = texrnm2;
|
||||||
|
l.mode = mapMode;
|
||||||
|
|
||||||
|
if (firstEmpty < 0)
|
||||||
|
{
|
||||||
|
//Debug.LogError("added "+(lmaps.Count-1));
|
||||||
|
while(lmapsAdditional.Count < lmaps.Count-1) lmapsAdditional.Add(new LightmapAdditionalData());
|
||||||
|
lmapsAdditional.Add(l);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Debug.LogError("set " + firstEmpty);
|
||||||
|
while(lmapsAdditional.Count < firstEmpty+1) lmapsAdditional.Add(new LightmapAdditionalData());
|
||||||
|
lmapsAdditional[firstEmpty] = l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // reuse existing lightmap array, only remap IDs
|
||||||
|
{
|
||||||
|
for(int i=0; i<storage.maps.Count; i++) {
|
||||||
|
storage.idremap[i] = i;
|
||||||
|
|
||||||
|
//Debug.LogError("full reuse");
|
||||||
|
|
||||||
|
/*if (storage.rnmMaps0.Count > i)
|
||||||
|
{
|
||||||
|
var l = new LightmapAdditionalData();
|
||||||
|
l.rnm0 = storage.rnmMaps0[i];
|
||||||
|
l.rnm1 = storage.rnmMaps1[i];
|
||||||
|
l.rnm2 = storage.rnmMaps2[i];
|
||||||
|
l.mode = storage.mapsMode[i];
|
||||||
|
lmapsAdditional.Add(l);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
// Set editor lighting mode
|
||||||
|
if (storage.bakedRenderers != null && storage.bakedRenderers.Count > 0)
|
||||||
|
{
|
||||||
|
Lightmapping.giWorkflowMode = Lightmapping.GIWorkflowMode.OnDemand;
|
||||||
|
Lightmapping.realtimeGI = storage.usesRealtimeGI;
|
||||||
|
//Lightmapping.bakedGI = true; // ? only used for enlighten ? makes editor laggy ?
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Replace the lightmap array if needed
|
||||||
|
if (sameArray && patchedDirection) LightmapSettings.lightmaps = existingLmaps;
|
||||||
|
if (!sameArray)
|
||||||
|
{
|
||||||
|
LightmapSettings.lightmaps = lmaps.ToArray();
|
||||||
|
globalMapsAdditional = lmapsAdditional;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Debug
|
||||||
|
var lms = LightmapSettings.lightmaps;
|
||||||
|
for(int i=0; i<lms.Length; i++)
|
||||||
|
{
|
||||||
|
var name1 = ((lms[i]==null || lms[i].lightmapColor==null) ? "-" : lms[i].lightmapColor.name);
|
||||||
|
var name2 = (globalMapsAdditional.Count > i ?(globalMapsAdditional[i].rnm0==null?"x":globalMapsAdditional[i].rnm0.name) : "-");
|
||||||
|
Debug.LogError(i+" "+name1+" "+name2);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Attempt to update skybox probe
|
||||||
|
if (RenderSettings.ambientMode == UnityEngine.Rendering.AmbientMode.Skybox)// && Lightmapping.lightingDataAsset == null)
|
||||||
|
{
|
||||||
|
var probe = RenderSettings.ambientProbe ;
|
||||||
|
int isEmpty = -1;
|
||||||
|
for(int i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
for(int j=0; j<9; j++)
|
||||||
|
{
|
||||||
|
// default bugged probes are [almost] black or 1302?
|
||||||
|
float a = Mathf.Abs(probe[i,j]);
|
||||||
|
if (a > 1000.0f || a < 0.000001f)
|
||||||
|
{
|
||||||
|
isEmpty = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (probe[i,j] != 0)
|
||||||
|
{
|
||||||
|
isEmpty = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isEmpty >= 0) break;
|
||||||
|
}
|
||||||
|
if (isEmpty != 0)
|
||||||
|
{
|
||||||
|
DynamicGI.UpdateEnvironment();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set lightmap data on mesh renderers
|
||||||
|
var emptyVec4 = new Vector4(1,1,0,0);
|
||||||
|
for(int i=0; i<storage.bakedRenderers.Count; i++)
|
||||||
|
{
|
||||||
|
var r = storage.bakedRenderers[i];
|
||||||
|
if (r == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//if (r.isPartOfStaticBatch) continue;
|
||||||
|
var id = storage.bakedIDs[i];
|
||||||
|
Mesh vmesh = null;
|
||||||
|
if (i < storage.bakedVertexColorMesh.Count) vmesh = storage.bakedVertexColorMesh[i];
|
||||||
|
|
||||||
|
if (vmesh != null)
|
||||||
|
{
|
||||||
|
var r2 = r as MeshRenderer;
|
||||||
|
if (r2 == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Unity cannot use additionalVertexStreams on non-MeshRenderer");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r2.additionalVertexStreams = vmesh;
|
||||||
|
r2.lightmapIndex = 0xFFFF;
|
||||||
|
var prop = new MaterialPropertyBlock();
|
||||||
|
prop.SetFloat("bakeryLightmapMode", 1);
|
||||||
|
r2.SetPropertyBlock(prop);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int globalID = (id < 0 || id >= storage.idremap.Length) ? id : storage.idremap[id];
|
||||||
|
r.lightmapIndex = globalID;
|
||||||
|
|
||||||
|
if (!r.isPartOfStaticBatch)
|
||||||
|
{
|
||||||
|
// scaleOffset is baked on static batches already
|
||||||
|
var scaleOffset = id < 0 ? emptyVec4 : storage.bakedScaleOffset[i];
|
||||||
|
r.lightmapScaleOffset = scaleOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r.lightmapIndex >= 0 && globalID < globalMapsAdditional.Count)
|
||||||
|
{
|
||||||
|
var lmap = globalMapsAdditional[globalID];
|
||||||
|
if (lmap.rnm0 != null)
|
||||||
|
{
|
||||||
|
var prop = new MaterialPropertyBlock();
|
||||||
|
prop.SetTexture("_RNM0", lmap.rnm0);
|
||||||
|
prop.SetTexture("_RNM1", lmap.rnm1);
|
||||||
|
prop.SetTexture("_RNM2", lmap.rnm2);
|
||||||
|
prop.SetFloat("bakeryLightmapMode", lmap.mode);
|
||||||
|
r.SetPropertyBlock(prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set lightmap data on definitely-not-baked mesh renderers (can be possibly avoided)
|
||||||
|
if (updateNonBaked)
|
||||||
|
{
|
||||||
|
for(int i=0; i<storage.nonBakedRenderers.Count; i++)
|
||||||
|
{
|
||||||
|
var r = storage.nonBakedRenderers[i];
|
||||||
|
if (r == null) continue;
|
||||||
|
if (r.isPartOfStaticBatch) continue;
|
||||||
|
r.lightmapIndex = 0xFFFE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set lightmap data on terrains
|
||||||
|
for(int i=0; i<storage.bakedRenderersTerrain.Count; i++)
|
||||||
|
{
|
||||||
|
var r = storage.bakedRenderersTerrain[i];
|
||||||
|
if (r == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var id = storage.bakedIDsTerrain[i];
|
||||||
|
r.lightmapIndex = (id < 0 || id >= storage.idremap.Length) ? id : storage.idremap[id];
|
||||||
|
|
||||||
|
var scaleOffset = id < 0 ? emptyVec4 : storage.bakedScaleOffsetTerrain[i];
|
||||||
|
r.lightmapScaleOffset = scaleOffset;
|
||||||
|
|
||||||
|
if (r.lightmapIndex >= 0 && r.lightmapIndex < globalMapsAdditional.Count)
|
||||||
|
{
|
||||||
|
var lmap = globalMapsAdditional[r.lightmapIndex];
|
||||||
|
if (lmap.rnm0 != null)
|
||||||
|
{
|
||||||
|
var prop = new MaterialPropertyBlock();
|
||||||
|
prop.SetTexture("_RNM0", lmap.rnm0);
|
||||||
|
prop.SetTexture("_RNM1", lmap.rnm1);
|
||||||
|
prop.SetTexture("_RNM2", lmap.rnm2);
|
||||||
|
prop.SetFloat("bakeryLightmapMode", lmap.mode);
|
||||||
|
r.SetSplatMaterialPropertyBlock(prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set shadowmask parameters on lights
|
||||||
|
for(int i=0; i<storage.bakedLights.Count; i++)
|
||||||
|
{
|
||||||
|
#if UNITY_2017_3_OR_NEWER
|
||||||
|
if (storage.bakedLights[i] == null) continue;
|
||||||
|
|
||||||
|
int channel = storage.bakedLightChannels[i];
|
||||||
|
var output = new LightBakingOutput();
|
||||||
|
output.isBaked = true;
|
||||||
|
if (channel < 0)
|
||||||
|
{
|
||||||
|
output.lightmapBakeType = LightmapBakeType.Baked;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
output.lightmapBakeType = LightmapBakeType.Mixed;
|
||||||
|
output.mixedLightingMode = channel > 100 ? MixedLightingMode.Subtractive : MixedLightingMode.Shadowmask;
|
||||||
|
output.occlusionMaskChannel = channel > 100 ? -1 : channel;
|
||||||
|
output.probeOcclusionLightIndex = storage.bakedLights[i].bakingOutput.probeOcclusionLightIndex;
|
||||||
|
}
|
||||||
|
storage.bakedLights[i].bakingOutput = output;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increment lightmap refcounts
|
||||||
|
if (lightmapRefCount == null) lightmapRefCount = new List<int>();
|
||||||
|
for(int i=0; i<storage.idremap.Length; i++)
|
||||||
|
{
|
||||||
|
int currentID = storage.idremap[i];
|
||||||
|
while(lightmapRefCount.Count <= currentID) lightmapRefCount.Add(0);
|
||||||
|
if (lightmapRefCount[currentID] < 0) lightmapRefCount[currentID] = 0;
|
||||||
|
lightmapRefCount[currentID]++;
|
||||||
|
}
|
||||||
|
//if (loadedStorages == null) loadedStorages = new List<ftLightmapsStorage>();
|
||||||
|
//if (loadedStorages.Contains(storage)) loadedStorages.Add(storage);
|
||||||
|
|
||||||
|
//return appendOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnloadScene(ftLightmapsStorage storage)
|
||||||
|
{
|
||||||
|
if (lightmapRefCount == null) return;
|
||||||
|
if (storage.idremap == null) return;
|
||||||
|
|
||||||
|
//int idx = loadedStorages.IndexOf(storage);
|
||||||
|
//if (idx >= 0) loadedStorages.RemoveAt(idx);
|
||||||
|
|
||||||
|
LightmapData[] existingLmaps = null;
|
||||||
|
List<LightmapAdditionalData> existingLmapsAdditional = null;
|
||||||
|
//bool rebuild = false;
|
||||||
|
for(int i=0; i<storage.idremap.Length; i++)
|
||||||
|
{
|
||||||
|
int currentID = storage.idremap[i];
|
||||||
|
|
||||||
|
// just never unload the 1st lightmap to prevent Unity from losing LM encoding settings
|
||||||
|
// remapping all IDs at runtime would introduce a perf hiccup
|
||||||
|
if (currentID == 0) continue;
|
||||||
|
|
||||||
|
if (lightmapRefCount.Count <= currentID) continue;
|
||||||
|
lightmapRefCount[currentID]--;
|
||||||
|
//Debug.LogError("rem: "+currentID+" "+lightmapRefCount[currentID]);
|
||||||
|
if (lightmapRefCount[currentID] == 0)
|
||||||
|
{
|
||||||
|
if (existingLmaps == null) existingLmaps = LightmapSettings.lightmaps;
|
||||||
|
|
||||||
|
if (existingLmaps.Length > currentID)
|
||||||
|
{
|
||||||
|
existingLmaps[currentID].lightmapColor = null;
|
||||||
|
existingLmaps[currentID].lightmapDir = null;
|
||||||
|
existingLmaps[currentID].shadowMask = null;
|
||||||
|
|
||||||
|
if (existingLmapsAdditional == null) existingLmapsAdditional = globalMapsAdditional;
|
||||||
|
if (existingLmapsAdditional != null && existingLmapsAdditional.Count > currentID)
|
||||||
|
{
|
||||||
|
var emptyEntry = new LightmapAdditionalData();
|
||||||
|
existingLmapsAdditional[currentID] = emptyEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if (currentID == 0) rebuild = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// If the first lightmap was unloaded, we need to rebuild the lightmap array
|
||||||
|
// because Unity uses 1st lightmap to determine encoding
|
||||||
|
if (rebuild)
|
||||||
|
{
|
||||||
|
int newLength = 0;
|
||||||
|
for(int i=0; i<existingLmaps.Length; i++)
|
||||||
|
{
|
||||||
|
if (existingLmaps[i].lightmapColor != null) newLength++;
|
||||||
|
}
|
||||||
|
var existingLmaps2 = new LightmapData[newLength];
|
||||||
|
int ctr = 0;
|
||||||
|
for(int i=0; i<existingLmaps.Length; i++)
|
||||||
|
{
|
||||||
|
if (existingLmaps[i].lightmapColor != null)
|
||||||
|
{
|
||||||
|
existingLmaps2[ctr] = existingLmaps[i];
|
||||||
|
ctr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
existingLmaps = existingLmaps2;
|
||||||
|
|
||||||
|
for(int i=0; i<)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (existingLmaps != null) LightmapSettings.lightmaps = existingLmaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RefreshScene2(Scene scene, ftLightmapsStorage storage) {
|
||||||
|
Renderer r;
|
||||||
|
int id;
|
||||||
|
for(int i=0; i<storage.bakedRenderers.Count; i++)
|
||||||
|
{
|
||||||
|
r = storage.bakedRenderers[i];
|
||||||
|
if (r == null) continue;
|
||||||
|
|
||||||
|
id = storage.bakedIDs[i];
|
||||||
|
r.lightmapIndex = (id < 0 || id >= storage.idremap.Length) ? id : storage.idremap[id];
|
||||||
|
}
|
||||||
|
|
||||||
|
Terrain r2;
|
||||||
|
for(int i=0; i<storage.bakedRenderersTerrain.Count; i++)
|
||||||
|
{
|
||||||
|
r2 = storage.bakedRenderersTerrain[i];
|
||||||
|
if (r2 == null) continue;
|
||||||
|
|
||||||
|
id = storage.bakedIDsTerrain[i];
|
||||||
|
r2.lightmapIndex = (id < 0 || id >= storage.idremap.Length) ? id : storage.idremap[id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/Bakery/ftLightmaps.cs.meta
Normal file
12
Assets/Bakery/ftLightmaps.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a45445dfd5b7b44cb9545da4e5ed41c
|
||||||
|
timeCreated: 1496213851
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
458
Assets/Bakery/ftLightmapsStorage.cs
Normal file
458
Assets/Bakery/ftLightmapsStorage.cs
Normal file
@ -0,0 +1,458 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
public class ftLightmapsStorage : MonoBehaviour{
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[System.Serializable]
|
||||||
|
public class LightData {
|
||||||
|
public Matrix4x4 tform;
|
||||||
|
public Color color;
|
||||||
|
public float intensity, range, radius;
|
||||||
|
public int samples, samples2;
|
||||||
|
public int bitmask;
|
||||||
|
public bool bakeToIndirect;
|
||||||
|
public bool selfShadow = false;
|
||||||
|
public bool realisticFalloff = false;
|
||||||
|
public int projMode;
|
||||||
|
public Object cookie;
|
||||||
|
public float angle = 30.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ImplicitLightmapData
|
||||||
|
{
|
||||||
|
public Dictionary<GameObject, Object> implicitGroupMap = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Saved render settings
|
||||||
|
public int renderSettingsBounces = 5;
|
||||||
|
public int renderSettingsGISamples = 16;
|
||||||
|
public float renderSettingsGIBackFaceWeight = 0;
|
||||||
|
public int renderSettingsTileSize = 512;
|
||||||
|
public float renderSettingsPriority = 2;
|
||||||
|
public float renderSettingsTexelsPerUnit = 20;
|
||||||
|
public bool renderSettingsForceRefresh = true;
|
||||||
|
public bool renderSettingsForceRebuildGeometry = true;
|
||||||
|
public bool renderSettingsPerformRendering = true;
|
||||||
|
public int renderSettingsUserRenderMode = 0;
|
||||||
|
public bool renderSettingsDistanceShadowmask = false;
|
||||||
|
public int renderSettingsSettingsMode = 0;
|
||||||
|
public bool renderSettingsFixSeams = true;
|
||||||
|
public bool renderSettingsDenoise = true;
|
||||||
|
public bool renderSettingsDenoise2x = false;
|
||||||
|
public bool renderSettingsEncode = true;
|
||||||
|
public int renderSettingsEncodeMode = 0;
|
||||||
|
public bool renderSettingsOverwriteWarning = false;
|
||||||
|
public bool renderSettingsAutoAtlas = true;
|
||||||
|
public bool renderSettingsUnwrapUVs = true;
|
||||||
|
public bool renderSettingsForceDisableUnwrapUVs = false;
|
||||||
|
public int renderSettingsMaxAutoResolution = 4096;
|
||||||
|
public int renderSettingsMinAutoResolution = 16;
|
||||||
|
public bool renderSettingsUnloadScenes = true;
|
||||||
|
public bool renderSettingsAdjustSamples = true;
|
||||||
|
public int renderSettingsGILODMode = 0;
|
||||||
|
public bool renderSettingsGILODModeEnabled = true;
|
||||||
|
public bool renderSettingsCheckOverlaps = false;
|
||||||
|
public bool renderSettingsSkipOutOfBoundsUVs = true;
|
||||||
|
public float renderSettingsHackEmissiveBoost = 1;
|
||||||
|
public float renderSettingsHackIndirectBoost = 1;
|
||||||
|
public string renderSettingsTempPath = "";
|
||||||
|
public string renderSettingsOutPath = "";
|
||||||
|
public bool renderSettingsUseScenePath = false;
|
||||||
|
public float renderSettingsHackAOIntensity = 0;
|
||||||
|
public int renderSettingsHackAOSamples = 16;
|
||||||
|
public float renderSettingsHackAORadius = 1;
|
||||||
|
public bool renderSettingsShowAOSettings = false;
|
||||||
|
public bool renderSettingsShowTasks = true;
|
||||||
|
public bool renderSettingsShowTasks2 = false;
|
||||||
|
public bool renderSettingsShowPaths = true;
|
||||||
|
public bool renderSettingsShowNet = true;
|
||||||
|
public bool renderSettingsOcclusionProbes = false;
|
||||||
|
public bool renderSettingsTexelsPerMap = false;
|
||||||
|
public float renderSettingsTexelsColor = 1;
|
||||||
|
public float renderSettingsTexelsMask = 1;
|
||||||
|
public float renderSettingsTexelsDir = 1;
|
||||||
|
public bool renderSettingsShowDirWarning = true;
|
||||||
|
public int renderSettingsRenderDirMode = 0;
|
||||||
|
public bool renderSettingsShowCheckerSettings = false;
|
||||||
|
public bool renderSettingsSamplesWarning = true;
|
||||||
|
public bool renderSettingsPrefabWarning = true;
|
||||||
|
public bool renderSettingsSplitByScene = false;
|
||||||
|
public bool renderSettingsUVPaddingMax = false;
|
||||||
|
public bool renderSettingsPostPacking = true;
|
||||||
|
public bool renderSettingsHoleFilling = false;
|
||||||
|
public bool renderSettingsBeepOnFinish = false;
|
||||||
|
public bool renderSettingsExportTerrainAsHeightmap = true;
|
||||||
|
public bool renderSettingsRTXMode = false;
|
||||||
|
public int renderSettingsLightProbeMode = 1;
|
||||||
|
public bool renderSettingsClientMode = false;
|
||||||
|
public string renderSettingsServerAddress = "127.0.0.1";
|
||||||
|
public int renderSettingsUnwrapper = 0;
|
||||||
|
public int renderSettingsDenoiserType = (int)ftGlobalStorage.DenoiserType.OpenImageDenoise;
|
||||||
|
public bool renderSettingsExportTerrainTrees = false;
|
||||||
|
public bool renderSettingsShowPerf = true;
|
||||||
|
public int renderSettingsSampleDiv = 1;
|
||||||
|
public ftGlobalStorage.AtlasPacker renderSettingsAtlasPacker = ftGlobalStorage.AtlasPacker.xatlas;
|
||||||
|
public bool renderSettingsBatchPoints = true;
|
||||||
|
public bool renderSettingsRTPVExport = true;
|
||||||
|
public bool renderSettingsRTPVSceneView = false;
|
||||||
|
public int renderSettingsRTPVWidth = 640;
|
||||||
|
public int renderSettingsRTPVHeight = 360;
|
||||||
|
public int lastBakeTime = 0;
|
||||||
|
|
||||||
|
public bool enlightenWarningShown = false;
|
||||||
|
public bool enlightenWarningShown2 = false;
|
||||||
|
|
||||||
|
// Light settings from the last bake
|
||||||
|
public List<int> lightUIDs = new List<int>();
|
||||||
|
public List<LightData> lights = new List<LightData>();
|
||||||
|
public Dictionary<int, LightData> lightsDict;
|
||||||
|
|
||||||
|
// List of implicit groups
|
||||||
|
//public List<BakeryLightmapGroup> implicitGroups = new List<BakeryLightmapGroup>();
|
||||||
|
public List<Object> implicitGroups = new List<Object>();
|
||||||
|
public List<GameObject> implicitGroupedObjects;
|
||||||
|
|
||||||
|
//public List<BakeryLightmapGroupPlain> previouslyBakedGroups = new List<BakeryLightmapGroupPlain>();
|
||||||
|
|
||||||
|
// List of baked lightmap world-space bounds
|
||||||
|
public List<Bounds> bounds = new List<Bounds>();
|
||||||
|
|
||||||
|
// Per-lightmap flags
|
||||||
|
public List<bool> hasEmissive = new List<bool>();
|
||||||
|
|
||||||
|
//public float[][] uvSrc;
|
||||||
|
//public float[][] uvDest;
|
||||||
|
//public int[][] lmrIndices;
|
||||||
|
public int[] uvBuffOffsets;
|
||||||
|
public int[] uvBuffLengths;
|
||||||
|
public float[] uvSrcBuff;
|
||||||
|
public float[] uvDestBuff;
|
||||||
|
public int[] lmrIndicesOffsets;
|
||||||
|
public int[] lmrIndicesLengths;
|
||||||
|
public int[] lmrIndicesBuff;
|
||||||
|
|
||||||
|
public int[] lmGroupLODResFlags; // bits which lods are needed for which LMGroups
|
||||||
|
public int[] lmGroupMinLOD; // minimum possible resolution for given LMGroup given UV island count
|
||||||
|
public int[] lmGroupLODMatrix;
|
||||||
|
|
||||||
|
// Reuired for network bakes
|
||||||
|
public List<string> serverGetFileList = new List<string>();
|
||||||
|
public List<bool> lightmapHasColor = new List<bool>();
|
||||||
|
public List<bool> lightmapHasMask = new List<bool>();
|
||||||
|
public List<bool> lightmapHasDir = new List<bool>();
|
||||||
|
public List<bool> lightmapHasRNM = new List<bool>();
|
||||||
|
|
||||||
|
// Partial copy of GlobalStorage to recover UV padding if needed
|
||||||
|
public List<string> modifiedAssetPathList = new List<string>();
|
||||||
|
public List<ftGlobalStorage.AdjustedMesh> modifiedAssets = new List<ftGlobalStorage.AdjustedMesh>();
|
||||||
|
|
||||||
|
public Texture2D debugTex;
|
||||||
|
public RenderTexture debugRT;
|
||||||
|
|
||||||
|
public void Init() {
|
||||||
|
lightsDict = new Dictionary<int, LightData>();
|
||||||
|
for(int i=0; i<lights.Count; i++) {
|
||||||
|
lightsDict[lightUIDs[i]] = lights[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreLight(int uid, LightData light) {
|
||||||
|
lightUIDs.Add(uid);
|
||||||
|
lights.Add(light);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)
|
||||||
|
{
|
||||||
|
dest.renderSettingsBounces = src.renderSettingsBounces;
|
||||||
|
dest.renderSettingsGISamples = src.renderSettingsGISamples;
|
||||||
|
dest.renderSettingsGIBackFaceWeight = src.renderSettingsGIBackFaceWeight;
|
||||||
|
dest.renderSettingsTileSize = src.renderSettingsTileSize;
|
||||||
|
dest.renderSettingsPriority = src.renderSettingsPriority;
|
||||||
|
dest.renderSettingsTexelsPerUnit = src.renderSettingsTexelsPerUnit;
|
||||||
|
dest.renderSettingsForceRefresh = src.renderSettingsForceRefresh;
|
||||||
|
dest.renderSettingsForceRebuildGeometry = src.renderSettingsForceRebuildGeometry;
|
||||||
|
dest.renderSettingsPerformRendering = src.renderSettingsPerformRendering;
|
||||||
|
dest.renderSettingsUserRenderMode = src.renderSettingsUserRenderMode;
|
||||||
|
dest.renderSettingsDistanceShadowmask = src.renderSettingsDistanceShadowmask;
|
||||||
|
dest.renderSettingsSettingsMode = src.renderSettingsSettingsMode;
|
||||||
|
dest.renderSettingsFixSeams = src.renderSettingsFixSeams;
|
||||||
|
dest.renderSettingsDenoise = src.renderSettingsDenoise;
|
||||||
|
dest.renderSettingsDenoise2x = src.renderSettingsDenoise2x;
|
||||||
|
dest.renderSettingsEncode = src.renderSettingsEncode;
|
||||||
|
dest.renderSettingsEncodeMode = src.renderSettingsEncodeMode;
|
||||||
|
dest.renderSettingsOverwriteWarning = src.renderSettingsOverwriteWarning;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
dest.renderSettingsUnwrapUVs = src.renderSettingsUnwrapUVs;
|
||||||
|
dest.renderSettingsForceDisableUnwrapUVs = src.renderSettingsForceDisableUnwrapUVs;
|
||||||
|
dest.renderSettingsMaxAutoResolution = src.renderSettingsMaxAutoResolution;
|
||||||
|
dest.renderSettingsMinAutoResolution = src.renderSettingsMinAutoResolution;
|
||||||
|
dest.renderSettingsUnloadScenes = src.renderSettingsUnloadScenes;
|
||||||
|
dest.renderSettingsAdjustSamples = src.renderSettingsAdjustSamples;
|
||||||
|
dest.renderSettingsGILODMode = src.renderSettingsGILODMode;
|
||||||
|
dest.renderSettingsGILODModeEnabled = src.renderSettingsGILODModeEnabled;
|
||||||
|
dest.renderSettingsCheckOverlaps = src.renderSettingsCheckOverlaps;
|
||||||
|
dest.renderSettingsSkipOutOfBoundsUVs = src.renderSettingsSkipOutOfBoundsUVs;
|
||||||
|
dest.renderSettingsHackEmissiveBoost = src.renderSettingsHackEmissiveBoost;
|
||||||
|
dest.renderSettingsHackIndirectBoost = src.renderSettingsHackIndirectBoost;
|
||||||
|
dest.renderSettingsTempPath = src.renderSettingsTempPath;
|
||||||
|
dest.renderSettingsOutPath = src.renderSettingsOutPath;
|
||||||
|
dest.renderSettingsUseScenePath = src.renderSettingsUseScenePath;
|
||||||
|
dest.renderSettingsHackAOIntensity = src.renderSettingsHackAOIntensity;
|
||||||
|
dest.renderSettingsHackAOSamples = src.renderSettingsHackAOSamples;
|
||||||
|
dest.renderSettingsHackAORadius = src.renderSettingsHackAORadius;
|
||||||
|
dest.renderSettingsShowAOSettings = src.renderSettingsShowAOSettings;
|
||||||
|
dest.renderSettingsShowTasks = src.renderSettingsShowTasks;
|
||||||
|
dest.renderSettingsShowTasks2 = src.renderSettingsShowTasks2;
|
||||||
|
dest.renderSettingsShowPaths = src.renderSettingsShowPaths;
|
||||||
|
dest.renderSettingsShowNet = src.renderSettingsShowNet;
|
||||||
|
dest.renderSettingsOcclusionProbes = src.renderSettingsOcclusionProbes;
|
||||||
|
dest.renderSettingsTexelsPerMap = src.renderSettingsTexelsPerMap;
|
||||||
|
dest.renderSettingsTexelsColor = src.renderSettingsTexelsColor;
|
||||||
|
dest.renderSettingsTexelsMask = src.renderSettingsTexelsMask;
|
||||||
|
dest.renderSettingsTexelsDir = src.renderSettingsTexelsDir;
|
||||||
|
dest.renderSettingsShowDirWarning = src.renderSettingsShowDirWarning;
|
||||||
|
dest.renderSettingsRenderDirMode = src.renderSettingsRenderDirMode;
|
||||||
|
dest.renderSettingsShowCheckerSettings = src.renderSettingsShowCheckerSettings;
|
||||||
|
dest.renderSettingsSamplesWarning = src.renderSettingsSamplesWarning;
|
||||||
|
dest.renderSettingsPrefabWarning = src.renderSettingsPrefabWarning;
|
||||||
|
dest.renderSettingsSplitByScene = src.renderSettingsSplitByScene;
|
||||||
|
dest.renderSettingsUVPaddingMax = src.renderSettingsUVPaddingMax;
|
||||||
|
dest.renderSettingsPostPacking = src.renderSettingsPostPacking;
|
||||||
|
dest.renderSettingsHoleFilling = src.renderSettingsHoleFilling;
|
||||||
|
dest.renderSettingsBeepOnFinish = src.renderSettingsBeepOnFinish;
|
||||||
|
dest.renderSettingsExportTerrainAsHeightmap = src.renderSettingsExportTerrainAsHeightmap;
|
||||||
|
dest.renderSettingsRTXMode = src.renderSettingsRTXMode;
|
||||||
|
dest.renderSettingsLightProbeMode = src.renderSettingsLightProbeMode;
|
||||||
|
dest.renderSettingsClientMode = src.renderSettingsClientMode;
|
||||||
|
dest.renderSettingsServerAddress = src.renderSettingsServerAddress;
|
||||||
|
dest.renderSettingsUnwrapper = src.renderSettingsUnwrapper;
|
||||||
|
dest.renderSettingsDenoiserType = src.renderSettingsDenoiserType;
|
||||||
|
dest.renderSettingsExportTerrainTrees = src.renderSettingsExportTerrainTrees;
|
||||||
|
dest.renderSettingsSampleDiv = src.renderSettingsSampleDiv;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
dest.renderSettingsBatchPoints = src.renderSettingsBatchPoints;
|
||||||
|
dest.renderSettingsRTPVExport = src.renderSettingsRTPVExport;
|
||||||
|
dest.renderSettingsRTPVSceneView = src.renderSettingsRTPVSceneView;
|
||||||
|
dest.renderSettingsRTPVWidth = src.renderSettingsRTPVWidth;
|
||||||
|
dest.renderSettingsRTPVHeight = src.renderSettingsRTPVHeight;
|
||||||
|
dest.renderSettingsAtlasPacker = src.renderSettingsAtlasPacker;
|
||||||
|
dest.renderSettingsShowPerf = src.renderSettingsShowPerf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)
|
||||||
|
{
|
||||||
|
dest.renderSettingsBounces = src.renderSettingsBounces;
|
||||||
|
dest.renderSettingsGISamples = src.renderSettingsGISamples;
|
||||||
|
dest.renderSettingsGIBackFaceWeight = src.renderSettingsGIBackFaceWeight;
|
||||||
|
dest.renderSettingsTileSize = src.renderSettingsTileSize;
|
||||||
|
dest.renderSettingsPriority = src.renderSettingsPriority;
|
||||||
|
dest.renderSettingsTexelsPerUnit = src.renderSettingsTexelsPerUnit;
|
||||||
|
dest.renderSettingsForceRefresh = src.renderSettingsForceRefresh;
|
||||||
|
dest.renderSettingsForceRebuildGeometry = src.renderSettingsForceRebuildGeometry;
|
||||||
|
dest.renderSettingsPerformRendering = src.renderSettingsPerformRendering;
|
||||||
|
dest.renderSettingsUserRenderMode = src.renderSettingsUserRenderMode;
|
||||||
|
dest.renderSettingsDistanceShadowmask = src.renderSettingsDistanceShadowmask;
|
||||||
|
dest.renderSettingsSettingsMode = src.renderSettingsSettingsMode;
|
||||||
|
dest.renderSettingsFixSeams = src.renderSettingsFixSeams;
|
||||||
|
dest.renderSettingsDenoise = src.renderSettingsDenoise;
|
||||||
|
dest.renderSettingsDenoise2x = src.renderSettingsDenoise2x;
|
||||||
|
dest.renderSettingsEncode = src.renderSettingsEncode;
|
||||||
|
dest.renderSettingsEncodeMode = src.renderSettingsEncodeMode;
|
||||||
|
dest.renderSettingsOverwriteWarning = src.renderSettingsOverwriteWarning;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
dest.renderSettingsUnwrapUVs = src.renderSettingsUnwrapUVs;
|
||||||
|
dest.renderSettingsForceDisableUnwrapUVs = src.renderSettingsForceDisableUnwrapUVs;
|
||||||
|
dest.renderSettingsMaxAutoResolution = src.renderSettingsMaxAutoResolution;
|
||||||
|
dest.renderSettingsMinAutoResolution = src.renderSettingsMinAutoResolution;
|
||||||
|
dest.renderSettingsUnloadScenes = src.renderSettingsUnloadScenes;
|
||||||
|
dest.renderSettingsAdjustSamples = src.renderSettingsAdjustSamples;
|
||||||
|
dest.renderSettingsGILODMode = src.renderSettingsGILODMode;
|
||||||
|
dest.renderSettingsGILODModeEnabled = src.renderSettingsGILODModeEnabled;
|
||||||
|
dest.renderSettingsCheckOverlaps = src.renderSettingsCheckOverlaps;
|
||||||
|
dest.renderSettingsSkipOutOfBoundsUVs = src.renderSettingsSkipOutOfBoundsUVs;
|
||||||
|
dest.renderSettingsHackEmissiveBoost = src.renderSettingsHackEmissiveBoost;
|
||||||
|
dest.renderSettingsHackIndirectBoost = src.renderSettingsHackIndirectBoost;
|
||||||
|
dest.renderSettingsTempPath = src.renderSettingsTempPath;
|
||||||
|
dest.renderSettingsOutPath = src.renderSettingsOutPath;
|
||||||
|
dest.renderSettingsUseScenePath = src.renderSettingsUseScenePath;
|
||||||
|
dest.renderSettingsHackAOIntensity = src.renderSettingsHackAOIntensity;
|
||||||
|
dest.renderSettingsHackAOSamples = src.renderSettingsHackAOSamples;
|
||||||
|
dest.renderSettingsHackAORadius = src.renderSettingsHackAORadius;
|
||||||
|
dest.renderSettingsShowAOSettings = src.renderSettingsShowAOSettings;
|
||||||
|
dest.renderSettingsShowTasks = src.renderSettingsShowTasks;
|
||||||
|
dest.renderSettingsShowTasks2 = src.renderSettingsShowTasks2;
|
||||||
|
dest.renderSettingsShowPaths = src.renderSettingsShowPaths;
|
||||||
|
dest.renderSettingsShowNet = src.renderSettingsShowNet;
|
||||||
|
dest.renderSettingsOcclusionProbes = src.renderSettingsOcclusionProbes;
|
||||||
|
dest.renderSettingsTexelsPerMap = src.renderSettingsTexelsPerMap;
|
||||||
|
dest.renderSettingsTexelsColor = src.renderSettingsTexelsColor;
|
||||||
|
dest.renderSettingsTexelsMask = src.renderSettingsTexelsMask;
|
||||||
|
dest.renderSettingsTexelsDir = src.renderSettingsTexelsDir;
|
||||||
|
dest.renderSettingsShowDirWarning = src.renderSettingsShowDirWarning;
|
||||||
|
dest.renderSettingsRenderDirMode = src.renderSettingsRenderDirMode;
|
||||||
|
dest.renderSettingsShowCheckerSettings = src.renderSettingsShowCheckerSettings;
|
||||||
|
dest.renderSettingsSamplesWarning = src.renderSettingsSamplesWarning;
|
||||||
|
dest.renderSettingsPrefabWarning = src.renderSettingsPrefabWarning;
|
||||||
|
dest.renderSettingsSplitByScene = src.renderSettingsSplitByScene;
|
||||||
|
dest.renderSettingsUVPaddingMax = src.renderSettingsUVPaddingMax;
|
||||||
|
dest.renderSettingsPostPacking = src.renderSettingsPostPacking;
|
||||||
|
dest.renderSettingsHoleFilling = src.renderSettingsHoleFilling;
|
||||||
|
dest.renderSettingsBeepOnFinish = src.renderSettingsBeepOnFinish;
|
||||||
|
dest.renderSettingsExportTerrainAsHeightmap = src.renderSettingsExportTerrainAsHeightmap;
|
||||||
|
dest.renderSettingsRTXMode = src.renderSettingsRTXMode;
|
||||||
|
dest.renderSettingsLightProbeMode = src.renderSettingsLightProbeMode;
|
||||||
|
dest.renderSettingsClientMode = src.renderSettingsClientMode;
|
||||||
|
dest.renderSettingsServerAddress = src.renderSettingsServerAddress;
|
||||||
|
dest.renderSettingsUnwrapper = src.renderSettingsUnwrapper;
|
||||||
|
dest.renderSettingsDenoiserType = src.renderSettingsDenoiserType;
|
||||||
|
dest.renderSettingsExportTerrainTrees = src.renderSettingsExportTerrainTrees;
|
||||||
|
dest.renderSettingsShowPerf = src.renderSettingsShowPerf;
|
||||||
|
dest.renderSettingsSampleDiv = src.renderSettingsSampleDiv;
|
||||||
|
dest.renderSettingsBatchPoints = src.renderSettingsBatchPoints;
|
||||||
|
dest.renderSettingsRTPVExport = src.renderSettingsRTPVExport;
|
||||||
|
dest.renderSettingsRTPVSceneView = src.renderSettingsRTPVSceneView;
|
||||||
|
dest.renderSettingsRTPVWidth = src.renderSettingsRTPVWidth;
|
||||||
|
dest.renderSettingsRTPVHeight = src.renderSettingsRTPVHeight;
|
||||||
|
dest.renderSettingsAtlasPacker = src.renderSettingsAtlasPacker;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)
|
||||||
|
{
|
||||||
|
dest.renderSettingsBounces = src.renderSettingsBounces;
|
||||||
|
dest.renderSettingsGISamples = src.renderSettingsGISamples;
|
||||||
|
dest.renderSettingsGIBackFaceWeight = src.renderSettingsGIBackFaceWeight;
|
||||||
|
dest.renderSettingsTileSize = src.renderSettingsTileSize;
|
||||||
|
dest.renderSettingsPriority = src.renderSettingsPriority;
|
||||||
|
dest.renderSettingsTexelsPerUnit = src.renderSettingsTexelsPerUnit;
|
||||||
|
dest.renderSettingsForceRefresh = src.renderSettingsForceRefresh;
|
||||||
|
dest.renderSettingsForceRebuildGeometry = src.renderSettingsForceRebuildGeometry;
|
||||||
|
dest.renderSettingsPerformRendering = src.renderSettingsPerformRendering;
|
||||||
|
dest.renderSettingsUserRenderMode = src.renderSettingsUserRenderMode;
|
||||||
|
dest.renderSettingsDistanceShadowmask = src.renderSettingsDistanceShadowmask;
|
||||||
|
dest.renderSettingsSettingsMode = src.renderSettingsSettingsMode;
|
||||||
|
dest.renderSettingsFixSeams = src.renderSettingsFixSeams;
|
||||||
|
dest.renderSettingsDenoise = src.renderSettingsDenoise;
|
||||||
|
dest.renderSettingsDenoise2x = src.renderSettingsDenoise2x;
|
||||||
|
dest.renderSettingsEncode = src.renderSettingsEncode;
|
||||||
|
dest.renderSettingsEncodeMode = src.renderSettingsEncodeMode;
|
||||||
|
dest.renderSettingsOverwriteWarning = src.renderSettingsOverwriteWarning;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
dest.renderSettingsUnwrapUVs = src.renderSettingsUnwrapUVs;
|
||||||
|
dest.renderSettingsForceDisableUnwrapUVs = src.renderSettingsForceDisableUnwrapUVs;
|
||||||
|
dest.renderSettingsMaxAutoResolution = src.renderSettingsMaxAutoResolution;
|
||||||
|
dest.renderSettingsMinAutoResolution = src.renderSettingsMinAutoResolution;
|
||||||
|
dest.renderSettingsUnloadScenes = src.renderSettingsUnloadScenes;
|
||||||
|
dest.renderSettingsAdjustSamples = src.renderSettingsAdjustSamples;
|
||||||
|
dest.renderSettingsGILODMode = src.renderSettingsGILODMode;
|
||||||
|
dest.renderSettingsGILODModeEnabled = src.renderSettingsGILODModeEnabled;
|
||||||
|
dest.renderSettingsCheckOverlaps = src.renderSettingsCheckOverlaps;
|
||||||
|
dest.renderSettingsSkipOutOfBoundsUVs = src.renderSettingsSkipOutOfBoundsUVs;
|
||||||
|
dest.renderSettingsHackEmissiveBoost = src.renderSettingsHackEmissiveBoost;
|
||||||
|
dest.renderSettingsHackIndirectBoost = src.renderSettingsHackIndirectBoost;
|
||||||
|
dest.renderSettingsTempPath = src.renderSettingsTempPath;
|
||||||
|
dest.renderSettingsOutPath = src.renderSettingsOutPath;
|
||||||
|
dest.renderSettingsUseScenePath = src.renderSettingsUseScenePath;
|
||||||
|
dest.renderSettingsHackAOIntensity = src.renderSettingsHackAOIntensity;
|
||||||
|
dest.renderSettingsHackAOSamples = src.renderSettingsHackAOSamples;
|
||||||
|
dest.renderSettingsHackAORadius = src.renderSettingsHackAORadius;
|
||||||
|
dest.renderSettingsShowAOSettings = src.renderSettingsShowAOSettings;
|
||||||
|
dest.renderSettingsShowTasks = src.renderSettingsShowTasks;
|
||||||
|
dest.renderSettingsShowTasks2 = src.renderSettingsShowTasks2;
|
||||||
|
dest.renderSettingsShowPaths = src.renderSettingsShowPaths;
|
||||||
|
dest.renderSettingsShowNet = src.renderSettingsShowNet;
|
||||||
|
dest.renderSettingsOcclusionProbes = src.renderSettingsOcclusionProbes;
|
||||||
|
dest.renderSettingsTexelsPerMap = src.renderSettingsTexelsPerMap;
|
||||||
|
dest.renderSettingsTexelsColor = src.renderSettingsTexelsColor;
|
||||||
|
dest.renderSettingsTexelsMask = src.renderSettingsTexelsMask;
|
||||||
|
dest.renderSettingsTexelsDir = src.renderSettingsTexelsDir;
|
||||||
|
dest.renderSettingsShowDirWarning = src.renderSettingsShowDirWarning;
|
||||||
|
dest.renderSettingsRenderDirMode = src.renderSettingsRenderDirMode;
|
||||||
|
dest.renderSettingsShowCheckerSettings = src.renderSettingsShowCheckerSettings;
|
||||||
|
dest.renderSettingsSamplesWarning = src.renderSettingsSamplesWarning;
|
||||||
|
dest.renderSettingsPrefabWarning = src.renderSettingsPrefabWarning;
|
||||||
|
dest.renderSettingsSplitByScene = src.renderSettingsSplitByScene;
|
||||||
|
dest.renderSettingsUVPaddingMax = src.renderSettingsUVPaddingMax;
|
||||||
|
dest.renderSettingsPostPacking = src.renderSettingsPostPacking;
|
||||||
|
dest.renderSettingsHoleFilling = src.renderSettingsHoleFilling;
|
||||||
|
dest.renderSettingsBeepOnFinish = src.renderSettingsBeepOnFinish;
|
||||||
|
dest.renderSettingsExportTerrainAsHeightmap = src.renderSettingsExportTerrainAsHeightmap;
|
||||||
|
dest.renderSettingsRTXMode = src.renderSettingsRTXMode;
|
||||||
|
dest.renderSettingsLightProbeMode = src.renderSettingsLightProbeMode;
|
||||||
|
dest.renderSettingsClientMode = src.renderSettingsClientMode;
|
||||||
|
dest.renderSettingsServerAddress = src.renderSettingsServerAddress;
|
||||||
|
dest.renderSettingsUnwrapper = src.renderSettingsUnwrapper;
|
||||||
|
dest.renderSettingsDenoiserType = src.renderSettingsDenoiserType;
|
||||||
|
dest.renderSettingsExportTerrainTrees = src.renderSettingsExportTerrainTrees;
|
||||||
|
dest.renderSettingsShowPerf = src.renderSettingsShowPerf;
|
||||||
|
dest.renderSettingsSampleDiv = src.renderSettingsSampleDiv;
|
||||||
|
dest.renderSettingsBatchPoints = src.renderSettingsBatchPoints;
|
||||||
|
dest.renderSettingsRTPVExport = src.renderSettingsRTPVExport;
|
||||||
|
dest.renderSettingsRTPVSceneView = src.renderSettingsRTPVSceneView;
|
||||||
|
dest.renderSettingsRTPVWidth = src.renderSettingsRTPVWidth;
|
||||||
|
dest.renderSettingsRTPVHeight = src.renderSettingsRTPVHeight;
|
||||||
|
dest.renderSettingsAtlasPacker = src.renderSettingsAtlasPacker;
|
||||||
|
dest.renderSettingsAutoAtlas = src.renderSettingsAutoAtlas;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// List of baked lightmaps
|
||||||
|
public List<Texture2D> maps = new List<Texture2D>();
|
||||||
|
public List<Texture2D> masks = new List<Texture2D>();
|
||||||
|
public List<Texture2D> dirMaps = new List<Texture2D>();
|
||||||
|
public List<Texture2D> rnmMaps0 = new List<Texture2D>();
|
||||||
|
public List<Texture2D> rnmMaps1 = new List<Texture2D>();
|
||||||
|
public List<Texture2D> rnmMaps2 = new List<Texture2D>();
|
||||||
|
public List<int> mapsMode = new List<int>();
|
||||||
|
|
||||||
|
// new props
|
||||||
|
public List<Renderer> bakedRenderers = new List<Renderer>();
|
||||||
|
public List<int> bakedIDs = new List<int>();
|
||||||
|
public List<Vector4> bakedScaleOffset = new List<Vector4>();
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
public List<int> bakedVertexOffset = new List<int>();
|
||||||
|
#endif
|
||||||
|
public List<Mesh> bakedVertexColorMesh = new List<Mesh>();
|
||||||
|
|
||||||
|
public List<Renderer> nonBakedRenderers = new List<Renderer>();
|
||||||
|
|
||||||
|
public List<Light> bakedLights = new List<Light>();
|
||||||
|
public List<int> bakedLightChannels = new List<int>();
|
||||||
|
|
||||||
|
public List<Terrain> bakedRenderersTerrain = new List<Terrain>();
|
||||||
|
public List<int> bakedIDsTerrain = new List<int>();
|
||||||
|
public List<Vector4> bakedScaleOffsetTerrain = new List<Vector4>();
|
||||||
|
|
||||||
|
public List<string> assetList = new List<string>();
|
||||||
|
public List<int> uvOverlapAssetList = new List<int>(); // -1 = no UV1, 0 = no overlap, 1 = overlap
|
||||||
|
|
||||||
|
public int[] idremap;
|
||||||
|
|
||||||
|
public bool usesRealtimeGI;
|
||||||
|
|
||||||
|
public Texture2D emptyDirectionTex;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
ftLightmaps.RefreshScene(gameObject.scene, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
// Unity can for some reason alter lightmapIndex after the scene is loaded in a multi-scene setup, so fix that
|
||||||
|
ftLightmaps.RefreshScene2(gameObject.scene, this);//, appendOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
ftLightmaps.UnloadScene(this);
|
||||||
|
}
|
||||||
|
}
|
12
Assets/Bakery/ftLightmapsStorage.cs.meta
Normal file
12
Assets/Bakery/ftLightmapsStorage.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b7fa80e7116296f4eb4f49ec1544ee22
|
||||||
|
timeCreated: 1533932932
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
105
Assets/Bakery/ftLocalStorage.asset
Normal file
105
Assets/Bakery/ftLocalStorage.asset
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 11500000, guid: 05ca84e725c7c764aa5ed097918d14b7, type: 3}
|
||||||
|
m_Name: ftLocalStorage
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
modifiedAssetPathList:
|
||||||
|
- Assets/Bakery/examples/content/sponza/sponza.FBX
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-10.blend
|
||||||
|
- Assets/Models/Delta_Building_Model_Old.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-07.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/EM-18.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-09.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-18.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-03.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-02.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-01.1.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-04K.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Monitor.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-26.4.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-11T.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-39.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-17.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-19.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-41.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-11.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-01.2.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-16.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/PC.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-62.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-05.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-01.3.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-11.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Toilet.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-32.blend
|
||||||
|
- Assets/Models/Ceiling light CGVR.fbx
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-48.1_small.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-04.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-48.1.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-28.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-11_v2.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-08.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-47.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Monitor_alone.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/m-13.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-24.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-08.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-63.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Chair.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-16.1.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-54.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-09.1.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-38.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-25.blend
|
||||||
|
- Assets/Models/Furniture/Imported_Models/Indoor plant 3/Low-Poly Plant_.3ds
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-30.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-26.3.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-22.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Kitchen_sink left.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Kitchen_small_sink.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-04.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-51.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-12.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/EM-14.1.blend
|
||||||
|
- Assets/Models/trash_bin.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-14.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-16.2.blend
|
||||||
|
- Assets/Models/Outside/StreetLamp_Small.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-15.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-26.2.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-15.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-09.2.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-70.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-31.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-05.02.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Kitchen_sink 2.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-25.01.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-32.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Sink.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-05.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Sink_small.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Counter_table.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-23.blend
|
||||||
|
- Assets/Models/Outside/BikeStop.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/M-27.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-10.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/EM-19.2.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-06.blend
|
||||||
|
- Assets/Models/Green_stairs.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-2.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/EM-19.1.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/Admin_EM-01.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/M-20.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/Tile.blend
|
||||||
|
- Assets/Models/Furniture/Kristo_s_Models/EM-26.1.blend
|
||||||
|
- Assets/Models/Furniture/Aleksandra_s_Models/EM-14.2.blend
|
||||||
|
modifiedAssetPaddingHash: aaf8cc2efd7d936324c96996fa4dfff056f23a06323b8033bb7d936397c6d890f437ed04b74608c8b94608c8d05634b7b4c2a693f927c1150ca3ddded0c124910ca3ddde09a3dddef727c115b74608c8ecc124910ba3dddeffb209cef727c11556f23a06da7d9363b84608c8f827c115b35634b78cdb894bbb4608c8c04dfff0f327c1157e4dfff0323b8033d74608c802b309cecec124910ca3ddde97c6d890f927c115ef37ed0400b309cebb09ecc0b45634b79f398033c04dfff0f327c115b05634b78c67e2a875f23a069f3980330cf43a061067e2a81067e2a89d4dfff0344ffff023c5d890275031eeffb209ceda7d936337f95e85f83980335d398033f527c115907f9363ad5634b7194efff004c5d89075f23a06c34608c898f23a06bb09ecc0f827c1157c3980332009ecc0fea8391419c2a693194efff0e55031eed7c2a69314f33a06d2f23a064adc894bf1f23a069f398033c2c4d8908c67e2a8fd7d9363
|
9
Assets/Bakery/ftLocalStorage.asset.meta
Normal file
9
Assets/Bakery/ftLocalStorage.asset.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 06ef8f61bc3d70a4888cb079d7df1042
|
||||||
|
timeCreated: 1606240293
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
16
Assets/Bakery/ftLocalStorage.cs
Normal file
16
Assets/Bakery/ftLocalStorage.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public class ftLocalStorage : ScriptableObject
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
public List<string> modifiedAssetPathList = new List<string>(); // marks model as processed
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
public List<int> modifiedAssetPaddingHash = new List<int>();
|
||||||
|
}
|
||||||
|
|
12
Assets/Bakery/ftLocalStorage.cs.meta
Normal file
12
Assets/Bakery/ftLocalStorage.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 05ca84e725c7c764aa5ed097918d14b7
|
||||||
|
timeCreated: 1536868109
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
54
Assets/Bakery/ftMultiply.shader
Normal file
54
Assets/Bakery/ftMultiply.shader
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
Shader "Hidden/ftMultiply"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
// No culling or depth
|
||||||
|
Cull Off ZWrite Off ZTest Always
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.uv = v.uv;
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
sampler2D _MainTex;
|
||||||
|
float multiplier;
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
float4 color = tex2D(_MainTex, i.uv);
|
||||||
|
color.rgb *= multiplier;
|
||||||
|
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
9
Assets/Bakery/ftMultiply.shader.meta
Normal file
9
Assets/Bakery/ftMultiply.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ca0c6046e6cde2d4391e91bbffb3e915
|
||||||
|
timeCreated: 1534245696
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
49
Assets/Bakery/ftOverlapTest.shader
Normal file
49
Assets/Bakery/ftOverlapTest.shader
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
Shader "Hidden/ftOverlapTest"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
// No culling or depth
|
||||||
|
Cull Off ZWrite Off ZTest Always
|
||||||
|
Blend One One
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
float uvSet;
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float2 uv0 : TEXCOORD0;
|
||||||
|
float2 uv1 : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
float2 uv = uvSet > 0.0f ? v.uv1 : v.uv0;
|
||||||
|
o.vertex = float4(uv*2-1, 0.5, 1);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
return float4(1,1,1,1) * (1.0f / 255.0f);
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftOverlapTest.shader.meta
Normal file
9
Assets/Bakery/ftOverlapTest.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 20cf64477973022498e44b932e804288
|
||||||
|
timeCreated: 1528974529
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
51
Assets/Bakery/ftRGBM2Half.shader
Normal file
51
Assets/Bakery/ftRGBM2Half.shader
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
Shader "Hidden/ftRGBM2Half"
|
||||||
|
{
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
// No culling or depth
|
||||||
|
Cull Off ZWrite Off ZTest Always
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
o.uv = v.uv;
|
||||||
|
#else
|
||||||
|
o.uv = v.uv;
|
||||||
|
o.uv.y = 1-o.uv.y;
|
||||||
|
#endif
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
sampler2D _MainTex;
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
float4 c = tex2D(_MainTex, i.uv);
|
||||||
|
return float4(c.rgb * c.a * EMISSIVE_RGBM_SCALE, 1.0);
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftRGBM2Half.shader.meta
Normal file
9
Assets/Bakery/ftRGBM2Half.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b7246420d3e29ae429fc3827a1abc1e6
|
||||||
|
timeCreated: 1533755707
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
92
Assets/Bakery/ftSimpleVertexLM.shader
Normal file
92
Assets/Bakery/ftSimpleVertexLM.shader
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
Shader "Bakery/Simple Vertex Lightmapped"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
_Color ("Color", Color) = (1,1,1,1)
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" }
|
||||||
|
LOD 100
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
// make fog work
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 color : COLOR0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
UNITY_FOG_COORDS(1)
|
||||||
|
float3 color : TEXCOORD2;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
sampler2D _MainTex;
|
||||||
|
float4 _MainTex_ST;
|
||||||
|
float3 _Color;
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||||
|
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||||
|
|
||||||
|
// Decode baked HDR vertex color (RGBM)
|
||||||
|
o.color = v.color.rgb * v.color.a * 8.0;
|
||||||
|
o.color *= o.color;
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
float4 color = tex2D(_MainTex, i.uv);
|
||||||
|
color.rgb *= _Color;
|
||||||
|
|
||||||
|
// Apply vertex lightmap
|
||||||
|
color.rgb *= i.color;
|
||||||
|
|
||||||
|
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags {"LightMode"="Meta"}
|
||||||
|
Cull Off
|
||||||
|
CGPROGRAM
|
||||||
|
|
||||||
|
#include"UnityStandardMeta.cginc"
|
||||||
|
|
||||||
|
float4 frag_meta2 (v2f_meta i): SV_Target
|
||||||
|
{
|
||||||
|
UnityMetaInput o;
|
||||||
|
UNITY_INITIALIZE_OUTPUT(UnityMetaInput, o);
|
||||||
|
o.Albedo = tex2D(_MainTex, i.uv) * _Color;
|
||||||
|
return UnityMetaFragment(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftSimpleVertexLM.shader.meta
Normal file
9
Assets/Bakery/ftSimpleVertexLM.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 06b4ed554edfece43b570527a652d54e
|
||||||
|
timeCreated: 1533631323
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
78
Assets/Bakery/ftSkybox.shader
Normal file
78
Assets/Bakery/ftSkybox.shader
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||||
|
|
||||||
|
Shader "Bakery/Skybox" {
|
||||||
|
Properties {
|
||||||
|
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
|
||||||
|
_Exposure ("Exposure", Float) = 1.0
|
||||||
|
_MatrixRight ("Right", Vector) = (1, 0, 0, 0)
|
||||||
|
_MatrixUp ("Up", Vector) = (0, 1, 0, 0)
|
||||||
|
_MatrixForward ("Forward", Vector) = (0, 0, 1, 0)
|
||||||
|
[NoScaleOffset] _Tex ("Cubemap (HDR)", Cube) = "white" {}
|
||||||
|
_NoTexture ("No texture", Float) = 0.0
|
||||||
|
_Hemispherical ("Hemispherical", Float) = 0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader {
|
||||||
|
Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
|
||||||
|
Cull Off ZWrite Off
|
||||||
|
|
||||||
|
Pass {
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
samplerCUBE _Tex;
|
||||||
|
half4 _Tex_HDR;
|
||||||
|
half4 _Tint;
|
||||||
|
half _Exposure;
|
||||||
|
float3 _MatrixRight, _MatrixUp, _MatrixForward;
|
||||||
|
float4x4 reflection2World;
|
||||||
|
float _NoTexture, _Hemispherical;
|
||||||
|
|
||||||
|
struct appdata_t {
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f {
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
float3 texcoord : TEXCOORD0;
|
||||||
|
UNITY_VERTEX_OUTPUT_STEREO
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f vert (appdata_t v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
UNITY_SETUP_INSTANCE_ID(v);
|
||||||
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||||
|
float3x3 tform = float3x3(_MatrixRight, _MatrixUp, _MatrixForward);
|
||||||
|
float3 pos = mul(tform, v.vertex.xyz);
|
||||||
|
o.vertex = UnityObjectToClipPos(pos);
|
||||||
|
o.texcoord = mul((float3x3)reflection2World, v.vertex.xyz);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
half4 tex = _NoTexture < 0.5 ? texCUBE (_Tex, i.texcoord) : half4(1,1,1,1);
|
||||||
|
half3 c = DecodeHDR (tex, _Tex_HDR);
|
||||||
|
if (unity_ColorSpaceDouble.x < 3) c = pow(c, 2.2f);
|
||||||
|
c = c * _Tint.rgb;
|
||||||
|
c *= _Exposure;
|
||||||
|
|
||||||
|
if (_Hemispherical > 0.0f) c *= i.texcoord.y < 0 ? 0 : 1;
|
||||||
|
if (unity_ColorSpaceDouble.x < 3) c = pow(c, 1/2.2f);
|
||||||
|
|
||||||
|
return half4(c, 1);
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Fallback Off
|
||||||
|
|
||||||
|
}
|
9
Assets/Bakery/ftSkybox.shader.meta
Normal file
9
Assets/Bakery/ftSkybox.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8dd49cd8305cbae4f8c358c16965dbba
|
||||||
|
timeCreated: 1526849323
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
85
Assets/Bakery/ftUVNormalMap.shader
Normal file
85
Assets/Bakery/ftUVNormalMap.shader
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
Shader "Hidden/ftUVNormalMap"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_BumpMap ("Normal map", 2D) = "bump" { }
|
||||||
|
bestFitNormalMap ("Best fit normals texture", 2D) = "white" { }
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
//Name "META"
|
||||||
|
//Tags {"LightMode"="Meta"}
|
||||||
|
Cull Off
|
||||||
|
CGPROGRAM
|
||||||
|
|
||||||
|
#define _TANGENT_TO_WORLD
|
||||||
|
#define UNITY_PASS_META
|
||||||
|
#include "UnityStandardMeta.cginc"
|
||||||
|
|
||||||
|
Texture2D bestFitNormalMap;
|
||||||
|
//sampler2D _BumpMap;
|
||||||
|
float4 _BumpMap_scaleOffset;
|
||||||
|
float _IsTerrain;
|
||||||
|
|
||||||
|
struct v2f_meta2
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float3 normal : TEXCOORD1;
|
||||||
|
float3 tangent : TEXCOORD2;
|
||||||
|
float3 binormal : TEXCOORD3;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f_meta2 vert_meta2 (VertexInput v)
|
||||||
|
{
|
||||||
|
v2f_meta2 o;
|
||||||
|
o.pos = float4(((v.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw)*2-1) * float2(1,-1), 0.5, 1);
|
||||||
|
// UnityMetaVertexPosition(v.vertex, v.uv1.xy, v.uv2.xy, unity_LightmapST, unity_DynamicLightmapST);
|
||||||
|
o.uv = v.uv0 * _BumpMap_scaleOffset.xy + _BumpMap_scaleOffset.zw;
|
||||||
|
o.normal = normalize(mul((float3x3)unity_ObjectToWorld, v.normal).xyz);
|
||||||
|
|
||||||
|
if (_IsTerrain == 0.0f)
|
||||||
|
{
|
||||||
|
o.tangent = normalize(mul((float3x3)unity_ObjectToWorld, v.tangent.xyz).xyz);
|
||||||
|
o.binormal = cross(o.normal, o.tangent) * v.tangent.w;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
o.tangent = cross(o.normal, float3(0,0,1));
|
||||||
|
o.binormal = cross(o.normal, o.tangent) * -1;
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
float3 EncodeNormalBestFit(float3 n)
|
||||||
|
{
|
||||||
|
float3 nU = abs(n);
|
||||||
|
float maxNAbs = max(nU.z, max(nU.x, nU.y));
|
||||||
|
float2 TC = nU.z<maxNAbs? (nU.y<maxNAbs? nU.yz : nU.xz) : nU.xy;
|
||||||
|
//if (TC.x != TC.y)
|
||||||
|
//{
|
||||||
|
TC = TC.x<TC.y? TC.yx : TC.xy;
|
||||||
|
TC.y /= TC.x;
|
||||||
|
|
||||||
|
n /= maxNAbs;
|
||||||
|
float fittingScale = bestFitNormalMap.Load(int3(TC.x*1023, TC.y*1023, 0)).a;
|
||||||
|
n *= fittingScale;
|
||||||
|
//}
|
||||||
|
return n*0.5+0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 frag_meta2 (v2f_meta2 i): SV_Target
|
||||||
|
{
|
||||||
|
float3 normalMap = UnpackNormal(tex2D(_BumpMap, i.uv));
|
||||||
|
float3 normal = normalize(i.tangent * normalMap.x + i.binormal * normalMap.y + i.normal * normalMap.z);
|
||||||
|
return float4(EncodeNormalBestFit(normal),1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vertex vert_meta2
|
||||||
|
#pragma fragment frag_meta2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
Assets/Bakery/ftUVNormalMap.shader.meta
Normal file
9
Assets/Bakery/ftUVNormalMap.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 98e1b190bbdc3a740a9d358c3d446747
|
||||||
|
timeCreated: 1537271568
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
46
Assets/Bakery/ftUniqueIDRegistry.cs
Normal file
46
Assets/Bakery/ftUniqueIDRegistry.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public static class ftUniqueIDRegistry
|
||||||
|
{
|
||||||
|
public static Dictionary<Int32, Int32> Mapping = new Dictionary<int, int>();
|
||||||
|
public static Dictionary<Int32, Int32> MappingInv = new Dictionary<int, int>();
|
||||||
|
|
||||||
|
public static void Deregister(Int32 id)
|
||||||
|
{
|
||||||
|
int instanceId = GetInstanceId(id);
|
||||||
|
if (instanceId < 0) return;
|
||||||
|
MappingInv.Remove(instanceId);
|
||||||
|
Mapping.Remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Register(Int32 id, Int32 value)
|
||||||
|
{
|
||||||
|
if (!Mapping.ContainsKey(id)) {
|
||||||
|
Mapping[id] = value;
|
||||||
|
MappingInv[value] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Int32 GetInstanceId(Int32 id)
|
||||||
|
{
|
||||||
|
Int32 instanceId;
|
||||||
|
if (!Mapping.TryGetValue(id, out instanceId))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return instanceId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Int32 GetUID(Int32 instanceId)
|
||||||
|
{
|
||||||
|
Int32 result;
|
||||||
|
if (MappingInv.TryGetValue(instanceId, out result)) return result;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
12
Assets/Bakery/ftUniqueIDRegistry.cs.meta
Normal file
12
Assets/Bakery/ftUniqueIDRegistry.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 823b71f76e7ce5a48a9db822489f7b5d
|
||||||
|
timeCreated: 1496221374
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Bakery/ftUnitySpotTexture.bmp
(Stored with Git LFS)
Normal file
BIN
Assets/Bakery/ftUnitySpotTexture.bmp
(Stored with Git LFS)
Normal file
Binary file not shown.
76
Assets/Bakery/ftUnitySpotTexture.bmp.meta
Normal file
76
Assets/Bakery/ftUnitySpotTexture.bmp.meta
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3a66602b8cc7fdd4ab57d07b4176432b
|
||||||
|
timeCreated: 1527598735
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 0
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
80
Assets/Bakery/ftUnlitTerrain.shader
Normal file
80
Assets/Bakery/ftUnlitTerrain.shader
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
Shader "Hidden/ftUnlitTerrain"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Albedo", 2D) = "white" { }
|
||||||
|
_TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {}
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags {"LightMode"="Meta"}
|
||||||
|
Cull Off
|
||||||
|
CGPROGRAM
|
||||||
|
|
||||||
|
#include"UnityStandardMeta.cginc"
|
||||||
|
|
||||||
|
float4 frag_meta2 (v2f_meta i): SV_Target
|
||||||
|
{
|
||||||
|
UnityMetaInput o;
|
||||||
|
UNITY_INITIALIZE_OUTPUT(UnityMetaInput, o);
|
||||||
|
o.Albedo = tex2D(_MainTex, i.uv);
|
||||||
|
return UnityMetaFragment(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Tags {"Queue" = "Overlay+1" "RenderType"="TransparentCutout"}
|
||||||
|
ZTest Always
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vs
|
||||||
|
#pragma fragment ps
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
#pragma multi_compile __ _ALPHATEST_ON
|
||||||
|
|
||||||
|
sampler2D _MainTex;
|
||||||
|
|
||||||
|
#ifdef _ALPHATEST_ON
|
||||||
|
sampler2D _TerrainHolesTexture;
|
||||||
|
|
||||||
|
void ClipHoles(float2 uv)
|
||||||
|
{
|
||||||
|
float hole = tex2D(_TerrainHolesTexture, uv).r;
|
||||||
|
clip(hole == 0.0f ? -1 : 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct pi
|
||||||
|
{
|
||||||
|
float4 Position : SV_POSITION;
|
||||||
|
float2 TexCoords : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
void vs(in appdata_full IN, out pi OUT)
|
||||||
|
{
|
||||||
|
OUT.Position = UnityObjectToClipPos(IN.vertex);
|
||||||
|
OUT.TexCoords = IN.texcoord.xy;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 ps( in pi IN ) : COLOR
|
||||||
|
{
|
||||||
|
#ifdef _ALPHATEST_ON
|
||||||
|
ClipHoles(IN.TexCoords);
|
||||||
|
#endif
|
||||||
|
float4 tex = tex2D(_MainTex, IN.TexCoords);
|
||||||
|
return tex;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Dependency "BaseMapShader" = "Hidden/ftUnlitTerrain"
|
||||||
|
Dependency "BaseMapGenShader" = "Hidden/TerrainEngine/Splatmap/Diffuse-BaseGen"
|
||||||
|
}
|
9
Assets/Bakery/ftUnlitTerrain.shader.meta
Normal file
9
Assets/Bakery/ftUnlitTerrain.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 20ea139dff8ced947aedd767ed4d773a
|
||||||
|
timeCreated: 1529086730
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Bakery/shader.meta
Normal file
9
Assets/Bakery/shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 032033b8252780e489288ad3dae65aa5
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
1145
Assets/Bakery/shader/Bakery.cginc
Normal file
1145
Assets/Bakery/shader/Bakery.cginc
Normal file
File diff suppressed because it is too large
Load Diff
9
Assets/Bakery/shader/Bakery.cginc.meta
Normal file
9
Assets/Bakery/shader/Bakery.cginc.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f45fcc349188584095300fd024e8f8b
|
||||||
|
timeCreated: 1538411299
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
412
Assets/Bakery/shader/BakeryStandard.shader
Normal file
412
Assets/Bakery/shader/BakeryStandard.shader
Normal file
@ -0,0 +1,412 @@
|
|||||||
|
Shader "Bakery/Standard"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_Color("Color", Color) = (1,1,1,1)
|
||||||
|
_MainTex("Albedo", 2D) = "white" {}
|
||||||
|
|
||||||
|
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
|
||||||
|
|
||||||
|
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
|
||||||
|
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
|
||||||
|
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0
|
||||||
|
|
||||||
|
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
|
||||||
|
_MetallicGlossMap("Metallic", 2D) = "white" {}
|
||||||
|
|
||||||
|
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
||||||
|
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
|
||||||
|
|
||||||
|
_BumpScale("Scale", Float) = 1.0
|
||||||
|
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||||
|
|
||||||
|
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
|
||||||
|
_ParallaxMap ("Height Map", 2D) = "black" {}
|
||||||
|
|
||||||
|
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
|
||||||
|
_OcclusionMap("Occlusion", 2D) = "white" {}
|
||||||
|
|
||||||
|
_EmissionColor("Color", Color) = (0,0,0)
|
||||||
|
_EmissionMap("Emission", 2D) = "white" {}
|
||||||
|
|
||||||
|
_DetailMask("Detail Mask", 2D) = "white" {}
|
||||||
|
|
||||||
|
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
|
||||||
|
_DetailNormalMapScale("Scale", Float) = 1.0
|
||||||
|
_DetailNormalMap("Normal Map", 2D) = "bump" {}
|
||||||
|
|
||||||
|
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
|
||||||
|
|
||||||
|
// Blending state
|
||||||
|
[HideInInspector] _Mode ("__mode", Float) = 0.0
|
||||||
|
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
|
||||||
|
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
|
||||||
|
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
|
||||||
|
|
||||||
|
_Volume0("Volume0", 3D) = "black" {}
|
||||||
|
_Volume1("Volume1", 3D) = "black" {}
|
||||||
|
_Volume2("Volume2", 3D) = "black" {}
|
||||||
|
_VolumeMask("Volume Mask", 3D) = "white" {}
|
||||||
|
_VolumeMin("Volume min", Vector) = (0,0,0)
|
||||||
|
_VolumeInvSize("Volume Inv Size", Vector) = (1000001, 1000001, 1000001)
|
||||||
|
|
||||||
|
[HideInInspector] _BAKERY_2SIDED ("__2s", Float) = 2.0
|
||||||
|
[Toggle(BAKERY_2SIDEDON)] _BAKERY_2SIDEDON ("Double-sided", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLM)] _BAKERY_VERTEXLM ("Enable vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMDIR)] _BAKERY_VERTEXLMDIR ("Enable directional vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMSH)] _BAKERY_VERTEXLMSH ("Enable SH vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMMASK)] _BAKERY_VERTEXLMMASK ("Enable shadowmask vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_SH)] _BAKERY_SH ("Enable SH", Float) = 0
|
||||||
|
[Toggle(BAKERY_SHNONLINEAR)] _BAKERY_SHNONLINEAR ("SH non-linear mode", Float) = 1
|
||||||
|
[Toggle(BAKERY_RNM)] _BAKERY_RNM ("Enable RNM", Float) = 0
|
||||||
|
[Toggle(BAKERY_LMSPEC)] _BAKERY_LMSPEC ("Enable Lightmap Specular", Float) = 0
|
||||||
|
[Toggle(BAKERY_BICUBIC)] _BAKERY_BICUBIC ("Enable Bicubic Filter", Float) = 0
|
||||||
|
[Toggle(BAKERY_PROBESHNONLINEAR)] _BAKERY_PROBESHNONLINEAR ("Use non-linear SH for light probes", Float) = 0
|
||||||
|
[Toggle(BAKERY_VOLUME)] _BAKERY_VOLUME ("Use volumes", Float) = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
CGINCLUDE
|
||||||
|
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
|
||||||
|
ENDCG
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||||
|
LOD 300
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD"
|
||||||
|
Tags { "LightMode" = "ForwardBase" }
|
||||||
|
|
||||||
|
Blend [_SrcBlend] [_DstBlend]
|
||||||
|
ZWrite [_ZWrite]
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
#pragma shader_feature UNITY_SPECCUBE_BOX_PROJECTION
|
||||||
|
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
#pragma shader_feature BAKERY_SH
|
||||||
|
#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_RNM
|
||||||
|
#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
#pragma shader_feature BAKERY_PROBESHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_VOLUME
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdbase
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
#pragma multi_compile_instancing
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardBase
|
||||||
|
#pragma fragment bakeryFragForwardBase
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Additive forward pass (one light per pass)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD_DELTA"
|
||||||
|
Tags { "LightMode" = "ForwardAdd" }
|
||||||
|
Blend [_SrcBlend] One
|
||||||
|
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||||
|
ZWrite Off
|
||||||
|
ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdadd_fullshadows
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardAdd
|
||||||
|
#pragma fragment bakeryFragForwardAdd
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Shadow rendering pass
|
||||||
|
Pass {
|
||||||
|
Name "ShadowCaster"
|
||||||
|
Tags { "LightMode" = "ShadowCaster" }
|
||||||
|
|
||||||
|
ZWrite On ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
#pragma multi_compile_shadowcaster
|
||||||
|
#pragma multi_compile_instancing
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex vertShadowCaster
|
||||||
|
#pragma fragment fragShadowCaster
|
||||||
|
|
||||||
|
#include "UnityStandardShadow.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Deferred pass
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "DEFERRED"
|
||||||
|
Tags { "LightMode" = "Deferred" }
|
||||||
|
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
#pragma exclude_renderers nomrt
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
#pragma shader_feature BAKERY_SH
|
||||||
|
#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_RNM
|
||||||
|
#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
#pragma shader_feature BAKERY_PROBESHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_VOLUME
|
||||||
|
|
||||||
|
#pragma multi_compile_prepassfinal
|
||||||
|
#pragma multi_compile_instancing
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertDeferred
|
||||||
|
#pragma fragment bakeryFragDeferred
|
||||||
|
|
||||||
|
#include "UnityStandardCore.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||||
|
// This pass it not used during regular rendering.
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags { "LightMode"="Meta" }
|
||||||
|
|
||||||
|
Cull Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta
|
||||||
|
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature EDITOR_VISUALIZATION
|
||||||
|
|
||||||
|
#include "UnityStandardMeta.cginc"
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||||
|
LOD 150
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD"
|
||||||
|
Tags { "LightMode" = "ForwardBase" }
|
||||||
|
|
||||||
|
Blend [_SrcBlend] [_DstBlend]
|
||||||
|
ZWrite [_ZWrite]
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||||
|
|
||||||
|
//#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
//#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
//#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
//#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
//#pragma shader_feature BAKERY_SH
|
||||||
|
//#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
//#pragma shader_feature BAKERY_RNM
|
||||||
|
//#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
//#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
|
||||||
|
// SM2.0: NOT SUPPORTED shader_feature ___ _DETAIL_MULX2
|
||||||
|
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdbase
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardBase
|
||||||
|
#pragma fragment bakeryFragForwardBase
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Additive forward pass (one light per pass)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD_DELTA"
|
||||||
|
Tags { "LightMode" = "ForwardAdd" }
|
||||||
|
Blend [_SrcBlend] One
|
||||||
|
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||||
|
ZWrite Off
|
||||||
|
ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||||
|
#pragma skip_variants SHADOWS_SOFT
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdadd_fullshadows
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardAdd
|
||||||
|
#pragma fragment bakeryFragForwardAdd
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Shadow rendering pass
|
||||||
|
Pass {
|
||||||
|
Name "ShadowCaster"
|
||||||
|
Tags { "LightMode" = "ShadowCaster" }
|
||||||
|
|
||||||
|
ZWrite On ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma skip_variants SHADOWS_SOFT
|
||||||
|
#pragma multi_compile_shadowcaster
|
||||||
|
|
||||||
|
#pragma vertex vertShadowCaster
|
||||||
|
#pragma fragment fragShadowCaster
|
||||||
|
|
||||||
|
#include "UnityStandardShadow.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||||
|
// This pass it not used during regular rendering.
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags { "LightMode"="Meta" }
|
||||||
|
|
||||||
|
Cull Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta
|
||||||
|
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _METALLICGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature EDITOR_VISUALIZATION
|
||||||
|
|
||||||
|
#include "UnityStandardMeta.cginc"
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FallBack "VertexLit"
|
||||||
|
CustomEditor "BakeryShaderGUI"
|
||||||
|
}
|
9
Assets/Bakery/shader/BakeryStandard.shader.meta
Normal file
9
Assets/Bakery/shader/BakeryStandard.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3334d0a534d2dac45b2c1a9a7e0a6c64
|
||||||
|
timeCreated: 1538411300
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
395
Assets/Bakery/shader/BakeryStandardSpecular.shader
Normal file
395
Assets/Bakery/shader/BakeryStandardSpecular.shader
Normal file
@ -0,0 +1,395 @@
|
|||||||
|
Shader "Bakery/Standard Specular"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_Color("Color", Color) = (1,1,1,1)
|
||||||
|
_MainTex("Albedo", 2D) = "white" {}
|
||||||
|
|
||||||
|
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
|
||||||
|
|
||||||
|
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
|
||||||
|
_GlossMapScale("Smoothness Factor", Range(0.0, 1.0)) = 1.0
|
||||||
|
[Enum(Specular Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
|
||||||
|
|
||||||
|
_SpecColor("Specular", Color) = (0.2,0.2,0.2)
|
||||||
|
_SpecGlossMap("Specular", 2D) = "white" {}
|
||||||
|
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
||||||
|
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
|
||||||
|
|
||||||
|
_BumpScale("Scale", Float) = 1.0
|
||||||
|
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||||
|
|
||||||
|
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
|
||||||
|
_ParallaxMap ("Height Map", 2D) = "black" {}
|
||||||
|
|
||||||
|
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
|
||||||
|
_OcclusionMap("Occlusion", 2D) = "white" {}
|
||||||
|
|
||||||
|
_EmissionColor("Color", Color) = (0,0,0)
|
||||||
|
_EmissionMap("Emission", 2D) = "white" {}
|
||||||
|
|
||||||
|
_DetailMask("Detail Mask", 2D) = "white" {}
|
||||||
|
|
||||||
|
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
|
||||||
|
_DetailNormalMapScale("Scale", Float) = 1.0
|
||||||
|
_DetailNormalMap("Normal Map", 2D) = "bump" {}
|
||||||
|
|
||||||
|
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
|
||||||
|
|
||||||
|
|
||||||
|
// Blending state
|
||||||
|
[HideInInspector] _Mode ("__mode", Float) = 0.0
|
||||||
|
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
|
||||||
|
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
|
||||||
|
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
|
||||||
|
|
||||||
|
[HideInInspector] _BAKERY_2SIDED ("__2s", Float) = 2.0
|
||||||
|
[Toggle(BAKERY_2SIDEDON)] _BAKERY_2SIDEDON ("Double-sided", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLM)] _BAKERY_VERTEXLM ("Enable vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMDIR)] _BAKERY_VERTEXLMDIR ("Enable directional vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMSH)] _BAKERY_VERTEXLMSH ("Enable SH vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_VERTEXLMMASK)] _BAKERY_VERTEXLMMASK ("Enable shadowmask vertex LM", Float) = 0
|
||||||
|
[Toggle(BAKERY_SH)] _BAKERY_SH ("Enable SH", Float) = 0
|
||||||
|
[Toggle(BAKERY_SHNONLINEAR)] _BAKERY_SHNONLINEAR ("SH non-linear mode", Float) = 1
|
||||||
|
[Toggle(BAKERY_RNM)] _BAKERY_RNM ("Enable RNM", Float) = 0
|
||||||
|
[Toggle(BAKERY_LMSPEC)] _BAKERY_LMSPEC ("Enable Lightmap Specular", Float) = 0
|
||||||
|
[Toggle(BAKERY_BICUBIC)] _BAKERY_BICUBIC ("Enable Bicubic Filter", Float) = 0
|
||||||
|
[Toggle(BAKERY_PROBESHNONLINEAR)] _BAKERY_PROBESHNONLINEAR ("Use non-linear SH for light probes", Float) = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
CGINCLUDE
|
||||||
|
#define UNITY_SETUP_BRDF_INPUT SpecularSetup
|
||||||
|
ENDCG
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||||
|
LOD 300
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD"
|
||||||
|
Tags { "LightMode" = "ForwardBase" }
|
||||||
|
|
||||||
|
Blend [_SrcBlend] [_DstBlend]
|
||||||
|
ZWrite [_ZWrite]
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
#pragma shader_feature BAKERY_SH
|
||||||
|
#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_RNM
|
||||||
|
#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
#pragma shader_feature BAKERY_PROBESHNONLINEAR
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdbase
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
#pragma multi_compile_instancing
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardBase
|
||||||
|
#pragma fragment bakeryFragForwardBase
|
||||||
|
|
||||||
|
#include "UnityStandardCore.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Additive forward pass (one light per pass)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD_DELTA"
|
||||||
|
Tags { "LightMode" = "ForwardAdd" }
|
||||||
|
Blend [_SrcBlend] One
|
||||||
|
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||||
|
ZWrite Off
|
||||||
|
ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdadd_fullshadows
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardAdd
|
||||||
|
#pragma fragment bakeryFragForwardAdd
|
||||||
|
|
||||||
|
#include "UnityStandardCore.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Shadow rendering pass
|
||||||
|
Pass {
|
||||||
|
Name "ShadowCaster"
|
||||||
|
Tags { "LightMode" = "ShadowCaster" }
|
||||||
|
|
||||||
|
ZWrite On ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma multi_compile_shadowcaster
|
||||||
|
|
||||||
|
#pragma vertex vertShadowCaster
|
||||||
|
#pragma fragment fragShadowCaster
|
||||||
|
|
||||||
|
#include "UnityStandardShadow.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Deferred pass
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "DEFERRED"
|
||||||
|
Tags { "LightMode" = "Deferred" }
|
||||||
|
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 3.0
|
||||||
|
#pragma exclude_renderers nomrt
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
#pragma shader_feature BAKERY_SH
|
||||||
|
#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_RNM
|
||||||
|
#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
#pragma shader_feature BAKERY_PROBESHNONLINEAR
|
||||||
|
|
||||||
|
#pragma multi_compile_prepassfinal
|
||||||
|
#pragma multi_compile_instancing
|
||||||
|
// Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
|
||||||
|
//#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertDeferred
|
||||||
|
#pragma fragment bakeryFragDeferred
|
||||||
|
|
||||||
|
#include "UnityStandardCore.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||||
|
// This pass it not used during regular rendering.
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags { "LightMode"="Meta" }
|
||||||
|
|
||||||
|
Cull Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta
|
||||||
|
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
|
||||||
|
#include "UnityStandardMeta.cginc"
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||||
|
LOD 150
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD"
|
||||||
|
Tags { "LightMode" = "ForwardBase" }
|
||||||
|
|
||||||
|
Blend [_SrcBlend] [_DstBlend]
|
||||||
|
ZWrite [_ZWrite]
|
||||||
|
Cull [_BAKERY_2SIDED]
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
|
||||||
|
/*
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLM
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMDIR
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMSH
|
||||||
|
#pragma shader_feature BAKERY_VERTEXLMMASK
|
||||||
|
#pragma shader_feature BAKERY_SH
|
||||||
|
#pragma shader_feature BAKERY_SHNONLINEAR
|
||||||
|
#pragma shader_feature BAKERY_RNM
|
||||||
|
#pragma shader_feature BAKERY_LMSPEC
|
||||||
|
#pragma shader_feature BAKERY_BICUBIC
|
||||||
|
*/
|
||||||
|
|
||||||
|
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||||
|
|
||||||
|
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdbase
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardBase
|
||||||
|
#pragma fragment bakeryFragForwardBase
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Additive forward pass (one light per pass)
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "FORWARD_DELTA"
|
||||||
|
Tags { "LightMode" = "ForwardAdd" }
|
||||||
|
Blend [_SrcBlend] One
|
||||||
|
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||||
|
ZWrite Off
|
||||||
|
ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _NORMALMAP
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||||
|
#pragma skip_variants SHADOWS_SOFT
|
||||||
|
|
||||||
|
#pragma multi_compile_fwdadd_fullshadows
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#pragma vertex bakeryVertForwardAdd
|
||||||
|
#pragma fragment bakeryFragForwardAdd
|
||||||
|
|
||||||
|
#include "UnityStandardCoreForward.cginc"
|
||||||
|
#include "Bakery.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Shadow rendering pass
|
||||||
|
Pass {
|
||||||
|
Name "ShadowCaster"
|
||||||
|
Tags { "LightMode" = "ShadowCaster" }
|
||||||
|
|
||||||
|
ZWrite On ZTest LEqual
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma target 2.0
|
||||||
|
|
||||||
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||||
|
#pragma skip_variants SHADOWS_SOFT
|
||||||
|
#pragma multi_compile_shadowcaster
|
||||||
|
|
||||||
|
#pragma vertex vertShadowCaster
|
||||||
|
#pragma fragment fragShadowCaster
|
||||||
|
|
||||||
|
#include "UnityStandardShadow.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||||
|
// This pass it not used during regular rendering.
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "META"
|
||||||
|
Tags { "LightMode"="Meta" }
|
||||||
|
|
||||||
|
Cull Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_meta
|
||||||
|
#pragma fragment frag_meta
|
||||||
|
|
||||||
|
#pragma shader_feature _EMISSION
|
||||||
|
#pragma shader_feature _SPECGLOSSMAP
|
||||||
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||||
|
#pragma shader_feature ___ _DETAIL_MULX2
|
||||||
|
#pragma shader_feature EDITOR_VISUALIZATION
|
||||||
|
|
||||||
|
#include "UnityStandardMeta.cginc"
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FallBack "VertexLit"
|
||||||
|
CustomEditor "BakeryShaderGUI"
|
||||||
|
}
|
9
Assets/Bakery/shader/BakeryStandardSpecular.shader.meta
Normal file
9
Assets/Bakery/shader/BakeryStandardSpecular.shader.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2ad53c3d60baf17489980f3b010d040e
|
||||||
|
timeCreated: 1538413381
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b1b95168f2f925246bf670cb2bc2bf79
|
||||||
|
timeCreated: 1573412449
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ec3754b09ac1517429546e96e7b25708
|
||||||
|
timeCreated: 1606124300
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Bakery/shader/Editor.meta
Normal file
9
Assets/Bakery/shader/Editor.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d995d6425d6713e4e8ad1844c0f6f216
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
580
Assets/Bakery/shader/Editor/BakeryShaderGUI.cs
Normal file
580
Assets/Bakery/shader/Editor/BakeryShaderGUI.cs
Normal file
@ -0,0 +1,580 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
|
||||||
|
// Disable 'obsolete' warnings
|
||||||
|
#pragma warning disable 0618
|
||||||
|
#pragma warning disable 0612
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace UnityEditor
|
||||||
|
{
|
||||||
|
public class BakeryShaderGUI : ShaderGUI
|
||||||
|
{
|
||||||
|
private enum WorkflowMode
|
||||||
|
{
|
||||||
|
Specular,
|
||||||
|
Metallic,
|
||||||
|
Dielectric
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BlendMode
|
||||||
|
{
|
||||||
|
Opaque,
|
||||||
|
Cutout,
|
||||||
|
Fade, // Old school alpha-blending mode, fresnel does not affect amount of transparency
|
||||||
|
Transparent // Physically plausible transparency mode, implemented as alpha pre-multiply
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SmoothnessMapChannel
|
||||||
|
{
|
||||||
|
SpecularMetallicAlpha,
|
||||||
|
AlbedoAlpha,
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Styles
|
||||||
|
{
|
||||||
|
public static GUIStyle optionsButton = "PaneOptions";
|
||||||
|
public static GUIContent uvSetLabel = new GUIContent("UV Set");
|
||||||
|
public static GUIContent[] uvSetOptions = new GUIContent[] { new GUIContent("UV channel 0"), new GUIContent("UV channel 1") };
|
||||||
|
|
||||||
|
public static string emptyTootip = "";
|
||||||
|
public static GUIContent albedoText = new GUIContent("Albedo", "Albedo (RGB) and Transparency (A)");
|
||||||
|
public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff");
|
||||||
|
public static GUIContent specularMapText = new GUIContent("Specular", "Specular (RGB) and Smoothness (A)");
|
||||||
|
public static GUIContent metallicMapText = new GUIContent("Metallic", "Metallic (R) and Smoothness (A)");
|
||||||
|
public static GUIContent smoothnessText = new GUIContent("Smoothness", "Smoothness value");
|
||||||
|
public static GUIContent smoothnessScaleText = new GUIContent("Smoothness", "Smoothness scale factor");
|
||||||
|
public static GUIContent smoothnessMapChannelText = new GUIContent("Source", "Smoothness texture and channel");
|
||||||
|
public static GUIContent highlightsText = new GUIContent("Specular Highlights", "Specular Highlights");
|
||||||
|
public static GUIContent reflectionsText = new GUIContent("Reflections", "Glossy Reflections");
|
||||||
|
public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map");
|
||||||
|
public static GUIContent heightMapText = new GUIContent("Height Map", "Height Map (G)");
|
||||||
|
public static GUIContent occlusionText = new GUIContent("Occlusion", "Occlusion (G)");
|
||||||
|
public static GUIContent emissionText = new GUIContent("Emission", "Emission (RGB)");
|
||||||
|
public static GUIContent detailMaskText = new GUIContent("Detail Mask", "Mask for Secondary Maps (A)");
|
||||||
|
public static GUIContent detailAlbedoText = new GUIContent("Detail Albedo x2", "Albedo (RGB) multiplied by 2");
|
||||||
|
public static GUIContent detailNormalMapText = new GUIContent("Normal Map", "Normal Map");
|
||||||
|
|
||||||
|
public static string whiteSpaceString = " ";
|
||||||
|
public static string primaryMapsText = "Main Maps";
|
||||||
|
public static string secondaryMapsText = "Secondary Maps";
|
||||||
|
public static string forwardText = "Forward Rendering Options";
|
||||||
|
public static string renderingMode = "Rendering Mode";
|
||||||
|
public static GUIContent emissiveWarning = new GUIContent("Emissive value is animated but the material has not been configured to support emissive. Please make sure the material itself has some amount of emissive.");
|
||||||
|
public static GUIContent emissiveColorWarning = new GUIContent("Ensure emissive color is non-black for emission to have effect.");
|
||||||
|
public static readonly string[] blendNames = Enum.GetNames(typeof(BlendMode));
|
||||||
|
|
||||||
|
public static string bakeryText = "Bakery Options";
|
||||||
|
public static GUIContent doubleSidedLabel = new GUIContent("Double-sided", "Render both sides of triangles.");
|
||||||
|
public static GUIContent vertexLMLabel = new GUIContent("Allow Vertex Lightmaps", "Allows this material to use vertex lightmaps, if present.");
|
||||||
|
public static GUIContent vertexLMdirLabel = new GUIContent("Enable VertexLM directional", "Enables directional vertex lightmaps.");
|
||||||
|
public static GUIContent vertexLMSHLabel = new GUIContent("Enable VertexLM SH", "Enables SH vertex lightmaps.");
|
||||||
|
public static GUIContent vertexLMMaskLabel = new GUIContent("Enable VertexLM Shadowmask", "Enables per-vertex shadowmasks.");
|
||||||
|
public static GUIContent rnmLabel = new GUIContent("Allow RNM Lightmaps", "Allows this material to use RNM lightmaps, if present.");
|
||||||
|
public static GUIContent shLabel = new GUIContent("Allow SH Lightmaps", "Allows this material to use SH lightmaps, if present.");
|
||||||
|
public static GUIContent shnLabel = new GUIContent("Non-linear SH", "This option can enhance contrast (closer to ground truth), but it makes the shader a bit slower.");
|
||||||
|
public static GUIContent specLabel = new GUIContent("Enable Lightmap Specular", "Enables baked specular for all directional modes.");
|
||||||
|
public static GUIContent bicubicLabel = new GUIContent("Force Bicubic Filter", "Enables bicubic filtering for all lightmaps (color/shadowmask/direction/etc) used in the material.");
|
||||||
|
public static GUIContent pshnLabel = new GUIContent("Non-linear Light Probe SH", "Prevents negative values in light probes. This is recommended when baking probes in L1 mode. Can slow down the shader a bit.");
|
||||||
|
public static GUIContent volLabel = new GUIContent("Enable Volumes", "Enable usages of BakeryVolumes");
|
||||||
|
public static GUIContent volLabel0 = new GUIContent("Volume 0");
|
||||||
|
public static GUIContent volLabel1 = new GUIContent("Volume 1");
|
||||||
|
public static GUIContent volLabel2 = new GUIContent("Volume 2");
|
||||||
|
public static GUIContent volLabelMask = new GUIContent("Volume mask");
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialProperty blendMode = null;
|
||||||
|
MaterialProperty albedoMap = null;
|
||||||
|
MaterialProperty albedoColor = null;
|
||||||
|
MaterialProperty alphaCutoff = null;
|
||||||
|
MaterialProperty specularMap = null;
|
||||||
|
MaterialProperty specularColor = null;
|
||||||
|
MaterialProperty metallicMap = null;
|
||||||
|
MaterialProperty metallic = null;
|
||||||
|
MaterialProperty smoothness = null;
|
||||||
|
MaterialProperty smoothnessScale = null;
|
||||||
|
MaterialProperty smoothnessMapChannel = null;
|
||||||
|
MaterialProperty highlights = null;
|
||||||
|
MaterialProperty reflections = null;
|
||||||
|
MaterialProperty bumpScale = null;
|
||||||
|
MaterialProperty bumpMap = null;
|
||||||
|
MaterialProperty occlusionStrength = null;
|
||||||
|
MaterialProperty occlusionMap = null;
|
||||||
|
MaterialProperty heigtMapScale = null;
|
||||||
|
MaterialProperty heightMap = null;
|
||||||
|
MaterialProperty emissionColorForRendering = null;
|
||||||
|
MaterialProperty emissionMap = null;
|
||||||
|
MaterialProperty detailMask = null;
|
||||||
|
MaterialProperty detailAlbedoMap = null;
|
||||||
|
MaterialProperty detailNormalMapScale = null;
|
||||||
|
MaterialProperty detailNormalMap = null;
|
||||||
|
MaterialProperty uvSetSecondary = null;
|
||||||
|
MaterialProperty enableDoubleSided = null;
|
||||||
|
MaterialProperty enableDoubleSidedOn = null;
|
||||||
|
MaterialProperty enableVertexLM = null;
|
||||||
|
MaterialProperty enableVertexLMdir = null;
|
||||||
|
MaterialProperty enableVertexLMSH = null;
|
||||||
|
MaterialProperty enableVertexLMmask = null;
|
||||||
|
MaterialProperty enableSH = null;
|
||||||
|
MaterialProperty enableSHN = null;
|
||||||
|
MaterialProperty enableRNM = null;
|
||||||
|
MaterialProperty enableSpec = null;
|
||||||
|
MaterialProperty enableBicubic = null;
|
||||||
|
MaterialProperty enablePSHN = null;
|
||||||
|
MaterialProperty enableVolumes = null;
|
||||||
|
MaterialProperty volume0 = null;
|
||||||
|
MaterialProperty volume1 = null;
|
||||||
|
MaterialProperty volume2 = null;
|
||||||
|
MaterialProperty volumeMask = null;
|
||||||
|
MaterialProperty volumeMin = null;
|
||||||
|
MaterialProperty volumeInvSize = null;
|
||||||
|
|
||||||
|
BakeryVolume assignedVolume = null;
|
||||||
|
|
||||||
|
MaterialEditor m_MaterialEditor;
|
||||||
|
WorkflowMode m_WorkflowMode = WorkflowMode.Specular;
|
||||||
|
ColorPickerHDRConfig m_ColorPickerHDRConfig = new ColorPickerHDRConfig(0f, 99f, 1 / 99f, 3f);
|
||||||
|
|
||||||
|
bool m_FirstTimeApply = true;
|
||||||
|
|
||||||
|
public void FindProperties(MaterialProperty[] props)
|
||||||
|
{
|
||||||
|
blendMode = FindProperty("_Mode", props);
|
||||||
|
albedoMap = FindProperty("_MainTex", props);
|
||||||
|
albedoColor = FindProperty("_Color", props);
|
||||||
|
alphaCutoff = FindProperty("_Cutoff", props);
|
||||||
|
specularMap = FindProperty("_SpecGlossMap", props, false);
|
||||||
|
specularColor = FindProperty("_SpecColor", props, false);
|
||||||
|
metallicMap = FindProperty("_MetallicGlossMap", props, false);
|
||||||
|
metallic = FindProperty("_Metallic", props, false);
|
||||||
|
if (specularMap != null && specularColor != null)
|
||||||
|
m_WorkflowMode = WorkflowMode.Specular;
|
||||||
|
else if (metallicMap != null && metallic != null)
|
||||||
|
m_WorkflowMode = WorkflowMode.Metallic;
|
||||||
|
else
|
||||||
|
m_WorkflowMode = WorkflowMode.Dielectric;
|
||||||
|
smoothness = FindProperty("_Glossiness", props);
|
||||||
|
smoothnessScale = FindProperty("_GlossMapScale", props, false);
|
||||||
|
smoothnessMapChannel = FindProperty("_SmoothnessTextureChannel", props, false);
|
||||||
|
highlights = FindProperty("_SpecularHighlights", props, false);
|
||||||
|
reflections = FindProperty("_GlossyReflections", props, false);
|
||||||
|
bumpScale = FindProperty("_BumpScale", props);
|
||||||
|
bumpMap = FindProperty("_BumpMap", props);
|
||||||
|
heigtMapScale = FindProperty("_Parallax", props);
|
||||||
|
heightMap = FindProperty("_ParallaxMap", props);
|
||||||
|
occlusionStrength = FindProperty("_OcclusionStrength", props);
|
||||||
|
occlusionMap = FindProperty("_OcclusionMap", props);
|
||||||
|
emissionColorForRendering = FindProperty("_EmissionColor", props);
|
||||||
|
emissionMap = FindProperty("_EmissionMap", props);
|
||||||
|
detailMask = FindProperty("_DetailMask", props);
|
||||||
|
detailAlbedoMap = FindProperty("_DetailAlbedoMap", props);
|
||||||
|
detailNormalMapScale = FindProperty("_DetailNormalMapScale", props);
|
||||||
|
detailNormalMap = FindProperty("_DetailNormalMap", props);
|
||||||
|
uvSetSecondary = FindProperty("_UVSec", props);
|
||||||
|
enableDoubleSided = FindProperty("_BAKERY_2SIDED", props);
|
||||||
|
enableDoubleSidedOn = FindProperty("_BAKERY_2SIDEDON", props);
|
||||||
|
enableVertexLM = FindProperty("_BAKERY_VERTEXLM", props);
|
||||||
|
enableVertexLMdir = FindProperty("_BAKERY_VERTEXLMDIR", props);
|
||||||
|
enableVertexLMSH = FindProperty("_BAKERY_VERTEXLMSH", props);
|
||||||
|
enableVertexLMmask = FindProperty("_BAKERY_VERTEXLMMASK", props);
|
||||||
|
enableSH = FindProperty("_BAKERY_SH", props);
|
||||||
|
enableSHN = FindProperty("_BAKERY_SHNONLINEAR", props);
|
||||||
|
enableRNM = FindProperty("_BAKERY_RNM", props);
|
||||||
|
enableSpec = FindProperty("_BAKERY_LMSPEC", props);
|
||||||
|
enableBicubic = FindProperty("_BAKERY_BICUBIC", props);
|
||||||
|
enablePSHN = FindProperty("_BAKERY_PROBESHNONLINEAR", props);
|
||||||
|
enableVolumes = FindProperty("_BAKERY_VOLUME", props);
|
||||||
|
volume0 = FindProperty("_Volume0", props);
|
||||||
|
volume1 = FindProperty("_Volume1", props);
|
||||||
|
volume2 = FindProperty("_Volume2", props);
|
||||||
|
volumeMask = FindProperty("_VolumeMask", props);
|
||||||
|
volumeMin = FindProperty("_VolumeMin", props);
|
||||||
|
volumeInvSize = FindProperty("_VolumeInvSize", props);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
|
||||||
|
{
|
||||||
|
FindProperties(props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly
|
||||||
|
m_MaterialEditor = materialEditor;
|
||||||
|
Material material = materialEditor.target as Material;
|
||||||
|
|
||||||
|
// Make sure that needed keywords are set up if we're switching some existing
|
||||||
|
// material to a standard shader.
|
||||||
|
if (m_FirstTimeApply)
|
||||||
|
{
|
||||||
|
SetMaterialKeywords(material, m_WorkflowMode);
|
||||||
|
m_FirstTimeApply = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderPropertiesGUI(material);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShaderPropertiesGUI(Material material)
|
||||||
|
{
|
||||||
|
// Use default labelWidth
|
||||||
|
EditorGUIUtility.labelWidth = 0f;
|
||||||
|
|
||||||
|
// Detect any changes to the material
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
{
|
||||||
|
BlendModePopup();
|
||||||
|
|
||||||
|
// Primary properties
|
||||||
|
GUILayout.Label(Styles.primaryMapsText, EditorStyles.boldLabel);
|
||||||
|
DoAlbedoArea(material);
|
||||||
|
DoSpecularMetallicArea();
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.heightMapText, heightMap, heightMap.textureValue != null ? heigtMapScale : null);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.occlusionText, occlusionMap, occlusionMap.textureValue != null ? occlusionStrength : null);
|
||||||
|
DoEmissionArea(material);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.detailMaskText, detailMask);
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
m_MaterialEditor.TextureScaleOffsetProperty(albedoMap);
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
emissionMap.textureScaleAndOffset = albedoMap.textureScaleAndOffset; // Apply the main texture scale and offset to the emission texture as well, for Enlighten's sake
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
// Secondary properties
|
||||||
|
GUILayout.Label(Styles.secondaryMapsText, EditorStyles.boldLabel);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.detailAlbedoText, detailAlbedoMap);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.detailNormalMapText, detailNormalMap, detailNormalMapScale);
|
||||||
|
m_MaterialEditor.TextureScaleOffsetProperty(detailAlbedoMap);
|
||||||
|
m_MaterialEditor.ShaderProperty(uvSetSecondary, Styles.uvSetLabel.text);
|
||||||
|
|
||||||
|
// Third properties
|
||||||
|
GUILayout.Label(Styles.forwardText, EditorStyles.boldLabel);
|
||||||
|
if (highlights != null)
|
||||||
|
m_MaterialEditor.ShaderProperty(highlights, Styles.highlightsText);
|
||||||
|
if (reflections != null)
|
||||||
|
m_MaterialEditor.ShaderProperty(reflections, Styles.reflectionsText);
|
||||||
|
|
||||||
|
GUILayout.Label(Styles.bakeryText, EditorStyles.boldLabel);
|
||||||
|
|
||||||
|
m_MaterialEditor.ShaderProperty(enableDoubleSidedOn, Styles.doubleSidedLabel);
|
||||||
|
enableDoubleSided.floatValue = enableDoubleSidedOn.floatValue > 0 ? 0 : 2;
|
||||||
|
|
||||||
|
m_MaterialEditor.ShaderProperty(enableVertexLM, Styles.vertexLMLabel);
|
||||||
|
if (enableVertexLM.floatValue > 0)
|
||||||
|
{
|
||||||
|
m_MaterialEditor.ShaderProperty(enableVertexLMdir, Styles.vertexLMdirLabel);
|
||||||
|
//if (enableVertexLMdir.floatValue > 0) enableVertexLMSH.floatValue = 0;
|
||||||
|
}
|
||||||
|
if (enableVertexLM.floatValue > 0)
|
||||||
|
{
|
||||||
|
m_MaterialEditor.ShaderProperty(enableVertexLMSH, Styles.vertexLMSHLabel);
|
||||||
|
//if (enableVertexLMSH.floatValue > 0) enableVertexLMdir.floatValue = 0;
|
||||||
|
}
|
||||||
|
if (enableVertexLM.floatValue > 0)
|
||||||
|
{
|
||||||
|
m_MaterialEditor.ShaderProperty(enableVertexLMmask, Styles.vertexLMMaskLabel);
|
||||||
|
}
|
||||||
|
m_MaterialEditor.ShaderProperty(enableRNM, Styles.rnmLabel);
|
||||||
|
m_MaterialEditor.ShaderProperty(enableSH, Styles.shLabel);
|
||||||
|
if (enableSH.floatValue > 0 || enableVertexLMSH.floatValue > 0)
|
||||||
|
m_MaterialEditor.ShaderProperty(enableSHN, Styles.shnLabel);
|
||||||
|
m_MaterialEditor.ShaderProperty(enableSpec, Styles.specLabel);
|
||||||
|
m_MaterialEditor.ShaderProperty(enableBicubic, Styles.bicubicLabel);
|
||||||
|
m_MaterialEditor.ShaderProperty(enablePSHN, Styles.pshnLabel);
|
||||||
|
|
||||||
|
m_MaterialEditor.ShaderProperty(enableVolumes, Styles.volLabel);
|
||||||
|
if (enableVolumes.floatValue > 0)
|
||||||
|
{
|
||||||
|
var prevAssignedVolume = assignedVolume;
|
||||||
|
assignedVolume = EditorGUILayout.ObjectField(volume0.textureValue == null ? "Assign volume" : "Assign different volume", assignedVolume, typeof(BakeryVolume), true) as BakeryVolume;
|
||||||
|
if (prevAssignedVolume != assignedVolume)
|
||||||
|
{
|
||||||
|
volume0.textureValue = assignedVolume.bakedTexture0;
|
||||||
|
volume1.textureValue = assignedVolume.bakedTexture1;
|
||||||
|
volume2.textureValue = assignedVolume.bakedTexture2;
|
||||||
|
volumeMask.textureValue = assignedVolume.bakedMask;
|
||||||
|
var b = assignedVolume.bounds;
|
||||||
|
volumeMin.vectorValue = b.min;
|
||||||
|
volumeInvSize.vectorValue = new Vector3(1.0f/b.size.x, 1.0f/b.size.y, 1.0f/b.size.z);
|
||||||
|
assignedVolume = null;
|
||||||
|
}
|
||||||
|
if (volume0.textureValue != null)
|
||||||
|
{
|
||||||
|
if (GUILayout.Button("Unset volume"))
|
||||||
|
{
|
||||||
|
volume0.textureValue = null;
|
||||||
|
volume1.textureValue = null;
|
||||||
|
volume2.textureValue = null;
|
||||||
|
volumeMask.textureValue = null;
|
||||||
|
volumeMin.vectorValue = Vector3.zero;
|
||||||
|
volumeInvSize.vectorValue = Vector3.one * 1000001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EditorGUILayout.LabelField("Current Volume: " + (volume0.textureValue == null ? "<none or global>" : volume0.textureValue.name.Substring(0, volume0.textureValue.name.Length-1)));
|
||||||
|
EditorGUI.BeginDisabledGroup(true);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.volLabel0, volume0);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.volLabel1, volume1);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.volLabel2, volume2);
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.volLabelMask, volumeMask);
|
||||||
|
var bmin4 = volumeMin.vectorValue;
|
||||||
|
var bmin = new Vector3(bmin4.x, bmin4.y, bmin4.z);
|
||||||
|
var invSize = volumeInvSize.vectorValue;
|
||||||
|
var bmax = new Vector3(1.0f/invSize.x + bmin.x, 1.0f/invSize.y + bmin.y, 1.0f/invSize.z + bmin.z);
|
||||||
|
EditorGUILayout.LabelField("Min: " + bmin);
|
||||||
|
EditorGUILayout.LabelField("Max: " + bmax);
|
||||||
|
EditorGUI.EndDisabledGroup();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
}
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
foreach (var obj in blendMode.targets)
|
||||||
|
MaterialChanged((Material)obj, m_WorkflowMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void DetermineWorkflow(MaterialProperty[] props)
|
||||||
|
{
|
||||||
|
if (FindProperty("_SpecGlossMap", props, false) != null && FindProperty("_SpecColor", props, false) != null)
|
||||||
|
m_WorkflowMode = WorkflowMode.Specular;
|
||||||
|
else if (FindProperty("_MetallicGlossMap", props, false) != null && FindProperty("_Metallic", props, false) != null)
|
||||||
|
m_WorkflowMode = WorkflowMode.Metallic;
|
||||||
|
else
|
||||||
|
m_WorkflowMode = WorkflowMode.Dielectric;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
|
||||||
|
{
|
||||||
|
// _Emission property is lost after assigning Standard shader to the material
|
||||||
|
// thus transfer it before assigning the new shader
|
||||||
|
if (material.HasProperty("_Emission"))
|
||||||
|
{
|
||||||
|
material.SetColor("_EmissionColor", material.GetColor("_Emission"));
|
||||||
|
}
|
||||||
|
|
||||||
|
base.AssignNewShaderToMaterial(material, oldShader, newShader);
|
||||||
|
|
||||||
|
if (oldShader == null || !oldShader.name.Contains("Legacy Shaders/"))
|
||||||
|
{
|
||||||
|
SetupMaterialWithBlendMode(material, (BlendMode)material.GetFloat("_Mode"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendMode blendMode = BlendMode.Opaque;
|
||||||
|
if (oldShader.name.Contains("/Transparent/Cutout/"))
|
||||||
|
{
|
||||||
|
blendMode = BlendMode.Cutout;
|
||||||
|
}
|
||||||
|
else if (oldShader.name.Contains("/Transparent/"))
|
||||||
|
{
|
||||||
|
// NOTE: legacy shaders did not provide physically based transparency
|
||||||
|
// therefore Fade mode
|
||||||
|
blendMode = BlendMode.Fade;
|
||||||
|
}
|
||||||
|
material.SetFloat("_Mode", (float)blendMode);
|
||||||
|
|
||||||
|
DetermineWorkflow(MaterialEditor.GetMaterialProperties(new Material[] { material }));
|
||||||
|
MaterialChanged(material, m_WorkflowMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlendModePopup()
|
||||||
|
{
|
||||||
|
EditorGUI.showMixedValue = blendMode.hasMixedValue;
|
||||||
|
var mode = (BlendMode)blendMode.floatValue;
|
||||||
|
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
mode = (BlendMode)EditorGUILayout.Popup(Styles.renderingMode, (int)mode, Styles.blendNames);
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
m_MaterialEditor.RegisterPropertyChangeUndo("Rendering Mode");
|
||||||
|
blendMode.floatValue = (float)mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUI.showMixedValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoAlbedoArea(Material material)
|
||||||
|
{
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.albedoText, albedoMap, albedoColor);
|
||||||
|
if (((BlendMode)material.GetFloat("_Mode") == BlendMode.Cutout))
|
||||||
|
{
|
||||||
|
m_MaterialEditor.ShaderProperty(alphaCutoff, Styles.alphaCutoffText.text, MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoEmissionArea(Material material)
|
||||||
|
{
|
||||||
|
bool showHelpBox = !HasValidEmissiveKeyword(material);
|
||||||
|
|
||||||
|
bool hadEmissionTexture = emissionMap.textureValue != null;
|
||||||
|
|
||||||
|
// Texture and HDR color controls
|
||||||
|
m_MaterialEditor.TexturePropertyWithHDRColor(Styles.emissionText, emissionMap, emissionColorForRendering, m_ColorPickerHDRConfig, false);
|
||||||
|
|
||||||
|
// If texture was assigned and color was black set color to white
|
||||||
|
float brightness = emissionColorForRendering.colorValue.maxColorComponent;
|
||||||
|
if (emissionMap.textureValue != null && !hadEmissionTexture && brightness <= 0f)
|
||||||
|
emissionColorForRendering.colorValue = Color.white;
|
||||||
|
|
||||||
|
// Emission for GI?
|
||||||
|
m_MaterialEditor.LightmapEmissionProperty(MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
|
||||||
|
|
||||||
|
if (showHelpBox)
|
||||||
|
{
|
||||||
|
EditorGUILayout.HelpBox(Styles.emissiveWarning.text, MessageType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoSpecularMetallicArea()
|
||||||
|
{
|
||||||
|
bool hasGlossMap = false;
|
||||||
|
if (m_WorkflowMode == WorkflowMode.Specular)
|
||||||
|
{
|
||||||
|
hasGlossMap = specularMap.textureValue != null;
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapText, specularMap, hasGlossMap ? null : specularColor);
|
||||||
|
}
|
||||||
|
else if (m_WorkflowMode == WorkflowMode.Metallic)
|
||||||
|
{
|
||||||
|
hasGlossMap = metallicMap.textureValue != null;
|
||||||
|
m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapText, metallicMap, hasGlossMap ? null : metallic);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool showSmoothnessScale = hasGlossMap;
|
||||||
|
if (smoothnessMapChannel != null)
|
||||||
|
{
|
||||||
|
int smoothnessChannel = (int)smoothnessMapChannel.floatValue;
|
||||||
|
if (smoothnessChannel == (int)SmoothnessMapChannel.AlbedoAlpha)
|
||||||
|
showSmoothnessScale = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int indentation = 2; // align with labels of texture properties
|
||||||
|
m_MaterialEditor.ShaderProperty(showSmoothnessScale ? smoothnessScale : smoothness, showSmoothnessScale ? Styles.smoothnessScaleText : Styles.smoothnessText, indentation);
|
||||||
|
|
||||||
|
++indentation;
|
||||||
|
if (smoothnessMapChannel != null)
|
||||||
|
m_MaterialEditor.ShaderProperty(smoothnessMapChannel, Styles.smoothnessMapChannelText, indentation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetupMaterialWithBlendMode(Material material, BlendMode blendMode)
|
||||||
|
{
|
||||||
|
switch (blendMode)
|
||||||
|
{
|
||||||
|
case BlendMode.Opaque:
|
||||||
|
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
|
||||||
|
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
|
||||||
|
material.SetInt("_ZWrite", 1);
|
||||||
|
material.DisableKeyword("_ALPHATEST_ON");
|
||||||
|
material.DisableKeyword("_ALPHABLEND_ON");
|
||||||
|
material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
|
||||||
|
material.renderQueue = -1;
|
||||||
|
break;
|
||||||
|
case BlendMode.Cutout:
|
||||||
|
material.SetOverrideTag("RenderType", "TransparentCutout");
|
||||||
|
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
|
||||||
|
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
|
||||||
|
material.SetInt("_ZWrite", 1);
|
||||||
|
material.EnableKeyword("_ALPHATEST_ON");
|
||||||
|
material.DisableKeyword("_ALPHABLEND_ON");
|
||||||
|
material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
|
||||||
|
material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.AlphaTest;
|
||||||
|
break;
|
||||||
|
case BlendMode.Fade:
|
||||||
|
material.SetOverrideTag("RenderType", "Transparent");
|
||||||
|
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
|
||||||
|
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
|
||||||
|
material.SetInt("_ZWrite", 0);
|
||||||
|
material.DisableKeyword("_ALPHATEST_ON");
|
||||||
|
material.EnableKeyword("_ALPHABLEND_ON");
|
||||||
|
material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
|
||||||
|
material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
|
||||||
|
break;
|
||||||
|
case BlendMode.Transparent:
|
||||||
|
material.SetOverrideTag("RenderType", "Transparent");
|
||||||
|
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
|
||||||
|
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
|
||||||
|
material.SetInt("_ZWrite", 0);
|
||||||
|
material.DisableKeyword("_ALPHATEST_ON");
|
||||||
|
material.DisableKeyword("_ALPHABLEND_ON");
|
||||||
|
material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
|
||||||
|
material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static SmoothnessMapChannel GetSmoothnessMapChannel(Material material)
|
||||||
|
{
|
||||||
|
int ch = (int)material.GetFloat("_SmoothnessTextureChannel");
|
||||||
|
if (ch == (int)SmoothnessMapChannel.AlbedoAlpha)
|
||||||
|
return SmoothnessMapChannel.AlbedoAlpha;
|
||||||
|
else
|
||||||
|
return SmoothnessMapChannel.SpecularMetallicAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ShouldEmissionBeEnabled(Material mat, Color color)
|
||||||
|
{
|
||||||
|
var realtimeEmission = (mat.globalIlluminationFlags & MaterialGlobalIlluminationFlags.RealtimeEmissive) > 0;
|
||||||
|
return color.maxColorComponent > 0.1f / 255.0f || realtimeEmission;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetMaterialKeywords(Material material, WorkflowMode workflowMode)
|
||||||
|
{
|
||||||
|
// Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation
|
||||||
|
// (MaterialProperty value might come from renderer material property block)
|
||||||
|
SetKeyword(material, "_NORMALMAP", material.GetTexture("_BumpMap") || material.GetTexture("_DetailNormalMap"));
|
||||||
|
if (workflowMode == WorkflowMode.Specular)
|
||||||
|
SetKeyword(material, "_SPECGLOSSMAP", material.GetTexture("_SpecGlossMap"));
|
||||||
|
else if (workflowMode == WorkflowMode.Metallic)
|
||||||
|
SetKeyword(material, "_METALLICGLOSSMAP", material.GetTexture("_MetallicGlossMap"));
|
||||||
|
SetKeyword(material, "_PARALLAXMAP", material.GetTexture("_ParallaxMap"));
|
||||||
|
SetKeyword(material, "_DETAIL_MULX2", material.GetTexture("_DetailAlbedoMap") || material.GetTexture("_DetailNormalMap"));
|
||||||
|
|
||||||
|
bool shouldEmissionBeEnabled = ShouldEmissionBeEnabled(material, material.GetColor("_EmissionColor"));
|
||||||
|
SetKeyword(material, "_EMISSION", shouldEmissionBeEnabled);
|
||||||
|
|
||||||
|
if (material.HasProperty("_SmoothnessTextureChannel"))
|
||||||
|
{
|
||||||
|
SetKeyword(material, "_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A", GetSmoothnessMapChannel(material) == SmoothnessMapChannel.AlbedoAlpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup lightmap emissive flags
|
||||||
|
MaterialGlobalIlluminationFlags flags = material.globalIlluminationFlags;
|
||||||
|
if ((flags & (MaterialGlobalIlluminationFlags.BakedEmissive | MaterialGlobalIlluminationFlags.RealtimeEmissive)) != 0)
|
||||||
|
{
|
||||||
|
flags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack;
|
||||||
|
if (!shouldEmissionBeEnabled)
|
||||||
|
flags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
|
||||||
|
|
||||||
|
material.globalIlluminationFlags = flags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasValidEmissiveKeyword(Material material)
|
||||||
|
{
|
||||||
|
// Material animation might be out of sync with the material keyword.
|
||||||
|
// So if the emission support is disabled on the material, but the property blocks have a value that requires it, then we need to show a warning.
|
||||||
|
// (note: (Renderer MaterialPropertyBlock applies its values to emissionColorForRendering))
|
||||||
|
bool hasEmissionKeyword = material.IsKeywordEnabled("_EMISSION");
|
||||||
|
if (!hasEmissionKeyword && ShouldEmissionBeEnabled(material, emissionColorForRendering.colorValue))
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MaterialChanged(Material material, WorkflowMode workflowMode)
|
||||||
|
{
|
||||||
|
SetupMaterialWithBlendMode(material, (BlendMode)material.GetFloat("_Mode"));
|
||||||
|
|
||||||
|
SetMaterialKeywords(material, workflowMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetKeyword(Material m, string keyword, bool state)
|
||||||
|
{
|
||||||
|
if (state)
|
||||||
|
m.EnableKeyword(keyword);
|
||||||
|
else
|
||||||
|
m.DisableKeyword(keyword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
12
Assets/Bakery/shader/Editor/BakeryShaderGUI.cs.meta
Normal file
12
Assets/Bakery/shader/Editor/BakeryShaderGUI.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0465c9a9a7404f34fadd23fd32de6557
|
||||||
|
timeCreated: 1538411297
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 59c1dd4e7f7f3104ebb173ea8474d7ed
|
guid: c08e497195d12e540b500a31facdec9b
|
||||||
NativeFormatImporter:
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 4300000
|
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
9
Assets/Editor.meta
Normal file
9
Assets/Editor.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b5c6bd78bdd2c1e4494f00190e425cb0
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Editor/x64.meta
Normal file
9
Assets/Editor/x64.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5d1c2c72ba259dc4d91764b043bc0132
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/Editor/x64/Bakery.meta
Normal file
9
Assets/Editor/x64/Bakery.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 77a27e27bd2771544be2b85bfe73d283
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1606240228
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
48
Assets/Editor/x64/Bakery/.denoiserlog.txt
Normal file
48
Assets/Editor/x64/Bakery/.denoiserlog.txt
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepare.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish.ptx::oxMain...
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Done
|
||||||
|
Loading shader denoisePrepare.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish.ptx::oxMain...
|
||||||
|
Done
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepare72.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish72.ptx::oxMain...
|
||||||
|
Done
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepareOIDN.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinishOIDN.ptx::oxMain...
|
||||||
|
Done
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepare.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish.ptx::oxMain...
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepare.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish.ptx::oxMain...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepare72.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinish72.ptx::oxMain...
|
||||||
|
Done
|
||||||
|
2020-12-3
|
||||||
|
Init...
|
||||||
|
Tiles: 1
|
||||||
|
Loading shader denoisePrepareOIDN.ptx::oxMain...
|
||||||
|
Loading shader denoiseFinishOIDN.ptx::oxMain...
|
||||||
|
Done
|
12343
Assets/Editor/x64/Bakery/.ftracelog.txt
Normal file
12343
Assets/Editor/x64/Bakery/.ftracelog.txt
Normal file
File diff suppressed because it is too large
Load Diff
739
Assets/Editor/x64/Bakery/.uvgblog.txt
Normal file
739
Assets/Editor/x64/Bakery/.uvgblog.txt
Normal file
@ -0,0 +1,739 @@
|
|||||||
|
2020-12-3
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA4.lz4" 2 0 4 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 2 0 6 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 2 0 5 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA2.lz4" 2 0 2 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA7.lz4" 2 0 7 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LM0.lz4" 2 0 0 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA1.lz4" 2 0 1 0
|
||||||
|
Running ftrace skycubemapprobesh "C:\Users\tooma\AppData\Local\Temp\frender" "light_-391477247_8" 1924 0 8 sky0.bin
|
||||||
|
Running ftrace sunprobesh "C:\Users\tooma\AppData\Local\Temp\frender" "light_2104029182_8" 1924 0 8 direct0.bin
|
||||||
|
Running ftrace addmul "C:\Users\tooma\AppData\Local\Temp\frender" "probes" 4 0 8 comp_8.bin
|
||||||
|
Running ftrace skycubemap "C:\Users\tooma\AppData\Local\Temp\frender" "light_-391477247_3" 4 0 3 sky0.bin
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 2 0 6 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 2 0 5 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA4.lz4" 2 0 4 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA2.lz4" 2 0 2 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA7.lz4" 2 0 7 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LM0.lz4" 2 0 0 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 8
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 34 0 3 0
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 3
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 34 0 6 0
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 6
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 34 0 5 0
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 5
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 8
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 34 0 3 0
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 3
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 8
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 34 0 3 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 51
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering UV normal...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 8
|
||||||
|
2020-12-3
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 8
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 34 0 3 0
|
||||||
|
Running ftrace lodselect "C:\Users\tooma\AppData\Local\Temp\frender" "lodselect" 2 0 3
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA4.lz4" 2 0 4 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 2 0 6 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 2 0 5 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA2.lz4" 2 0 2 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA7.lz4" 2 0 7 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LM0.lz4" 2 0 0 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA4.lz4" 2 0 4 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 2 0 6 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 2 0 5 0
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
initScene done
|
||||||
|
Done
|
||||||
|
Loaded vertex shader: quad.vso
|
||||||
|
Loaded pixel shader: skyOutput.pso
|
||||||
|
Loaded pixel shader: cookieOutput.pso
|
||||||
|
initShaders done
|
||||||
|
Rendering UV GBuffer for Main_scene_LM0 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA1 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA2 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA3 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA4 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA5 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA6 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for Main_scene_LMA7 50
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Rendering faceted UV normal...
|
||||||
|
Rendering UV pos...
|
||||||
|
Rendering smooth UV pos...
|
||||||
|
Rendering UV GBuffer for probes 256
|
||||||
|
RGBA32F...RGBA8...RGBA8_SRGB...RGBA16F...states...
|
||||||
|
Done
|
||||||
|
Done
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA5.lz4" 2 0 5 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA3.lz4" 2 0 3 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA4.lz4" 2 0 4 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA2.lz4" 2 0 2 0
|
||||||
|
Running ftrace fixpos12 "C:\Users\tooma\AppData\Local\Temp\frender" "uvpos_Main_scene_LMA6.lz4" 2 0 6 0
|
||||||
|
Waiting on threads to park on joinable thread list timed out.
|
BIN
Assets/Editor/x64/Bakery/NormalsFittingTexture_dds
Normal file
BIN
Assets/Editor/x64/Bakery/NormalsFittingTexture_dds
Normal file
Binary file not shown.
8
Assets/Editor/x64/Bakery/NormalsFittingTexture_dds.meta
Normal file
8
Assets/Editor/x64/Bakery/NormalsFittingTexture_dds.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fad0196ede3a41749af057ec68f43124
|
||||||
|
timeCreated: 1531334118
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Editor/x64/Bakery/OpenImageDenoise.dll
(Stored with Git LFS)
Normal file
BIN
Assets/Editor/x64/Bakery/OpenImageDenoise.dll
(Stored with Git LFS)
Normal file
Binary file not shown.
28
Assets/Editor/x64/Bakery/OpenImageDenoise.dll.meta
Normal file
28
Assets/Editor/x64/Bakery/OpenImageDenoise.dll.meta
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4ccddc16f2ea5484dbb20164a60bf488
|
||||||
|
timeCreated: 1589355275
|
||||||
|
licenseType: Store
|
||||||
|
PluginImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
platformData:
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
200
Assets/Editor/x64/Bakery/addAO.ptx
Normal file
200
Assets/Editor/x64/Bakery/addAO.ptx
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
//
|
||||||
|
// Generated by NVIDIA NVVM Compiler
|
||||||
|
//
|
||||||
|
// Compiler Build ID: CL-23083092
|
||||||
|
// Cuda compilation tools, release 9.1, V9.1.85
|
||||||
|
// Based on LLVM 3.4svn
|
||||||
|
//
|
||||||
|
|
||||||
|
.version 6.1
|
||||||
|
.target sm_30
|
||||||
|
.address_size 64
|
||||||
|
|
||||||
|
// .globl _Z6oxMainv
|
||||||
|
.global .align 8 .b8 pixelID[8];
|
||||||
|
.global .align 8 .b8 resolution[8];
|
||||||
|
.global .align 4 .b8 normal[12];
|
||||||
|
.global .align 4 .b8 camPos[12];
|
||||||
|
.global .align 4 .b8 root[4];
|
||||||
|
.global .align 4 .u32 imageEnabled;
|
||||||
|
.global .texref lightmap;
|
||||||
|
.global .align 16 .b8 tileInfo[16];
|
||||||
|
.global .align 4 .u32 additive;
|
||||||
|
.global .align 1 .b8 image[1];
|
||||||
|
.global .align 1 .b8 image2[1];
|
||||||
|
.global .align 4 .f32 intensity;
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo7pixelIDE[8] = {82, 97, 121, 0, 8, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo10resolutionE[8] = {82, 97, 121, 0, 8, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo6normalE[8] = {82, 97, 121, 0, 12, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo6camPosE[8] = {82, 97, 121, 0, 12, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo4rootE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo12imageEnabledE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo8tileInfoE[8] = {82, 97, 121, 0, 16, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo8additiveE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo9intensityE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register20reg_bitness_detectorE;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail0E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail1E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail2E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail3E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail4E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail5E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail6E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail7E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail8E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail9E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail0E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail1E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail2E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail3E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail4E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail5E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail6E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail7E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail8E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail9E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_xE;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_yE;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_zE;
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename7pixelIDE[6] = {117, 105, 110, 116, 50, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename10resolutionE[6] = {117, 105, 110, 116, 50, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename6normalE[7] = {102, 108, 111, 97, 116, 51, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename6camPosE[7] = {102, 108, 111, 97, 116, 51, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_typename4rootE[9] = {114, 116, 79, 98, 106, 101, 99, 116, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typename12imageEnabledE[4] = {105, 110, 116, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename8tileInfoE[6] = {117, 105, 110, 116, 52, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typename8additiveE[4] = {105, 110, 116, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename9intensityE[6] = {102, 108, 111, 97, 116, 0};
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum7pixelIDE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum10resolutionE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum6normalE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum6camPosE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum4rootE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum12imageEnabledE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum8tileInfoE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum8additiveE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum9intensityE = 4919;
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic7pixelIDE[14] = {114, 116, 76, 97, 117, 110, 99, 104, 73, 110, 100, 101, 120, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic10resolutionE[12] = {114, 116, 76, 97, 117, 110, 99, 104, 68, 105, 109, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic6normalE[17] = {97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 110, 111, 114, 109, 97, 108, 0};
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic6camPosE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic4rootE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic12imageEnabledE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic8tileInfoE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic8additiveE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic9intensityE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation7pixelIDE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation10resolutionE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation6normalE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation6camPosE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation4rootE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation12imageEnabledE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation8tileInfoE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation8additiveE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation9intensityE[1];
|
||||||
|
|
||||||
|
.visible .entry _Z6oxMainv(
|
||||||
|
|
||||||
|
)
|
||||||
|
{
|
||||||
|
.reg .b16 %rs<10>;
|
||||||
|
.reg .f32 %f<15>;
|
||||||
|
.reg .b32 %r<37>;
|
||||||
|
.reg .b64 %rd<39>;
|
||||||
|
|
||||||
|
|
||||||
|
ld.global.v2.u32 {%r13, %r14}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd3, %r13;
|
||||||
|
cvt.u64.u32 %rd4, %r14;
|
||||||
|
mov.u64 %rd37, image;
|
||||||
|
cvta.global.u64 %rd2, %rd37;
|
||||||
|
mov.u32 %r11, 2;
|
||||||
|
mov.u32 %r12, 8;
|
||||||
|
mov.u64 %rd36, 0;
|
||||||
|
// inline asm
|
||||||
|
call (%rd1), _rt_buffer_get_64, (%rd2, %r11, %r12, %rd3, %rd4, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs1, [%rd1+6];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f1, %rs1;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r17, %r18}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd9, %r17;
|
||||||
|
cvt.u64.u32 %rd10, %r18;
|
||||||
|
// inline asm
|
||||||
|
call (%rd7), _rt_buffer_get_64, (%rd2, %r11, %r12, %rd9, %rd10, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs2, [%rd7];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f2, %rs2;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r21, %r22}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd15, %r21;
|
||||||
|
cvt.u64.u32 %rd16, %r22;
|
||||||
|
// inline asm
|
||||||
|
call (%rd13), _rt_buffer_get_64, (%rd2, %r11, %r12, %rd15, %rd16, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs3, [%rd13+2];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f3, %rs3;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r25, %r26}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd21, %r25;
|
||||||
|
cvt.u64.u32 %rd22, %r26;
|
||||||
|
// inline asm
|
||||||
|
call (%rd19), _rt_buffer_get_64, (%rd2, %r11, %r12, %rd21, %rd22, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs4, [%rd19+4];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f4, %rs4;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r29, %r30}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd27, %r29;
|
||||||
|
cvt.u64.u32 %rd28, %r30;
|
||||||
|
mov.u64 %rd38, image2;
|
||||||
|
cvta.global.u64 %rd26, %rd38;
|
||||||
|
mov.u32 %r10, 1;
|
||||||
|
// inline asm
|
||||||
|
call (%rd25), _rt_buffer_get_64, (%rd26, %r11, %r10, %rd27, %rd28, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
ld.u8 %rs9, [%rd25];
|
||||||
|
cvt.rn.f32.u16 %f9, %rs9;
|
||||||
|
div.rn.f32 %f10, %f9, 0f437F0000;
|
||||||
|
ld.global.f32 %f11, [intensity];
|
||||||
|
add.f32 %f12, %f10, 0fBF800000;
|
||||||
|
fma.rn.f32 %f13, %f11, %f12, 0f3F800000;
|
||||||
|
cvt.sat.f32.f32 %f14, %f13;
|
||||||
|
mul.f32 %f5, %f2, %f14;
|
||||||
|
mul.f32 %f6, %f3, %f14;
|
||||||
|
mul.f32 %f7, %f4, %f14;
|
||||||
|
ld.global.v2.u32 {%r33, %r34}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd33, %r33;
|
||||||
|
cvt.u64.u32 %rd34, %r34;
|
||||||
|
// inline asm
|
||||||
|
call (%rd31), _rt_buffer_get_64, (%rd2, %r11, %r12, %rd33, %rd34, %rd36, %rd36);
|
||||||
|
// inline asm
|
||||||
|
// inline asm
|
||||||
|
{ cvt.rn.f16.f32 %rs7, %f7;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
// inline asm
|
||||||
|
{ cvt.rn.f16.f32 %rs6, %f6;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
// inline asm
|
||||||
|
{ cvt.rn.f16.f32 %rs5, %f5;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
// inline asm
|
||||||
|
{ cvt.rn.f16.f32 %rs8, %f1;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
st.v4.u16 [%rd31], {%rs5, %rs6, %rs7, %rs8};
|
||||||
|
ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
8
Assets/Editor/x64/Bakery/addAO.ptx.meta
Normal file
8
Assets/Editor/x64/Bakery/addAO.ptx.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aa2c6f245990b69408c255eb48c206eb
|
||||||
|
timeCreated: 1534430149
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
327
Assets/Editor/x64/Bakery/addDir.ptx
Normal file
327
Assets/Editor/x64/Bakery/addDir.ptx
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
//
|
||||||
|
// Generated by NVIDIA NVVM Compiler
|
||||||
|
//
|
||||||
|
// Compiler Build ID: CL-23083092
|
||||||
|
// Cuda compilation tools, release 9.1, V9.1.85
|
||||||
|
// Based on LLVM 3.4svn
|
||||||
|
//
|
||||||
|
|
||||||
|
.version 6.1
|
||||||
|
.target sm_30
|
||||||
|
.address_size 64
|
||||||
|
|
||||||
|
// .globl _Z6oxMainv
|
||||||
|
.global .align 8 .b8 pixelID[8];
|
||||||
|
.global .align 8 .b8 resolution[8];
|
||||||
|
.global .align 4 .b8 normal[12];
|
||||||
|
.global .align 4 .b8 camPos[12];
|
||||||
|
.global .align 4 .b8 root[4];
|
||||||
|
.global .align 4 .u32 imageEnabled;
|
||||||
|
.global .texref lightmap;
|
||||||
|
.global .align 16 .b8 tileInfo[16];
|
||||||
|
.global .align 4 .u32 additive;
|
||||||
|
.global .align 1 .b8 uvnormal[1];
|
||||||
|
.global .align 1 .b8 image[1];
|
||||||
|
.global .align 1 .b8 image2[1];
|
||||||
|
.global .align 1 .b8 imageHDR[1];
|
||||||
|
.global .align 1 .b8 imageFinal[1];
|
||||||
|
.global .align 4 .f32 DoNormalize;
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo7pixelIDE[8] = {82, 97, 121, 0, 8, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo10resolutionE[8] = {82, 97, 121, 0, 8, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo6normalE[8] = {82, 97, 121, 0, 12, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo6camPosE[8] = {82, 97, 121, 0, 12, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo4rootE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo12imageEnabledE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo8tileInfoE[8] = {82, 97, 121, 0, 16, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo8additiveE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typeinfo11DoNormalizeE[8] = {82, 97, 121, 0, 4, 0, 0, 0};
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register20reg_bitness_detectorE;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail0E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail1E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail2E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail3E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail4E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail5E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail6E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail7E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail8E;
|
||||||
|
.global .align 8 .u64 _ZN21rti_internal_register24reg_exception_64_detail9E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail0E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail1E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail2E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail3E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail4E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail5E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail6E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail7E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail8E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register21reg_exception_detail9E;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_xE;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_yE;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_register14reg_rayIndex_zE;
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename7pixelIDE[6] = {117, 105, 110, 116, 50, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename10resolutionE[6] = {117, 105, 110, 116, 50, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename6normalE[7] = {102, 108, 111, 97, 116, 51, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename6camPosE[7] = {102, 108, 111, 97, 116, 51, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_typename4rootE[9] = {114, 116, 79, 98, 106, 101, 99, 116, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typename12imageEnabledE[4] = {105, 110, 116, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename8tileInfoE[6] = {117, 105, 110, 116, 52, 0};
|
||||||
|
.global .align 4 .b8 _ZN21rti_internal_typename8additiveE[4] = {105, 110, 116, 0};
|
||||||
|
.global .align 8 .b8 _ZN21rti_internal_typename11DoNormalizeE[6] = {102, 108, 111, 97, 116, 0};
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum7pixelIDE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum10resolutionE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum6normalE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum6camPosE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum4rootE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum12imageEnabledE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum8tileInfoE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum8additiveE = 4919;
|
||||||
|
.global .align 4 .u32 _ZN21rti_internal_typeenum11DoNormalizeE = 4919;
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic7pixelIDE[14] = {114, 116, 76, 97, 117, 110, 99, 104, 73, 110, 100, 101, 120, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic10resolutionE[12] = {114, 116, 76, 97, 117, 110, 99, 104, 68, 105, 109, 0};
|
||||||
|
.global .align 16 .b8 _ZN21rti_internal_semantic6normalE[17] = {97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 110, 111, 114, 109, 97, 108, 0};
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic6camPosE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic4rootE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic12imageEnabledE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic8tileInfoE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic8additiveE[1];
|
||||||
|
.global .align 1 .b8 _ZN21rti_internal_semantic11DoNormalizeE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation7pixelIDE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation10resolutionE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation6normalE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation6camPosE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation4rootE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation12imageEnabledE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation8tileInfoE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation8additiveE[1];
|
||||||
|
.global .align 1 .b8 _ZN23rti_internal_annotation11DoNormalizeE[1];
|
||||||
|
|
||||||
|
.visible .entry _Z6oxMainv(
|
||||||
|
|
||||||
|
)
|
||||||
|
{
|
||||||
|
.reg .pred %p<4>;
|
||||||
|
.reg .b16 %rs<20>;
|
||||||
|
.reg .f32 %f<88>;
|
||||||
|
.reg .b32 %r<79>;
|
||||||
|
.reg .b64 %rd<80>;
|
||||||
|
|
||||||
|
|
||||||
|
ld.global.v2.u32 {%r20, %r21}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd4, %r20;
|
||||||
|
cvt.u64.u32 %rd5, %r21;
|
||||||
|
mov.u64 %rd56, imageHDR;
|
||||||
|
cvta.global.u64 %rd3, %rd56;
|
||||||
|
mov.u32 %r18, 2;
|
||||||
|
mov.u32 %r7, 8;
|
||||||
|
mov.u64 %rd55, 0;
|
||||||
|
// inline asm
|
||||||
|
call (%rd2), _rt_buffer_get_64, (%rd3, %r18, %r7, %rd4, %rd5, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs2, [%rd2];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f17, %rs2;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r24, %r25}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd10, %r24;
|
||||||
|
cvt.u64.u32 %rd11, %r25;
|
||||||
|
// inline asm
|
||||||
|
call (%rd8), _rt_buffer_get_64, (%rd3, %r18, %r7, %rd10, %rd11, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs3, [%rd8+2];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f18, %rs3;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
ld.global.v2.u32 {%r28, %r29}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd16, %r28;
|
||||||
|
cvt.u64.u32 %rd17, %r29;
|
||||||
|
// inline asm
|
||||||
|
call (%rd14), _rt_buffer_get_64, (%rd3, %r18, %r7, %rd16, %rd17, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u16 %rs4, [%rd14+4];
|
||||||
|
// inline asm
|
||||||
|
{ cvt.f32.f16 %f19, %rs4;}
|
||||||
|
|
||||||
|
// inline asm
|
||||||
|
mul.f32 %f20, %f18, 0f3F372474;
|
||||||
|
fma.rn.f32 %f21, %f17, 0f3E59999A, %f20;
|
||||||
|
fma.rn.f32 %f22, %f19, 0f3D93A92A, %f21;
|
||||||
|
ld.global.v2.u32 {%r32, %r33}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd22, %r32;
|
||||||
|
cvt.u64.u32 %rd23, %r33;
|
||||||
|
mov.u64 %rd57, image2;
|
||||||
|
cvta.global.u64 %rd21, %rd57;
|
||||||
|
mov.u32 %r19, 16;
|
||||||
|
// inline asm
|
||||||
|
call (%rd20), _rt_buffer_get_64, (%rd21, %r18, %r19, %rd22, %rd23, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.v4.f32 {%f23, %f24, %f25, %f26}, [%rd20];
|
||||||
|
ld.global.v2.u32 {%r36, %r37}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd28, %r36;
|
||||||
|
cvt.u64.u32 %rd29, %r37;
|
||||||
|
mov.u64 %rd58, image;
|
||||||
|
cvta.global.u64 %rd27, %rd58;
|
||||||
|
mov.u32 %r17, 4;
|
||||||
|
// inline asm
|
||||||
|
call (%rd26), _rt_buffer_get_64, (%rd27, %r18, %r17, %rd28, %rd29, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u8 %rs5, [%rd26];
|
||||||
|
cvt.rn.f32.u16 %f30, %rs5;
|
||||||
|
div.rn.f32 %f31, %f30, 0f437F0000;
|
||||||
|
fma.rn.f32 %f32, %f31, 0f40000000, 0fBF800000;
|
||||||
|
ld.global.v2.u32 {%r40, %r41}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd34, %r40;
|
||||||
|
cvt.u64.u32 %rd35, %r41;
|
||||||
|
// inline asm
|
||||||
|
call (%rd32), _rt_buffer_get_64, (%rd27, %r18, %r17, %rd34, %rd35, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u8 %rs6, [%rd32+1];
|
||||||
|
cvt.rn.f32.u16 %f33, %rs6;
|
||||||
|
div.rn.f32 %f34, %f33, 0f437F0000;
|
||||||
|
fma.rn.f32 %f35, %f34, 0f40000000, 0fBF800000;
|
||||||
|
ld.global.v2.u32 {%r44, %r45}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd40, %r44;
|
||||||
|
cvt.u64.u32 %rd41, %r45;
|
||||||
|
// inline asm
|
||||||
|
call (%rd38), _rt_buffer_get_64, (%rd27, %r18, %r17, %rd40, %rd41, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u8 %rs7, [%rd38+2];
|
||||||
|
cvt.rn.f32.u16 %f36, %rs7;
|
||||||
|
div.rn.f32 %f37, %f36, 0f437F0000;
|
||||||
|
fma.rn.f32 %f38, %f37, 0f40000000, 0fBF800000;
|
||||||
|
mul.f32 %f39, %f35, %f35;
|
||||||
|
fma.rn.f32 %f40, %f32, %f32, %f39;
|
||||||
|
fma.rn.f32 %f41, %f38, %f38, %f40;
|
||||||
|
sqrt.rn.f32 %f42, %f41;
|
||||||
|
rcp.rn.f32 %f43, %f42;
|
||||||
|
mul.f32 %f44, %f32, %f43;
|
||||||
|
mul.f32 %f45, %f35, %f43;
|
||||||
|
mul.f32 %f46, %f38, %f43;
|
||||||
|
fma.rn.f32 %f1, %f22, %f44, %f23;
|
||||||
|
fma.rn.f32 %f2, %f22, %f45, %f24;
|
||||||
|
fma.rn.f32 %f3, %f22, %f46, %f25;
|
||||||
|
ld.global.v2.u32 {%r48, %r49}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd46, %r48;
|
||||||
|
cvt.u64.u32 %rd47, %r49;
|
||||||
|
// inline asm
|
||||||
|
call (%rd44), _rt_buffer_get_64, (%rd27, %r18, %r17, %rd46, %rd47, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u8 %rs8, [%rd44+3];
|
||||||
|
cvt.rn.f32.u16 %f47, %rs8;
|
||||||
|
div.rn.f32 %f48, %f47, 0f437F0000;
|
||||||
|
ld.global.v2.u32 {%r52, %r53}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd52, %r52;
|
||||||
|
cvt.u64.u32 %rd53, %r53;
|
||||||
|
// inline asm
|
||||||
|
call (%rd50), _rt_buffer_get_64, (%rd21, %r18, %r19, %rd52, %rd53, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.f32 %f49, [%rd50+12];
|
||||||
|
min.f32 %f87, %f48, %f49;
|
||||||
|
ld.global.f32 %f50, [DoNormalize];
|
||||||
|
setp.gt.f32 %p1, %f50, 0f3F000000;
|
||||||
|
@%p1 bra BB0_2;
|
||||||
|
bra.uni BB0_1;
|
||||||
|
|
||||||
|
BB0_2:
|
||||||
|
mul.f32 %f54, %f2, %f2;
|
||||||
|
fma.rn.f32 %f55, %f1, %f1, %f54;
|
||||||
|
fma.rn.f32 %f56, %f3, %f3, %f55;
|
||||||
|
sqrt.rn.f32 %f57, %f56;
|
||||||
|
rcp.rn.f32 %f58, %f57;
|
||||||
|
mul.f32 %f5, %f1, %f58;
|
||||||
|
mul.f32 %f6, %f2, %f58;
|
||||||
|
mul.f32 %f7, %f3, %f58;
|
||||||
|
ld.global.v2.u32 {%r64, %r65}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd68, %r64;
|
||||||
|
cvt.u64.u32 %rd69, %r65;
|
||||||
|
mov.u64 %rd72, uvnormal;
|
||||||
|
cvta.global.u64 %rd67, %rd72;
|
||||||
|
// inline asm
|
||||||
|
call (%rd66), _rt_buffer_get_64, (%rd67, %r18, %r17, %rd68, %rd69, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
ld.u32 %r1, [%rd66];
|
||||||
|
shr.u32 %r68, %r1, 16;
|
||||||
|
cvt.u16.u32 %rs1, %r68;
|
||||||
|
and.b16 %rs9, %rs1, 255;
|
||||||
|
cvt.u16.u32 %rs10, %r1;
|
||||||
|
or.b16 %rs11, %rs10, %rs9;
|
||||||
|
setp.eq.s16 %p2, %rs11, 0;
|
||||||
|
mov.f32 %f84, 0f00000000;
|
||||||
|
mov.f32 %f85, %f84;
|
||||||
|
mov.f32 %f86, %f84;
|
||||||
|
@%p2 bra BB0_4;
|
||||||
|
|
||||||
|
ld.u8 %rs12, [%rd66+1];
|
||||||
|
and.b16 %rs14, %rs10, 255;
|
||||||
|
cvt.rn.f32.u16 %f59, %rs14;
|
||||||
|
div.rn.f32 %f60, %f59, 0f437F0000;
|
||||||
|
fma.rn.f32 %f61, %f60, 0f40000000, 0fBF800000;
|
||||||
|
cvt.rn.f32.u16 %f62, %rs12;
|
||||||
|
div.rn.f32 %f63, %f62, 0f437F0000;
|
||||||
|
fma.rn.f32 %f64, %f63, 0f40000000, 0fBF800000;
|
||||||
|
cvt.rn.f32.u16 %f65, %rs9;
|
||||||
|
div.rn.f32 %f66, %f65, 0f437F0000;
|
||||||
|
fma.rn.f32 %f67, %f66, 0f40000000, 0fBF800000;
|
||||||
|
mul.f32 %f68, %f64, %f64;
|
||||||
|
fma.rn.f32 %f69, %f61, %f61, %f68;
|
||||||
|
fma.rn.f32 %f70, %f67, %f67, %f69;
|
||||||
|
sqrt.rn.f32 %f71, %f70;
|
||||||
|
rcp.rn.f32 %f72, %f71;
|
||||||
|
mul.f32 %f84, %f61, %f72;
|
||||||
|
mul.f32 %f85, %f64, %f72;
|
||||||
|
mul.f32 %f86, %f67, %f72;
|
||||||
|
|
||||||
|
BB0_4:
|
||||||
|
mul.f32 %f73, %f6, %f85;
|
||||||
|
fma.rn.f32 %f74, %f5, %f84, %f73;
|
||||||
|
fma.rn.f32 %f14, %f7, %f86, %f74;
|
||||||
|
setp.leu.f32 %p3, %f87, 0f00000000;
|
||||||
|
@%p3 bra BB0_6;
|
||||||
|
|
||||||
|
fma.rn.f32 %f75, %f14, 0f3F000000, 0f3F000000;
|
||||||
|
mov.f32 %f76, 0f3B808081;
|
||||||
|
max.f32 %f87, %f75, %f76;
|
||||||
|
|
||||||
|
BB0_6:
|
||||||
|
ld.global.v2.u32 {%r71, %r72}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd75, %r71;
|
||||||
|
cvt.u64.u32 %rd76, %r72;
|
||||||
|
mov.u64 %rd79, imageFinal;
|
||||||
|
cvta.global.u64 %rd74, %rd79;
|
||||||
|
// inline asm
|
||||||
|
call (%rd73), _rt_buffer_get_64, (%rd74, %r18, %r17, %rd75, %rd76, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
fma.rn.f32 %f77, %f5, 0f3F000000, 0f3F000000;
|
||||||
|
mul.f32 %f78, %f77, 0f437F0000;
|
||||||
|
cvt.rzi.u32.f32 %r75, %f78;
|
||||||
|
fma.rn.f32 %f79, %f6, 0f3F000000, 0f3F000000;
|
||||||
|
mul.f32 %f80, %f79, 0f437F0000;
|
||||||
|
cvt.rzi.u32.f32 %r76, %f80;
|
||||||
|
fma.rn.f32 %f81, %f7, 0f3F000000, 0f3F000000;
|
||||||
|
mul.f32 %f82, %f81, 0f437F0000;
|
||||||
|
cvt.rzi.u32.f32 %r77, %f82;
|
||||||
|
mul.f32 %f83, %f87, 0f437F0000;
|
||||||
|
cvt.rzi.u32.f32 %r78, %f83;
|
||||||
|
cvt.u16.u32 %rs16, %r78;
|
||||||
|
cvt.u16.u32 %rs17, %r77;
|
||||||
|
cvt.u16.u32 %rs18, %r76;
|
||||||
|
cvt.u16.u32 %rs19, %r75;
|
||||||
|
st.v4.u8 [%rd73], {%rs19, %rs18, %rs17, %rs16};
|
||||||
|
bra.uni BB0_7;
|
||||||
|
|
||||||
|
BB0_1:
|
||||||
|
ld.global.v2.u32 {%r58, %r59}, [pixelID];
|
||||||
|
cvt.u64.u32 %rd61, %r58;
|
||||||
|
cvt.u64.u32 %rd62, %r59;
|
||||||
|
// inline asm
|
||||||
|
call (%rd59), _rt_buffer_get_64, (%rd21, %r18, %r19, %rd61, %rd62, %rd55, %rd55);
|
||||||
|
// inline asm
|
||||||
|
st.v4.f32 [%rd59], {%f1, %f2, %f3, %f87};
|
||||||
|
|
||||||
|
BB0_7:
|
||||||
|
ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user