浏览代码

skybox cleanup

/main
vlad-andreev 8 年前
当前提交
1e9b2021
共有 1 个文件被更改,包括 3 次插入12 次删除
  1. 15
      Assets/ScriptableRenderLoop/common/SkyboxHelper.cs

15
Assets/ScriptableRenderLoop/common/SkyboxHelper.cs


CommandBuffer cmd = new CommandBuffer();
cmd.name = "Skybox";
Light sunLight = RenderSettings.sun;
Color sunColor = new Color(0, 0, 0);
Vector3 sunDir = new Vector3(0, 0, -1);
Material mat = RenderSettings.skybox;
if (sunLight != null)
if (mat == null)
sunColor = sunLight.color;
Transform xform = sunLight.transform;
sunDir = xform.TransformDirection(sunDir);
return;
Material mat = RenderSettings.skybox;
bool looksLikeSixSidedShader = true;
looksLikeSixSidedShader &= (mat.passCount == 6); // should have six passes

{
CreateMesh();
}
cmd.SetGlobalVector("_LightColor0", sunColor);
cmd.SetGlobalVector("_WorldSpaceLightPos0", sunDir);
float dist = camera.farClipPlane * 10.0f;

正在加载...
取消
保存