/// <summary> /// Creates a slot for storing a particular effect instantiation (per RenderObject). /// </summary> /// As an example, we could have main shader (automatically created), GBuffer shader and shadow mapping shader. /// <returns></returns> public EffectPermutationSlot CreateEffectPermutationSlot(string effectName) { // Allocate effect slot // TODO: Should we allow/support this to be called after Initialize()? int slot; if (!effectPermutationSlots.TryGetValue(effectName, out slot)) { if (effectPermutationSlots.Count >= 32) { throw new InvalidOperationException("Only 32 effect slots are currently allowed for meshes"); } slot = effectPermutationSlots.Count; effectPermutationSlots.Add(effectName, slot); // Add render effect slot RenderData.ChangeDataMultiplier(RenderEffectKey, EffectPermutationSlotCount); } return(new EffectPermutationSlot(slot)); }