kopia lustrzana https://github.com/jameshball/osci-render
Add overexposure effect
rodzic
6a900b1f6a
commit
7aa3ed203b
|
@ -7,6 +7,7 @@ uniform sampler2D uTexture3; //screen
|
||||||
uniform sampler2D uTexture4; //reflection
|
uniform sampler2D uTexture4; //reflection
|
||||||
uniform sampler2D uTexture5; //screen glow
|
uniform sampler2D uTexture5; //screen glow
|
||||||
uniform float uExposure;
|
uniform float uExposure;
|
||||||
|
uniform float uOverexposure;
|
||||||
uniform float uLineSaturation;
|
uniform float uLineSaturation;
|
||||||
uniform float uScreenSaturation;
|
uniform float uScreenSaturation;
|
||||||
uniform float uNoise;
|
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);
|
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 tlight = 1.0-pow(2.0, -uExposure*light);
|
||||||
float tlight2 = tlight * tlight * tlight;
|
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);
|
gl_FragColor.rgb = desaturate(gl_FragColor.rgb, 1.0 - uLineSaturation);
|
||||||
if (uRealScreen > 0.5) {
|
if (uRealScreen > 0.5) {
|
||||||
// this isn't how light works, but it looks cool
|
// this isn't how light works, but it looks cool
|
||||||
|
|
|
@ -1176,9 +1176,17 @@ void VisualiserComponent::drawCRT() {
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
outputShader->setUniform("uScreenSaturation", (float) settings.getScreenSaturation());
|
outputShader->setUniform("uScreenSaturation", (float) settings.getScreenSaturation());
|
||||||
outputShader->setUniform("uHueShift", (float) settings.getScreenHue() / 360.0f);
|
outputShader->setUniform("uHueShift", (float) settings.getScreenHue() / 360.0f);
|
||||||
|
<<<<<<< Updated upstream
|
||||||
#else
|
#else
|
||||||
outputShader->setUniform("uScreenSaturation", 1.0f);
|
outputShader->setUniform("uScreenSaturation", 1.0f);
|
||||||
outputShader->setUniform("uHueShift", 0.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
|
#endif
|
||||||
outputShader->setUniform("uNoise", (float) settings.getNoise());
|
outputShader->setUniform("uNoise", (float) settings.getNoise());
|
||||||
outputShader->setUniform("uRandom", juce::Random::getSystemRandom().nextFloat());
|
outputShader->setUniform("uRandom", juce::Random::getSystemRandom().nextFloat());
|
||||||
|
|
|
@ -120,6 +120,17 @@ public:
|
||||||
"Controls how quickly the image disappears after glowing brightly. Closely related to persistence.",
|
"Controls how quickly the image disappears after glowing brightly. Closely related to persistence.",
|
||||||
"afterglow",
|
"afterglow",
|
||||||
VERSION_HINT, 1.5, 0.0, 5.0
|
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>();
|
std::shared_ptr<StereoEffect> stereoEffectApplication = std::make_shared<StereoEffect>();
|
||||||
|
@ -275,6 +286,10 @@ public:
|
||||||
afterglowEffect,
|
afterglowEffect,
|
||||||
screenSaturationEffect,
|
screenSaturationEffect,
|
||||||
screenHueEffect,
|
screenHueEffect,
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
=======
|
||||||
|
overexposureEffect,
|
||||||
|
>>>>>>> Stashed changes
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
std::vector<std::shared_ptr<Effect>> audioEffects = {
|
std::vector<std::shared_ptr<Effect>> audioEffects = {
|
||||||
|
@ -368,6 +383,10 @@ public:
|
||||||
double getAfterglow() {
|
double getAfterglow() {
|
||||||
return parameters.afterglowEffect->getActualValue();
|
return parameters.afterglowEffect->getActualValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double getOverexposure() {
|
||||||
|
return parameters.overexposureEffect->getActualValue();
|
||||||
|
}
|
||||||
|
|
||||||
bool isFlippedVertical() {
|
bool isFlippedVertical() {
|
||||||
return parameters.flipVertical->getBoolValue();
|
return parameters.flipVertical->getBoolValue();
|
||||||
|
@ -445,6 +464,10 @@ private:
|
||||||
std::make_shared<EffectComponent>(*parameters.glowEffect),
|
std::make_shared<EffectComponent>(*parameters.glowEffect),
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
std::make_shared<EffectComponent>(*parameters.afterglowEffect),
|
std::make_shared<EffectComponent>(*parameters.afterglowEffect),
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
=======
|
||||||
|
std::make_shared<EffectComponent>(*parameters.overexposureEffect),
|
||||||
|
>>>>>>> Stashed changes
|
||||||
#else
|
#else
|
||||||
std::make_shared<EffectComponent>(*parameters.ambientEffect),
|
std::make_shared<EffectComponent>(*parameters.ambientEffect),
|
||||||
#endif
|
#endif
|
||||||
|
|
Ładowanie…
Reference in New Issue