// Chooses a suitable effect pass. See the list of available passes in the effect. private EffectPass GetPass(int numberOfSamples, ShadowCascadeSelection cascadeSelection, bool visualizeCascades) { if (visualizeCascades) { numberOfSamples = 32; // Only these passes support cascade visualization. } if (numberOfSamples < 0) { return(_effect.Techniques[0].Passes[(int)cascadeSelection]); } if (numberOfSamples == 0) { return(_effect.Techniques[0].Passes[3 + (int)cascadeSelection]); } if (numberOfSamples == 1) { return(_effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5]); } if (numberOfSamples <= 4) { return(_effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 1]); } if (numberOfSamples <= 8) { return(_effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 2]); } if (numberOfSamples <= 16) { return(_effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 3]); } return(_effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 4]); }
// Chooses a suitable effect pass. See the list of available passes in the effect. private EffectPass GetPass(int numberOfSamples, ShadowCascadeSelection cascadeSelection, bool visualizeCascades) { if (visualizeCascades) numberOfSamples = 32; // Only these passes support cascade visualization. if (numberOfSamples < 0) { return _effect.Techniques[0].Passes[(int)cascadeSelection]; } if (numberOfSamples == 0) { return _effect.Techniques[0].Passes[3 + (int)cascadeSelection]; } if (numberOfSamples == 1) { return _effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5]; } if (numberOfSamples <= 4) { return _effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 1]; } if (numberOfSamples <= 8) { return _effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 2]; } if (numberOfSamples <= 16) { return _effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 3]; } return _effect.Techniques[0].Passes[6 + (int)cascadeSelection * 5 + 4]; }