浏览代码

Merge branch 'LightweightPipeline'

# Conflicts:
#	ScriptableRenderPipeline/master-package.json
/main
Felipe Lira 7 年前
当前提交
4ec47f43
共有 17 个文件被更改,包括 85 次插入16 次删除
  1. 2
      ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs
  2. 4
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightCore.cginc
  3. 4
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader
  4. 2
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardSimpleLighting.shader
  5. 4
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardTerrain.shader
  6. 2
      ScriptableRenderPipeline/master-package.json
  7. 32
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs
  8. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources.meta
  9. 16
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset
  10. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset.meta
  11. 8
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs
  12. 11
      ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs.meta
  13. 0
      /LightweightPipelineAsset.asset.meta
  14. 0
      /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs.meta
  15. 0
      /LightweightPipelineAsset.asset
  16. 0
      /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs

2
ScriptableRenderPipeline/LightweightPipeline/LightweightPipeline.cs


}
Light light = lightData.light;
if (light.bakingOutput.lightmapBakeType == LightmapBakeType.Mixed)
if (light.bakingOutput.mixedLightingMode == MixedLightingMode.Subtractive && light.bakingOutput.lightmapBakeType == LightmapBakeType.Mixed)
{
// TODO: Add support to shadow mask
if (m_MixedLightingSetup == MixedLightingSetup.None && lightData.light.shadows != LightShadows.None)

4
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightCore.cginc


#if defined(UNITY_COLORSPACE_GAMMA)
#define LIGHTWEIGHT_GAMMA_TO_LINEAR(gammaColor) gammaColor * gammaColor
#define LIGHTWEIGHT_LINEAR_TO_GAMMA(linColor) sqrt(color)
#define OUTPUT_COLOR(color) return half4(LIGHTWEIGHT_LINEAR_TO_GAMMA(color.rgb), color.a)
#define LIGHTWEIGHT_LINEAR_TO_GAMMA(linColor) sqrt(linColor)
#define OUTPUT_COLOR(color) half4(LIGHTWEIGHT_LINEAR_TO_GAMMA(color.rgb), color.a)
#else
#define LIGHTWEIGHT_GAMMA_TO_LINEAR(color) color
#define LIGHTWEIGHT_LINEAR_TO_GAMMA(color) color

4
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandard.shader


#pragma shader_feature _SPECULAR_SETUP
#pragma multi_compile _ _MAIN_LIGHT_COOKIE
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT _MAIN_POINT_LIGHT
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE _MIXED_LIGHTING_SHADOWMASK
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DIRLIGHTMAP_COMBINED

2
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardSimpleLighting.shader


#pragma multi_compile _ _MAIN_LIGHT_COOKIE
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT
#pragma multi_compile _ _ADDITIONAL_LIGHTS
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE _MIXED_LIGHTING_SHADOWMASK
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DIRLIGHTMAP_COMBINED

4
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightStandardTerrain.shader


#include "LightweightLighting.cginc"
#pragma multi_compile _ _MAIN_LIGHT_COOKIE
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT _MAIN_POINT_LIGHT
#pragma multi_compile _MAIN_DIRECTIONAL_LIGHT _MAIN_SPOT_LIGHT
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE _MIXED_LIGHTING_SHADOWMASK
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
#pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DIRLIGHTMAP_COMBINED

2
ScriptableRenderPipeline/master-package.json


{
"version": "0.1.9",
"version": "0.1.10",
"unity": "2018.1",
"dependencies": {
"com.unity.postprocessing": "0.1.3"

32
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs


[SerializeField] private float m_Cascade2Split = 0.25f;
[SerializeField] private Vector3 m_Cascade4Split = new Vector3(0.067f, 0.2f, 0.467f);
[SerializeField] private Material m_DefaultMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultTerrainMaterial;
[SerializeField] private Material m_DefaultMaterial;
[SerializeField] private Material m_DefaultParticleMaterial;
[SerializeField] private Material m_DefaultTerrainMaterial;
#if UNITY_EDITOR
[UnityEditor.MenuItem("Assets/Create/Render Pipeline/Lightweight/Render Pipeline", priority = CoreUtils.assetCreateMenuPriority1)]

string[] guids = UnityEditor.AssetDatabase.FindAssets("LightweightPipelineResource t:scriptableobject");
LightweightPipelineResource resourceAsset = null;
foreach (string guid in guids)
{
string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
resourceAsset = UnityEditor.AssetDatabase.LoadAssetAtPath<LightweightPipelineResource>(path);
if (resourceAsset != null)
break;
}
if (resourceAsset != null)
{
instance.m_DefaultMaterial = resourceAsset.DefaultMaterial;
instance.m_DefaultParticleMaterial = resourceAsset.DefaultParticleMaterial;
instance.m_DefaultTerrainMaterial = resourceAsset.DefaultTerrainMaterial;
}
string path = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Lightweight Asset", "LightweightAsset", "asset",
string assetPath = UnityEditor.EditorUtility.SaveFilePanelInProject("Save Lightweight Asset", "LightweightAsset", "asset",
if (path.Length > 0)
UnityEditor.AssetDatabase.CreateAsset(instance, path);
if (assetPath.Length > 0)
UnityEditor.AssetDatabase.CreateAsset(instance, assetPath);
}
#endif

8
ScriptableRenderPipeline/LightweightPipeline/Resources.meta


fileFormatVersion: 2
guid: 96a897191a3b552429d819147e6a36a4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

16
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eb91b173ce266e040aa972ca9a561308, type: 3}
m_Name: LightweightPipelineResource
m_EditorClassIdentifier:
DefaultMaterial: {fileID: 0}
DefaultParticleMaterial: {fileID: 0}
DefaultTerrainMaterial: {fileID: 0}

8
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.asset.meta


fileFormatVersion: 2
guid: c8afc0a27fb8c0b4da18151c689a1082
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs


using UnityEngine;
public class LightweightPipelineResource : ScriptableObject
{
public Material DefaultMaterial;
public Material DefaultParticleMaterial;
public Material DefaultTerrainMaterial;
}

11
ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineResource.cs.meta


fileFormatVersion: 2
guid: eb91b173ce266e040aa972ca9a561308
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset.meta → /LightweightPipelineAsset.asset.meta

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs.meta → /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs.meta

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.asset → /LightweightPipelineAsset.asset

/ScriptableRenderPipeline/LightweightPipeline/LightweightPipelineAsset.cs → /ScriptableRenderPipeline/LightweightPipeline/Resources/LightweightPipelineAsset.cs

正在加载...
取消
保存