Coder Social home page Coder Social logo

dlubal-software / osgpairo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robertosfield/osgpairo

0.0 0.0 0.0 515 KB

A OpenSceneGraph NodeKit, that merges osgPango and osgCairo, that wrap Pangocairo for usage in OpenSceneGraph

License: Other

CMake 4.99% C++ 92.42% HTML 0.04% Shell 2.54%

osgpairo's Introduction

Introduction

osgPairo is a NodeKit for OpenSceneGraph for high quality font rendering that combines the osgPango and osgCairo NodeKits into a single NodeKitt to make it easier to integrate with applications, including ones that use other versions of osgPango and osgCairo.

Technical

osgPairo renders fonts using the following setup:

  • A variable number of "layers" (textures) are allocated, per-font, that will eventually ALL be combined on a textured quad to form the final resultant glyph. You could think of this as a kind of osgPPU pipeline, if you're familiar with that fantastic nodekit. :)
  • Each layer is drawn to using a polymorphic API and the Cairo library. The overridden method in your subclass can do virtually ANYTHING with ANY layer, and for demonstration some standard font effects are provided: shadows, outlines, bitmap fills, etc.
  • Each layer is packed into an array that is fed to the current state, along with a global alpha value and a color value (per-layer) that can either be ignored--if your layers include color data--or instead blended with the alpha value provided in the texture; in fact, this is the most common osgPairo usage: the GL_ALPHA texture drawn by Cairo is modulated by a color value specified in Pango markup to produce the final color.
  • Finally, a GLSL shader comes along and does the final compositing. Code is provided inside of osgPairo to help you generate these shaders (or, preferably, just use the ones we provide!), but you're welcome to "roll your own" as well.

Videos

And finally, we have a (somewhat older) video of osgPairo + osgAnimation demonstrating the VERY IMPORTANT fact that each glyph and its associated quad are readily available to the user for direct, immediate manipulation.

VIDEO-001 (YouTube)

Building

OSG, and you'll also need one of these:

64bit GTK+ Libs

32bit GTK+ Libs

Authors

Author Contact Contributions...
Jeremy Moles [email protected] Lead hacker/developer
Jaromir Vitek [email protected] Professional hacking
Cedric Pinson [email protected] library exercise and the creation of the osgAnimation video
Serge Lages [email protected] Bug fixes
Sergey Kurdakov [email protected] Bug fixes
Robert Osfeild [email protected] Feature additions, Merge into osgPairo Build improvements

TODO

  • Add Glyph loading from images/metadata; ESPECIALLY DISTANCE FIELD TEXT!
  • Add the ability to dump the caches in one large PNG, instead of a bunch of pngs. This should be a "developer debug" image.
  • Add a wrapper around having to use <span> all the time; perhaps a kind of ostream<< clone.

osgpairo's People

Contributors

cubicool avatar robertosfield avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.