示例#1
0
        private static void DrawMesh(RMesh m, Camera camera, RSkeleton skeleton, Shader currentShader, string previousMaterialName, GenericMaterial previousUniforms)
        {
            if (m.Material != null && m.Material.Name != previousMaterialName)
            {
                m.SetMaterialUniforms(currentShader, previousUniforms);
                m.RenderMesh.SetRenderState(m.Material);
            }

            m.Draw(currentShader, camera, skeleton);
        }
示例#2
0
        private static void DrawMesh(RMesh m, RSkeleton skeleton, Shader currentShader, RMaterial previousMaterial)
        {
            // Check if the uniform values have already been set for this shader.
            if (previousMaterial == null || (m.Material != null && m.Material.MaterialLabel != previousMaterial.MaterialLabel))
            {
                m.Material.SetMaterialUniforms(currentShader, previousMaterial);
                m.Material.SetRenderState();
            }

            m.Draw(currentShader, skeleton);
        }
示例#3
0
        public static void DrawMesh(RMesh m, RSkeleton?skeleton, Shader currentShader, RMaterial?previousMaterial, UniformBlock?boneUniformBuffer, RSkeleton?previousSkeleton)
        {
            // Check if the uniform values have already been set for this shader.
            if (previousMaterial == null || (m.Material != null && m.Material.MaterialLabel != previousMaterial.MaterialLabel))
            {
                m.Material?.SetMaterialUniforms(currentShader, previousMaterial);
                m.Material?.SetRenderState(previousMaterial);
            }

            if (skeleton != null && skeleton != previousSkeleton)
            {
                var boneBinds = skeleton.GetAnimationTransforms();
                boneUniformBuffer?.SetValues("transforms", boneBinds);
            }

            m.Draw(currentShader, skeleton);
        }
示例#4
0
        private static void DrawMesh(Camera Camera, RSkeleton Skeleton, Shader currentShader, string previousMaterialName, RMesh m)
        {
            if (m.Material != null && m.Material.Name != previousMaterialName)
            {
                m.SetMaterialUniforms(currentShader);
                m.RenderMesh.SetRenderState(m.Material);
            }

            m.Draw(currentShader, Camera, Skeleton);
        }