Arnaud Carre
8 年前
当前提交
7500d3c2
共有 34 个文件被更改,包括 1422 次插入 和 1375 次删除
-
3Assets/BasicRenderBatching/BasicBatching.unity
-
2Assets/BasicRenderBatching/BasicMat_ColorsFlat.mat
-
2Assets/BasicRenderBatching/BasicMat_ColorsFlat.mat.meta
-
2Assets/BasicRenderBatching/LightingBatching/LightingData.asset.meta
-
999Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_dir.png
-
2Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_dir.png.meta
-
1001Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_light.exr
-
2Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_light.exr.meta
-
2Assets/BasicRenderBatching/LightingBatching/ReflectionProbe-0.exr.meta
-
4Assets/BasicRenderBatching/Prefabs/Capsule.prefab
-
4Assets/BasicRenderBatching/Prefabs/cube.prefab
-
4Assets/BasicRenderBatching/Prefabs/cylinder.prefab
-
4Assets/BasicRenderBatching/Prefabs/sphere.prefab
-
37Assets/BasicRenderBatching/Scripts/PopulateScene.cs
-
7Assets/TestScenes/HDTest/Editor/Generator.cs
-
2Assets/TestScenes/HDTest/Material/BatchingTest/Materials/Iron50.mat
-
2Assets/TestScenes/HDTest/Material/BatchingTest/Materials/Iron51.mat
-
2Assets/TestScenes/HDTest/Material/BatchingTest/Materials/Iron52.mat
-
2Assets/TestScenes/HDTest/Material/BatchingTest/Materials/Iron53.mat
-
4ProjectSettings/EditorBuildSettings.asset
-
107Assets/BasicRenderBatching/BasicMat_Colors8Textures.mat
-
8Assets/BasicRenderBatching/BasicMat_Colors8Textures.mat.meta
-
148Assets/BasicRenderBatching/BasicRenderBatchingShaderFlat.shader
-
17Assets/BasicRenderBatching/BasicRenderBatchingShaderFlat.shader.meta
-
9Assets/BasicRenderBatching/LightingBatchingProbe.meta
-
8Assets/BasicRenderBatching/LightingBatchingProbe.unity.meta
-
335Assets/BasicRenderBatching/LightingBatchingProbe/LightingData.asset
-
8Assets/BasicRenderBatching/LightingBatchingProbe/LightingData.asset.meta
-
1Assets/BasicRenderBatching/LightingBatchingProbe/ReflectionProbe-0.exr
-
69Assets/BasicRenderBatching/LightingBatchingProbe/ReflectionProbe-0.exr.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 44aa08b82f029c24c9caf197abd44104 |
|||
timeCreated: 1484930574 |
|||
timeCreated: 1485275241 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
999
Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_dir.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
1001
Assets/BasicRenderBatching/LightingBatching/Lightmap-0_comp_light.exr
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: BasicMat_Colors8Textures |
|||
m_Shader: {fileID: 4800000, guid: 915ec92038355ed418b43639259468cc, type: 3} |
|||
m_ShaderKeywords: _EMISSION |
|||
m_LightmapFlags: 1 |
|||
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: 2, y: 2} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 2, y: 2} |
|||
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} |
|||
- myTexture1: |
|||
m_Texture: {fileID: 2800000, guid: 4425fca2a65e78c49b2415476d1cc5ec, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture2: |
|||
m_Texture: {fileID: 2800000, guid: 04b429f47f1e0d54ca799a2a31986801, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture3: |
|||
m_Texture: {fileID: 2800000, guid: 70233265683595f468e46f6300a0c7f5, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture4: |
|||
m_Texture: {fileID: 2800000, guid: b94537f3a7934f84a9e66c662bc06800, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture5: |
|||
m_Texture: {fileID: 2800000, guid: ff3ba92a36048274ab6eb2ec4567fa44, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture6: |
|||
m_Texture: {fileID: 2800000, guid: 2d69bdda1399802499987e9f68ae88ed, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture7: |
|||
m_Texture: {fileID: 2800000, guid: 14d974c88ade21747938eb13f6cfc152, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- myTexture8: |
|||
m_Texture: {fileID: 2800000, guid: 8e18cf146b7c0d0449454cdeb8653d94, type: 3} |
|||
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.474 |
|||
- _GlossyReflections: 1 |
|||
- _Metallic: 0.194 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 1 |
|||
- _Parallax: 0.02 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _UVSec: 0 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- _Color: {r: 0.97794116, g: 0, b: 0, a: 1} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- myColor: {r: 1, g: 1, b: 1, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4c676c131a81b634988506c3023ea7a5 |
|||
timeCreated: 1481127206 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Upgrade NOTE: replaced 'glstate_matrix_invtrans_modelview0' with 'UNITY_MATRIX_IT_MV' |
|||
// Upgrade NOTE: replaced 'glstate_matrix_modelview0' with 'UNITY_MATRIX_MV' |
|||
// Upgrade NOTE: replaced 'glstate_matrix_mvp' with 'UNITY_MATRIX_MVP' |
|||
|
|||
// Example shader for a scriptable render loop that calculates multiple lights |
|||
// in a single forward-rendered shading pass. Uses same PBR shading model as the |
|||
// Standard shader. |
|||
// |
|||
// The parameters and inspector of the shader are the same as Standard shader, |
|||
// for easier experimentation. |
|||
Shader "RenderLoop/Batching/StandardFlat" |
|||
{ |
|||
// Properties is just a copy of Standard.shader. Our example shader does not use all of them, |
|||
// but the inspector UI expects all these to exist. |
|||
Properties |
|||
{ |
|||
// _Color("Color", Color) = (1,1,1,1) |
|||
myColor("Color", Color) = (1,1,1,1) |
|||
// [HideInInspector] _Mode("__mode", Float) = 0.0 |
|||
// [HideInInspector] _SrcBlend("__src", Float) = 1.0 |
|||
// [HideInInspector] _DstBlend("__dst", Float) = 0.0 |
|||
// [HideInInspector] _ZWrite("__zw", Float) = 1.0 |
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } |
|||
LOD 300 |
|||
|
|||
// Multiple lights at once pass, for our example Basic render loop. |
|||
Pass |
|||
{ |
|||
Tags { "LightMode" = "BasicPass" } |
|||
|
|||
// Use same blending / depth states as Standard shader |
|||
Blend One Zero |
|||
ZWrite On |
|||
|
|||
CGPROGRAM |
|||
#pragma target 3.0 |
|||
#pragma vertex vert |
|||
#pragma fragment frag |
|||
//#pragma shader_feature _METALLICGLOSSMAP |
|||
//#include "UnityCG.cginc" |
|||
#include "HLSLSupport.cginc" |
|||
|
|||
//float4 _Color; |
|||
|
|||
// Global lighting data (setup from C# code once per frame). |
|||
|
|||
CBUFFER_START(GlobalLightData) |
|||
// The variables are very similar to built-in unity_LightColor, unity_LightPosition, |
|||
// unity_LightAtten, unity_SpotDirection as used by the VertexLit shaders, except here |
|||
// we use world space positions instead of view space. |
|||
half4 globalLightColor[8]; |
|||
float4 globalLightPos[8]; |
|||
float4 globalLightSpotDir[8]; |
|||
float4 globalLightAtten[8]; |
|||
int4 globalLightCount; |
|||
// Global ambient/SH probe, similar to unity_SH* built-in variables. |
|||
float4 globalSH[7]; |
|||
CBUFFER_END |
|||
|
|||
CBUFFER_START(UniformBuffer_FastBatch : register(b1) ) |
|||
float4 myColor; |
|||
CBUFFER_END |
|||
|
|||
|
|||
/* |
|||
CBUFFER_START(UnityPerDraw) // 352 bytes, uploaded per object (even if just position change position ) |
|||
float4x4 UNITY_MATRIX_MVP; |
|||
float4x4 UNITY_MATRIX_MV; |
|||
float4x4 UNITY_MATRIX_IT_MV; |
|||
|
|||
float4x4 unity_ObjectToWorld; |
|||
float4x4 unity_WorldToObject; |
|||
float4 unity_LODFade; // x is the fade value ranging within [0,1]. y is x quantized into 16 levels |
|||
float4 unity_WorldTransformParams; // w is usually 1.0, or -1.0 for odd-negative scale transforms |
|||
CBUFFER_END |
|||
*/ |
|||
|
|||
|
|||
// Compute attenuation & illumination from one light |
|||
half3 EvaluateOneLight(int idx, float3 positionWS, half3 normalWS, float3 vAlbedo) |
|||
{ |
|||
// direction to light |
|||
float3 dirToLight = globalLightPos[idx].xyz; |
|||
dirToLight -= positionWS * globalLightPos[idx].w; |
|||
// distance attenuation |
|||
float att = 1.0; |
|||
float distSqr = dot(dirToLight, dirToLight); |
|||
att /= (1.0 + globalLightAtten[idx].z * distSqr); |
|||
if (globalLightPos[idx].w != 0 && distSqr > globalLightAtten[idx].w) att = 0.0; // set to 0 if outside of range |
|||
distSqr = max(distSqr, 0.000001); // don't produce NaNs if some vertex position overlaps with the light |
|||
dirToLight *= rsqrt(distSqr); |
|||
|
|||
// spotlight angular attenuation |
|||
// Fill in light & indirect structures, and evaluate Standard BRDF |
|||
half3 light = globalLightColor[idx].rgb * att; |
|||
half3 c = dot(dirToLight, normalWS) * light * vAlbedo; |
|||
return c; |
|||
} |
|||
|
|||
// Vertex shader |
|||
struct v2f // vertex to fragment |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
float3 positionWS : TEXCOORD1; |
|||
float3 normalWS : TEXCOORD2; |
|||
float4 hpos : SV_POSITION; |
|||
}; |
|||
|
|||
struct s2v // stream to vertex |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float3 normal : NORMAL; |
|||
float4 texcoord : TEXCOORD0; |
|||
}; |
|||
|
|||
|
|||
v2f vert(s2v v) |
|||
{ |
|||
v2f o; |
|||
o.uv = v.texcoord.xy; |
|||
o.hpos = mul(UNITY_MATRIX_MVP, v.vertex); |
|||
o.positionWS = mul(unity_ObjectToWorld, v.vertex).xyz; |
|||
o.normalWS = normalize(mul((float3x3)unity_WorldToObject, v.normal)); |
|||
return o; |
|||
} |
|||
|
|||
// Fragment shader |
|||
half4 frag(v2f i) : SV_Target |
|||
{ |
|||
i.normalWS = normalize(i.normalWS); |
|||
float4 color; |
|||
|
|||
float4 diffuseAlbedo = float4(1, 1, 1, 1); |
|||
|
|||
color = half4(EvaluateOneLight(0, i.positionWS, i.normalWS, diffuseAlbedo.rgb * myColor.rgb),1); |
|||
return color; |
|||
} |
|||
|
|||
ENDCG |
|||
} |
|||
} |
|||
|
|||
// CustomEditor "StandardShaderGUI" |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 552f186b9e84fe1409a0c237fff4c3e6 |
|||
timeCreated: 1483608332 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: |
|||
- myTexture1: {fileID: 2800000, guid: 4425fca2a65e78c49b2415476d1cc5ec, type: 3} |
|||
- myTexture2: {fileID: 2800000, guid: 04b429f47f1e0d54ca799a2a31986801, type: 3} |
|||
- myTexture3: {fileID: 2800000, guid: 70233265683595f468e46f6300a0c7f5, type: 3} |
|||
- myTexture4: {fileID: 2800000, guid: b94537f3a7934f84a9e66c662bc06800, type: 3} |
|||
- myTexture5: {fileID: 2800000, guid: ff3ba92a36048274ab6eb2ec4567fa44, type: 3} |
|||
- myTexture6: {fileID: 2800000, guid: 2d69bdda1399802499987e9f68ae88ed, type: 3} |
|||
- myTexture7: {fileID: 2800000, guid: 14d974c88ade21747938eb13f6cfc152, type: 3} |
|||
- myTexture8: {fileID: 2800000, guid: 8e18cf146b7c0d0449454cdeb8653d94, type: 3} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 41f174a20bda91d4a8692d971d52c93f |
|||
folderAsset: yes |
|||
timeCreated: 1485274825 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 31f42ae1e6cc3974891437c90e52bfa5 |
|||
timeCreated: 1481127663 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
335
Assets/BasicRenderBatching/LightingBatchingProbe/LightingData.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: c3a6e4b0d5368cc47bd136cb4b389e6b |
|||
timeCreated: 1485275198 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
v/1 channels chlist 7 B G R compression compression dataWindow box2i � displayWindow box2i � lineOrder lineOrder pixelAspectRatio float �?screenWindowCenter v2f screenWindowWidth float �? Y � u � � ~ @ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ � � ~ @ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@ � � ~ @ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������` � � ~ @ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ |
|
|||
fileFormatVersion: 2 |
|||
guid: 5e85d9fdddd5f59459945a8d96f79f0b |
|||
timeCreated: 1485275198 |
|||
licenseType: Pro |
|||
TextureImporter: |
|||
fileIDToRecycleName: |
|||
8900000: generatedCubemap |
|||
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: 1 |
|||
seamlessCubemap: 1 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
filterMode: 2 |
|||
aniso: 0 |
|||
mipBias: 0 |
|||
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: 2 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 100 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
spritePackingTag: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue