Comments (5)
just figure it out
#define _gltDrawText() \
glUseProgram(_gltText2DShader); \
\
glActiveTexture(GL_TEXTURE0); \
glBindTexture(GL_TEXTURE_2D, _gltText2DFontTexture); \
\
glUniformMatrix4fv(_gltText2DShaderMVPUniformLocation, 1, GL_FALSE, mvp); \
\
GLboolean last_enable_blend = glIsEnabled(GL_BLEND);\
glEnable(GL_BLEND);\
glBlendEquation(GL_FUNC_ADD);\
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\
\
glBindVertexArray(text->_vao); \
glDrawArrays(GL_TRIANGLES, 0, text->vertexCount); \
glBindVertexArray(0); \
\
if (last_enable_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND);
from gltext.
Currently you can change the text color with gltColor
. If you change the color, then it is only applied to the fill of the text, however changing the transparency would also affect the outline. Since the color is only multiplied with the font texels in the shader.
What is the exact use case? Do you simply want to be be able to apply different fill and outline colors?
I'll at least look into that in the near future, have a few other ideas I want to implement as well.
Sorry it took a month to respond, didn't realize my mail filtering meant I wouldn't get notifications.
from gltext.
Nice lib, and easy to use. Thanks.
But same here, just want the text background can set to transparent.
from gltext.
Thank you, trlsmax, nice method
from gltext.
@vallentin Any news on this?
from gltext.
Related Issues (16)
- Custom fonts? HOT 14
- Use of gltDrawText3D function HOT 1
- gltBeginDraw() declared but undefined HOT 1
- Text will not render HOT 4
- Monotype. HOT 1
- CMake sample for Ubuntu/Linux?
- Missing backslash as one of the characters
- Only Text Showing HOT 5
- Convert glyph outlined path to single line bezier path #12
- Support for umlauts HOT 2
- Support OpenGLES HOT 5
- Changing GLSL version to 1.30 with Intel HD 3000 renders only time depended text colors in flickering state using the simple.c example HOT 2
- how to change the text background color? HOT 1
- GLTtext E0135 has no member gltGetTextWidth & gltGetTextHeight HOT 1
- gltDrawText not drawing after set mvp matrix (model*view*perspective) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gltext.