|
|
|
|
|
|
|
|
|
|
public class BuiltinSkyParameters |
|
|
|
{ |
|
|
|
public Matrix4x4 viewProjMatrix; |
|
|
|
public Matrix4x4 invViewProjMatrix; |
|
|
|
public Vector4 screenSize; |
|
|
|
public Mesh skyMesh; |
|
|
|
public RenderLoop renderLoop; |
|
|
|
public Light sunLight; |
|
|
|
public Matrix4x4 viewProjMatrix; |
|
|
|
public Matrix4x4 invViewProjMatrix; |
|
|
|
public Vector4 screenSize; |
|
|
|
public Mesh skyMesh; |
|
|
|
public RenderLoop renderLoop; |
|
|
|
public Light sunLight; |
|
|
|
public RenderTargetIdentifier colorBuffer; |
|
|
|
public RenderTargetIdentifier depthBuffer; |
|
|
|
} |
|
|
|
|
|
|
|
public class SkyManager |
|
|
|
|
|
|
builtinParams.viewProjMatrix = m_faceCameraViewProjectionMatrix[i]; |
|
|
|
builtinParams.screenSize = m_CubemapScreenSize; |
|
|
|
builtinParams.skyMesh = m_CubemapFaceMesh[i]; |
|
|
|
builtinParams.colorBuffer = target; |
|
|
|
builtinParams.depthBuffer = new RenderTargetIdentifier(); |
|
|
|
m_Renderer.RenderSky(builtinParams, skyParameters); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
m_BuiltinParameters.viewProjMatrix = camera.viewProjectionMatrix; |
|
|
|
m_BuiltinParameters.screenSize = camera.screenSize; |
|
|
|
m_BuiltinParameters.skyMesh = BuildSkyMesh(camera.camera.GetComponent<Transform>().position, m_BuiltinParameters.invViewProjMatrix, false); |
|
|
|
m_BuiltinParameters.colorBuffer = colorBuffer; |
|
|
|
m_BuiltinParameters.depthBuffer = depthBuffer; |
|
|
|
|
|
|
|
Utilities.SetRenderTarget(renderLoop, colorBuffer, depthBuffer); |
|
|
|
m_Renderer.RenderSky(m_BuiltinParameters, skyParameters); |
|
|
|