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); }
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); }
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); }
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); }