Skip to content

Commit

Permalink
Added all the other chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Riccio committed Jul 14, 2012
1 parent ec29e9a commit 0d26944
Show file tree
Hide file tree
Showing 2,900 changed files with 1,897,698 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Chapter 12 2D Shape Rendering by Distance Fields/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
The C code and the GLSL code for the OpenGL demo is public
domain code. The distance transform code in the console
application to create distance field textures, located in
the file "edtaa3func.c", is MIT licensed, and free to use
under the following conditions.

----

Copyright (C) 2011 by Stefan Gustavson
([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

----
46 changes: 46 additions & 0 deletions Chapter 12 2D Shape Rendering by Distance Fields/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
This is a demo program for the chapter "Contour Rendering
by Distance Fields" for the book "OpenGL Insights" published
by AK Peters in 2012. The book is copyrighted works subject
to its own license from the publisher, but this source code
is open and free, distributed in part as public domain code
and in part under the MIT license.
See LICENSE.txt for details.

Makefiles for GCC are included. Type "make" for instructions.
Both the code and the Makefile were designed to work under
Windows, MacOS X and Linux without changes, but the Makefile
was written for GNU Make and GCC, even under Windows. If you
want to use a different compiler or a different build system,
you are on your own.

Compilation requires the free GLFW library. A GCC library
archive file "libglfw.a" is distributed with the source, as
allowed by the GLFW license. For details on GLFW, see
http://http://www.glfw.org.

When running the program, press the number keys '1' through '4'
to switch between different shaders. Shader 1 is the main demo
showing the contour. Shader 2 displays the original grayscale
alpha image that was used to generate the distance field. Shader
3 is a composite of the two, to investigate details of the
rendering method. Shader 4 uses a standard bilinear interpolation
of the grayscale alpha texture followed by a thresholding, to
compare this method to the one that is still prevalent in
real time applications. Switch between 1 and 4 to see what
difference the distance field approach makes. Note that the
two shaders use similar amounts of data and involve similar
amounts of computations. The increase in quality comes
at little or no extra cost in resources or performance.
Note in particular the analytic anisotropic anti-aliasing at
grazing angles, with no unnecessary blurring regardless of
aspect ratio or viewing angle.

The view can be manipulated by the mouse. Drag to move,
shift-drag to zoom and ctrl-drag to rotate.

The texture creation tool "makedist" is a console application
with an old school command-line interface. You need to bring
up the console even under MacOS X.

----
Stefan Gustavson ([email protected]), 2012-06-12
Loading

0 comments on commit 0d26944

Please sign in to comment.