浏览代码

Fixed global illumination setup and shader.

/main
Julien Ignace 8 年前
当前提交
b43fec12
共有 4 个文件被更改,包括 1013 次插入3 次删除
  1. 1
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 6
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitData.hlsl
  3. 1001
      Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
  4. 8
      Assets/TestScenes/HDTest/GlobalIlluminationTest.unity.meta

1
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


DrawRendererSettings settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName));
settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh;
settings.inputFilter.SetQueuesOpaque();
settings.rendererConfiguration = RendererConfiguration.PerObjectLightProbe | RendererConfiguration.PerObjectReflectionProbes | RendererConfiguration.PerObjectLightmaps | RendererConfiguration.PerObjectLightProbeProxyVolume;
renderLoop.DrawRenderers(ref settings);
}

6
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitData.hlsl


#ifdef DIRLIGHTMAP_COMBINED
bakeDiffuseLighting += SampleDirectionalLightmap(TEXTURE2D_PASS(unity_Lightmap, samplerunity_Lightmap),
TEXTURE2D_PASS(unity_LightmapInd, samplerunity_Lightmap),
uvStaticLightmap, unity_LightmapST);
uvStaticLightmap, unity_LightmapST, normalWS);
#else
bakeDiffuseLighting += SampleSingleLightmap(TEXTURE2D_PASS(unity_Lightmap, samplerunity_Lightmap), uvStaticLightmap, unity_LightmapST);
#endif

#ifdef DIRLIGHTMAP_COMBINED
bakeDiffuseLighting += SampleDirectionalLightmap(TEXTURE2D_PASS(unity_DynamicLightmap, samplerunity_DynamicLightmap),
TEXTURE2D_PASS(unity_DynamicDirectionality, samplerunity_DynamicLightmap),
uvDynamicLightmap, unity_DynamicLightmapST);
uvDynamicLightmap, unity_DynamicLightmapST, normalWS);
#else
bakeDiffuseLighting += SampleSingleLightmap(TEXTURE2D_PASS(unity_DynamicLightmap, samplerunity_DynamicLightmap), uvDynamicLightmap, unity_DynamicLightmapST);
#endif

builtinData.distortion = float2(0.0, 0.0);
builtinData.distortionBlur = 0.0;
}
}

1001
Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
文件差异内容过多而无法显示
查看文件

8
Assets/TestScenes/HDTest/GlobalIlluminationTest.unity.meta


fileFormatVersion: 2
guid: b9e9391dee8ab62499f562ee51dc4e4d
timeCreated: 1478514554
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存