Add overexposure effect

pull/281/head
James H Ball 2025-02-02 21:10:02 +00:00
rodzic 6a900b1f6a
commit 7aa3ed203b
3 zmienionych plików z 33 dodań i 1 usunięć

Wyświetl plik

@ -7,6 +7,7 @@ uniform sampler2D uTexture3; //screen
uniform sampler2D uTexture4; //reflection
uniform sampler2D uTexture5; //screen glow
uniform float uExposure;
uniform float uOverexposure;
uniform float uLineSaturation;
uniform float uScreenSaturation;
uniform float uNoise;
@ -76,7 +77,7 @@ void main() {
light += uGlow * 0.3 * scatter.g * (2.0 + 1.0 * screen.g + 0.5 * screen.r);
float tlight = 1.0-pow(2.0, -uExposure*light);
float tlight2 = tlight * tlight * tlight;
gl_FragColor.rgb = mix(uColour, vec3(1.0), 0.3+tlight2*tlight2*0.5) * tlight;
gl_FragColor.rgb = mix(uColour, vec3(1.0), 0.3+tlight2*tlight2*uOverexposure) * tlight;
gl_FragColor.rgb = desaturate(gl_FragColor.rgb, 1.0 - uLineSaturation);
if (uRealScreen > 0.5) {
// this isn't how light works, but it looks cool

Wyświetl plik

@ -1176,9 +1176,17 @@ void VisualiserComponent::drawCRT() {
#if SOSCI_FEATURES
outputShader->setUniform("uScreenSaturation", (float) settings.getScreenSaturation());
outputShader->setUniform("uHueShift", (float) settings.getScreenHue() / 360.0f);
<<<<<<< Updated upstream
#else
outputShader->setUniform("uScreenSaturation", 1.0f);
outputShader->setUniform("uHueShift", 0.0f);
=======
outputShader->setUniform("uOverexposure", (float) settings.getOverexposure());
#else
outputShader->setUniform("uScreenSaturation", 1.0f);
outputShader->setUniform("uHueShift", 0.0f);
outputShader->setUniform("uOverexposure", 0.5f);
>>>>>>> Stashed changes
#endif
outputShader->setUniform("uNoise", (float) settings.getNoise());
outputShader->setUniform("uRandom", juce::Random::getSystemRandom().nextFloat());

Wyświetl plik

@ -120,6 +120,17 @@ public:
"Controls how quickly the image disappears after glowing brightly. Closely related to persistence.",
"afterglow",
VERSION_HINT, 1.5, 0.0, 5.0
<<<<<<< Updated upstream
=======
)
);
std::shared_ptr<Effect> overexposureEffect = std::make_shared<Effect>(
new EffectParameter(
"Overexposure",
"Controls at which point the line becomes overexposed and clips, turning white.",
"overexposure",
VERSION_HINT, 0.5, 0.0, 1.0
>>>>>>> Stashed changes
)
);
std::shared_ptr<StereoEffect> stereoEffectApplication = std::make_shared<StereoEffect>();
@ -275,6 +286,10 @@ public:
afterglowEffect,
screenSaturationEffect,
screenHueEffect,
<<<<<<< Updated upstream
=======
overexposureEffect,
>>>>>>> Stashed changes
#endif
};
std::vector<std::shared_ptr<Effect>> audioEffects = {
@ -369,6 +384,10 @@ public:
return parameters.afterglowEffect->getActualValue();
}
double getOverexposure() {
return parameters.overexposureEffect->getActualValue();
}
bool isFlippedVertical() {
return parameters.flipVertical->getBoolValue();
}
@ -445,6 +464,10 @@ private:
std::make_shared<EffectComponent>(*parameters.glowEffect),
#if SOSCI_FEATURES
std::make_shared<EffectComponent>(*parameters.afterglowEffect),
<<<<<<< Updated upstream
=======
std::make_shared<EffectComponent>(*parameters.overexposureEffect),
>>>>>>> Stashed changes
#else
std::make_shared<EffectComponent>(*parameters.ambientEffect),
#endif