Open TronicLabs opened 9 years ago
For simple things (rect, rounded rect, circle) you can use gradients, for more complicated things, you can render to texture and spply blur/glow using a shader.
--mikko
Sent from my iPhone
On 19.6.2015, at 3.09, Marco notifications@github.com wrote:
Which method recommended to adopt a glow fx?
— Reply to this email directly or view it on GitHub.
when and if you have time, I like to have a small example of procedure to render to a texture and apply a shader with NVG. thanks for your attention.
Check out the FBO example, it shows how to render to texture.
Sent from my iPhone
On 19.6.2015, at 21.12, Marco notifications@github.com wrote:
when and if you have time, I like to have a small example of procedure to render to a texture and apply a shader with NVG. thanks for your attention.
— Reply to this email directly or view it on GitHub.
Geeks3D has some GLSL post process effect shader examples you can use once you're rendered to texture. Normally a Gaussian blur is a good effect to use.
I've created a project that can easily apply OpenGL filter to an existing texture. Currently there is only one Gaussian blur filter but may generate the effect you want. Check this out: https://github.com/ollix/glfc
A simple example
// Creates and renders to a FBO.
NVGLUframebuffer* fbo = nvgluCreateFramebuffer(vg, width * scale, height * scale);
glViewport(0, 0, width * scale, height * scale);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
nvgluBindFramebuffer(fbo);
nvgBeginFrame(vg, width, height, scale);
// Renders something.
nvgEndFrame(vg);
// Applies the Gaussian blur filter.
glfc::GaussianBlurFilter filter;
filter.Render(fbo->texture, width, height, scale);
nvgluBindFramebuffer(NULL);
olliwang thanks for the example...
Which method recommended to adopt a glow fx?