From 8f1e73eb6a7adce5fa8dd07a51a8b4fb1f090138 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Mon, 29 May 2023 17:50:19 +0200 Subject: [PATCH] pass shader to font --- src/GPUFontAtlasLayerCombo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GPUFontAtlasLayerCombo.cpp b/src/GPUFontAtlasLayerCombo.cpp index de91a0c..b31fb8f 100644 --- a/src/GPUFontAtlasLayerCombo.cpp +++ b/src/GPUFontAtlasLayerCombo.cpp @@ -27,8 +27,10 @@ void GPUFontAtlasLayerCombo::setup(const ComboIdentifier & identifier, if(this->settings.bufferTargetType == GL_TEXTURE_2D_ARRAY){ fontShader = shaderCatalog->get("font_ta"); }else if(this->settings.bufferTargetType == GL_UNIFORM_BUFFER){ + shaderCatalog->setReplacement("{{CURVES_BUFFER_SIZE}}", "2048"); fontShader = shaderCatalog->get("font_ub"); } + fontShaderProgram = fontShader->program; { FT_Error error = FT_Init_FreeType(&library); @@ -40,6 +42,7 @@ void GPUFontAtlasLayerCombo::setup(const ComboIdentifier & identifier, ofxGPUFont::initializeFont(library, this->identifier.fontPath, font, + fontShaderProgram, this->settings.bufferTargetType); font->listFontVariationAxes(fontVariationAxesParameters, library); @@ -97,6 +100,8 @@ void GPUFontAtlasLayerCombo::update(){ variationText = std::move(_variationText); font->prepareGlyphsForText(variationText, library, + shaderCatalog, + fontShader, true); isDirty = false; }