Ejemplo n.º 1
0
        public void Render(ScriptableRenderContext renderContext, HDCamera camera, CommandBuffer cmd)
        {
            if (m_DecalMesh == null)
            {
                m_DecalMesh = CoreUtils.CreateCubeMesh(new Vector3(-0.5f, -1.0f, -0.5f), new Vector3(0.5f, 0.0f, 0.5f));
            }

            for (int resultIndex = 0; resultIndex < m_NumResults; resultIndex++)
            {
                int decalIndex = m_ResultIndices[resultIndex];

                // If no decal material assigned, don't draw it
                if (m_Decals[decalIndex].m_Material == null)
                {
                    continue;
                }

                // don't draw decals that do not have textures assigned
                if (!m_Decals[decalIndex].m_Material.GetTexture("_BaseColorMap") && !m_Decals[decalIndex].m_Material.GetTexture("_NormalMap") &&
                    !m_Decals[decalIndex].m_Material.GetTexture("_MaskMap"))
                {
                    continue;
                }

                m_Decals[decalIndex].UpdatePropertyBlock(camera.cameraPos);
                cmd.DrawMesh(m_DecalMesh, m_Decals[decalIndex].transform.localToWorldMatrix, m_Decals[decalIndex].m_Material, 0, 0,
                             m_Decals[decalIndex].GetPropertyBlock());
            }
        }
Ejemplo n.º 2
0
        public void Render(ScriptableRenderContext renderContext, HDCamera camera, CommandBuffer cmd)
        {
            if (m_DecalMesh == null)
            {
                m_DecalMesh = CoreUtils.CreateCubeMesh(kMin, kMax);
            }

            foreach (var pair in m_DecalSets)
            {
                pair.Value.Render(renderContext, camera, cmd);
            }
        }
Ejemplo n.º 3
0
        public void RenderIntoDBuffer(CommandBuffer cmd)
        {
            if (m_DecalMesh == null)
            {
                m_DecalMesh = CoreUtils.CreateCubeMesh(kMin, kMax);
            }

            foreach (var decalSet in m_DecalSetsRenderList)
            {
                decalSet.RenderIntoDBuffer(cmd);
            }
        }
Ejemplo n.º 4
0
        public void RenderIntoDBuffer(CommandBuffer cmd)
        {
            if (m_DecalMesh == null)
            {
                m_DecalMesh = CoreUtils.CreateCubeMesh(kMin, kMax);
            }

            foreach (var pair in m_DecalSets)
            {
                pair.Value.RenderIntoDBuffer(cmd);
            }
        }