Menu

Tree [r3] /
 History

HTTPS access


File Date Author Commit
 example 2008-07-06 rnbader [r3] Improved shader loading to be less path dependent
 include 2008-07-06 rnbader [r3] Improved shader loading to be less path dependent
 license.txt 2008-07-03 rnbader [r1] NPRER v.1 Initial Commit
 readme.txt 2008-07-05 rnbader [r2]

Read Me

ReadMe

TOC
1. NPRER
1.1 NPRER model
2. NPRER Plugins
2.1 Cel Renderer
2.2 Pencil Renderer
3. Dependencies

1. NPRER

The NPR Effects Renderer is a rendering framework designed to simplify the use of shaders in an multiple pass openGL application.  More complicated renderers can be implemented as inherited classes which act as plugins for a program using a renderer.  

1.1 NPRER model
The NPRER model assumes the following render process:

1.set up stage: initialize projection matrix, and modelview matrix using basic camera transformation (i.e. gluLookAt)
2.pre-draw stage: call renderer's pre-draw, set any uniform parameters
3.draw stage: for each mesh, alter modelview matrix, call appropriate renderer function on mesh
4.post-draw stage: any final rendering steps
5.swap buffers

TODO: add a complete set of basic draw/texture/light/etc functionality

2. NPRER Plugins

A plugin is an inherited renderer that requires some additional input over a base renderer.  The most basic plugin will only overload the init() function to load it's own programs and parameters (see Cel Renderer).  More advanced plugins will overload more functions in order to set more parameters or do more pre/post draw processing (see Pencil Renderer).

2.1 Cel Renderer

The Cel Renderer is the most basic renderer plugin, consisting of an overloaded init() function, and 2 corresponding shaders.  After loading the programs, the cel init function adds the projection and light variables to the tracking lists, and creates a texture parameter set for the cel map.  Using this plugin requires loading a cel map to the renderer.

2.2 Pencil Renderer

The Pencil Renderer is a more advanced renderer plugin, overloading several functions, and adding a few of its own.  In addition to it's overloaded init() function, the pencil renderer also overloads the pre/post draw functions, enabling a set of intermediary buffers for the output from the pencil shaders, which is used in the post-draw function to run an edge enhancement shader, adding contour lines to the final output.  Additionally, the overloaded draw functions allow pre-transformation of the normals, and stroke-angle calculations to be passed in to the shader, which are necessary to create the contoured stroke effect.  Additionally, the setTexture and initWindow fumctions are overloaded to call the setDimensions function upon any update.

3. Dependencies

NPRER requires cg and glew to work.

Copyright 2008 Robert Bader
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.