Fix major intel graphics bug, and fix smoothing bugs

pull/287/head
James H Ball 2025-02-23 19:48:19 +00:00
rodzic 15f6a0ffbb
commit bcbf634ff7
5 zmienionych plików z 21 dodań i 10 usunięć

Wyświetl plik

@ -61,7 +61,7 @@ public:
VisualiserSettings visualiserSettings = VisualiserSettings(audioProcessor.visualiserParameters, 3); VisualiserSettings visualiserSettings = VisualiserSettings(audioProcessor.visualiserParameters, 3);
RecordingSettings recordingSettings = RecordingSettings(audioProcessor.recordingParameters); RecordingSettings recordingSettings = RecordingSettings(audioProcessor.recordingParameters);
SettingsWindow recordingSettingsWindow = SettingsWindow("Recording Settings", recordingSettings, 300, 320, 300, 320); SettingsWindow recordingSettingsWindow = SettingsWindow("Recording Settings", recordingSettings, 330, 320, 330, 320);
VisualiserComponent visualiser{ VisualiserComponent visualiser{
audioProcessor, audioProcessor,
#if SOSCI_FEATURES #if SOSCI_FEATURES

Wyświetl plik

@ -226,7 +226,7 @@ void OscirenderAudioProcessor::addLuaSlider() {
"Lua Slider " + sliderName, "Lua Slider " + sliderName,
"Controls the value of the Lua variable called slider_" + sliderName.toLowerCase() + ".", "Controls the value of the Lua variable called slider_" + sliderName.toLowerCase() + ".",
"lua" + sliderName, "lua" + sliderName,
VERSION_HINT, 0.0, 0.0, 1.0, 0.001, false VERSION_HINT, 0.0, 0.0, 1.0
) )
)); ));
} }

Wyświetl plik

@ -77,13 +77,13 @@ public:
"Trace Start", "Trace Start",
"Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.", "Defines how far into the frame the drawing is started at. This has the effect of 'tracing' out the image from a single dot when animated. By default, we start drawing from the beginning of the frame, so this value is 0.0.",
"traceStart", "traceStart",
VERSION_HINT, 0.0, 0.0, 1.0, 0.001, 0.001 VERSION_HINT, 0.0, 0.0, 1.0, 0.001
), ),
new EffectParameter( new EffectParameter(
"Trace Length", "Trace Length",
"Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.", "Defines how much of the frame is drawn per cycle. This has the effect of 'tracing' out the image from a single dot when animated. By default, we draw the whole frame, corresponding to a value of 1.0.",
"traceLength", "traceLength",
VERSION_HINT, 1.0, 0.0, 1.0, 0.001, 0.001 VERSION_HINT, 1.0, 0.0, 1.0, 0.001
), ),
} }
); );
@ -170,7 +170,7 @@ public:
"Image Stride", "Image Stride",
"Controls the spacing between pixels when drawing an image. Larger values mean more of the image can be drawn, but at a lower fidelity.", "Controls the spacing between pixels when drawing an image. Larger values mean more of the image can be drawn, but at a lower fidelity.",
"imageStride", "imageStride",
VERSION_HINT, 4, 1, 50, 1, false VERSION_HINT, 4, 1, 50, 1
) )
); );

Wyświetl plik

@ -448,7 +448,7 @@ public:
return lfoEnabled; return lfoEnabled;
} }
EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.0001, double smoothValueChange = SMOOTHING_SPEED_CONSTANT) : FloatParameter(name, id, versionHint, value, min, max, step), smoothValueChange(smoothValueChange), description(description) {} EffectParameter(juce::String name, juce::String description, juce::String id, int versionHint, float value, float min, float max, float step = 0.0001) : FloatParameter(name, id, versionHint, value, min, max, step), description(description) {}
private: private:
bool lfoEnabled = true; bool lfoEnabled = true;

Wyświetl plik

@ -901,6 +901,13 @@ Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID
float borderColor[] = { 0.0f, 0.0f, 0.0f, 1.0f }; float borderColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureID, 0);
glViewport(0, 0, width, height);
// Clear it once so we don't see uninitialized pixels
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, 0); // Unbind glBindTexture(GL_TEXTURE_2D, 0); // Unbind
return { textureID, width, height }; return { textureID, width, height };
@ -909,8 +916,12 @@ Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID
void VisualiserComponent::setResolution(int width) { void VisualiserComponent::setResolution(int width) {
using namespace juce::gl; using namespace juce::gl;
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
lineTexture = makeTexture(width, width, lineTexture.id); lineTexture = makeTexture(width, width, lineTexture.id);
renderTexture = makeTexture(width, width, renderTexture.id); renderTexture = makeTexture(width, width, renderTexture.id);
glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind
} }
void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) { void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {