feat(of): scene transition flash + glitch

Pour ponctuer les changements d'acte des demoparties, ajout
d'une transition punchy a chaque enterScene() :

- transitionFlash_ = 1.0 au debut, decay lineaire 0.45s
- Flash blanc plein ecran, alpha = 180 * t^2 (ease-out cubique)
- postfx_.triggerGlitch(0.7, 0.45) en parallele = block
  displacement RGB sur la meme duree
- Drawn entre la waveform circulaire et l'overlay narratif
  pour ne pas masquer le titre d'acte qui suit immediatement
This commit is contained in:
L'électron rare
2026-05-07 21:14:38 +02:00
parent d60dc11309
commit a7bbb9af02
2 changed files with 17 additions and 1 deletions
+16 -1
View File
@@ -495,9 +495,14 @@ void ofApp::enterScene(int idx) {
if (s.albumLetter) {
osc_.sendControl("/control/playAlbum", std::string(s.albumLetter));
}
// Transition punchy : flash blanc + glitch postfx 0.5s.
transitionFlash_ = 1.0f;
postfx_.triggerGlitch(0.7f, 0.45f);
}
void ofApp::updateNarrative(float dt) {
if (transitionFlash_ > 0.0f) transitionFlash_ -= dt / 0.45f;
if (transitionFlash_ < 0.0f) transitionFlash_ = 0.0f;
if (!narrativeMode_) return;
auto& scenes = demos_[currentDemo_].scenes;
if (narrativeIdx_ >= (int)scenes.size()) return;
@@ -773,7 +778,17 @@ void ofApp::drawScope4(int W, int H) {
// 6) Sine scroller — toggle 3 (synchronisé avec demo_.scrollerEnabled).
demo_.drawScroller(W, H);
// 7) Overlay narratif (titre acte + barre progression) si actif.
// 7) Flash de transition entre scènes (cosine ease-out 0.45s).
if (transitionFlash_ > 0.0f) {
ofPushStyle();
const float t = std::max(0.0f, std::min(1.0f, transitionFlash_));
const int alpha = static_cast<int>(180 * t * t); // ease square
ofSetColor(255, 240, 220, alpha);
ofDrawRectangle(0, 0, W, H);
ofPopStyle();
}
// 8) Overlay narratif (titre acte + barre progression) si actif.
drawNarrativeOverlay(W, H);
}
+1
View File
@@ -106,6 +106,7 @@ private:
int narrativeIdx_ = 0;
float narrativeT_ = 0.0f;
bool narrativeMode_ = false;
float transitionFlash_ = 0.0f; // 1.0 au début d'une scène, decay vers 0
void initDemos();
void launchDemo(int demoIdx);
void enterScene(int sceneIdx);