|
|
|
|
|
|
RenderTexture.active = renderData.renderTexture; |
|
|
|
GL.Clear(true, true, Color.black); |
|
|
|
Graphics.Blit(Texture2D.whiteTexture, renderData.renderTexture, m_SceneResources.checkerboardMaterial); |
|
|
|
var mesh = (renderData == masterRenderData && m_Graph.previewData.mesh) ? m_Graph.previewData.mesh : m_SceneResources.sphere; |
|
|
|
var mesh = (renderData == masterRenderData && m_Graph.previewData.serializedMesh.mesh) ? m_Graph.previewData.serializedMesh.mesh : m_SceneResources.sphere; |
|
|
|
Graphics.DrawMesh(mesh, Matrix4x4.TRS(-mesh.bounds.center, rotation, Vector3.one * scale), m_PreviewMaterial, 1, m_SceneResources.camera, 0, m_PreviewPropertyBlock, ShadowCastingMode.Off, false, null, false); |
|
|
|
Matrix4x4 previewTransform = Matrix4x4.identity; |
|
|
|
|
|
|
|
if (renderData == masterRenderData) |
|
|
|
{ |
|
|
|
previewTransform *= Matrix4x4.Rotate(rotation); |
|
|
|
previewTransform *= Matrix4x4.Scale(Vector3.one * scale * .75f / mesh.bounds.extents.magnitude); |
|
|
|
previewTransform *= Matrix4x4.Translate(-mesh.bounds.center); |
|
|
|
} |
|
|
|
|
|
|
|
Graphics.DrawMesh(mesh, previewTransform, m_PreviewMaterial, 1, m_SceneResources.camera, 0, m_PreviewPropertyBlock, ShadowCastingMode.Off, false, null, false); |
|
|
|
|
|
|
|
var previousUseSRP = Unsupported.useScriptableRenderPipeline; |
|
|
|
Unsupported.useScriptableRenderPipeline = renderData.shaderData.node is IMasterNode; |
|
|
|
m_SceneResources.camera.Render(); |
|
|
|