浏览代码
Merge pull request #211 from Unity-Technologies/Branch_ExportSky
Merge pull request #211 from Unity-Technologies/Branch_ExportSky
Added a way to export the current sky and to override the sky lighting with a cubemap./fptl_cleanup
GitHub
8 年前
当前提交
fea6ad98
共有 15 个文件被更改,包括 298 次插入 和 70 次删除
-
30Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
5Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
4Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
-
84Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
-
110Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
-
9Assets/ScriptableRenderPipeline/common/Resources.meta
-
20Assets/TestScenes/HDTest/GlobalIlluminationTest/CommonSettings_GlobalIllumination.asset
-
9Assets/TestScenes/HDTest/GlobalIlluminationTest/CommonSettings_GlobalIllumination.asset.meta
-
20Assets/TestScenes/HDTest/GlobalIlluminationTest/HDRISkySettings_GlobalIllumination.asset
-
9Assets/TestScenes/HDTest/GlobalIlluminationTest/HDRISkySettings_GlobalIllumination.asset.meta
-
9Assets/ScriptableRenderPipeline/common/Resources/BlitCubemap.shader.meta
-
56Assets/ScriptableRenderPipeline/common/Resources/BlitCubemap.shader
|
|||
fileFormatVersion: 2 |
|||
guid: 1e02c245110074e4aa88a9b408060d4f |
|||
folderAsset: yes |
|||
timeCreated: 1491318329 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: bc357c46587fc9d4cb8f311794d7d2f3, type: 3} |
|||
m_Name: CommonSettings_GlobalIllumination |
|||
m_EditorClassIdentifier: |
|||
m_Settings: |
|||
m_ShadowMaxDistance: 400 |
|||
m_ShadowCascadeCount: 4 |
|||
m_ShadowCascadeSplit0: 0.05 |
|||
m_ShadowCascadeSplit1: 0.2 |
|||
m_ShadowCascadeSplit2: 0.3 |
|||
m_ShadowNearPlaneOffset: 5 |
|
|||
fileFormatVersion: 2 |
|||
guid: 99a5b1b4f3634864da02f42919203da9 |
|||
timeCreated: 1491228144 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3} |
|||
m_Name: HDRISkySettings_GlobalIllumination |
|||
m_EditorClassIdentifier: |
|||
rotation: 0 |
|||
exposure: 0 |
|||
multiplier: 1 |
|||
resolution: 256 |
|||
updateMode: 0 |
|||
updatePeriod: 0 |
|||
skyHDRI: {fileID: 8900000, guid: de78f930088fc194290da7400c89bfb5, type: 3} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6708eedd5f11b464aa0e50eb2f100ae4 |
|||
timeCreated: 1488464830 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d05913e251bed7a4992c921c62e1b647 |
|||
timeCreated: 1491318357 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Note: This shader is supposed to be removed at some point when Graphics.ConvertTexture can take a RenderTexture as a destination (it's only used by sky manager for now). |
|||
Shader "Hidden/BlitCubemap" { |
|||
SubShader { |
|||
// Cubemap blit. Takes a face index. |
|||
Pass { |
|||
ZTest Always Cull Off ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
#pragma target 4.5 |
|||
|
|||
#include "../../ShaderLibrary/Common.hlsl" |
|||
|
|||
TEXTURECUBE(_MainTex); |
|||
SAMPLERCUBE(sampler_MainTex); |
|||
float _faceIndex; |
|||
|
|||
struct appdata_t { |
|||
uint vertexID : SV_VertexID; |
|||
}; |
|||
|
|||
struct v2f { |
|||
float4 vertex : SV_POSITION; |
|||
float3 texcoord : TEXCOORD0; |
|||
}; |
|||
|
|||
static const float3 faceU[6] = { float3(0, 0, -1), float3(0, 0, 1), float3(1, 0, 0), float3(1, 0, 0), float3(1, 0, 0), float3(-1, 0, 0) }; |
|||
static const float3 faceV[6] = { float3(0, -1, 0), float3(0, -1, 0), float3(0, 0, 1), float3(0, 0, -1), float3(0, -1, 0), float3(0, -1, 0) }; |
|||
|
|||
v2f vert (appdata_t v) |
|||
{ |
|||
v2f o; |
|||
|
|||
o.vertex = GetFullScreenTriangleVertexPosition(v.vertexID); |
|||
float2 uv = GetFullScreenTriangleTexcoord(v.vertexID) * 2.0 - 1.0; |
|||
|
|||
int idx = (int)_faceIndex; |
|||
float3 transformU = faceU[idx]; |
|||
float3 transformV = faceV[idx]; |
|||
|
|||
float3 n = cross(transformV, transformU); |
|||
o.texcoord = n + uv.x * transformU + uv.y * transformV; |
|||
return o; |
|||
} |
|||
|
|||
float4 frag (v2f i) : SV_Target |
|||
{ |
|||
return SAMPLE_TEXTURECUBE(_MainTex, sampler_MainTex, i.texcoord); |
|||
} |
|||
ENDHLSL |
|||
|
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue