MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #24250 All Revisions ] Back to Issue ]
Summary 0024250: TKOpenGl - per-pixel lighting using GLSL program (Phong shading)
Revision 2013-10-30 21:33 by kgv
Additional information
and documentation updates
Phong shading (or normal-interpolation shading) overcomes some of the disadvantages of Gouraud shading implemented in the fixed OpenGL rendering pipeline. This technique performs per-fragment light calculations within GLSL program. At each fragment the interpolated surface normal is used to evaluate light intensity. Interpolation of normal allows highlights smaller than a polygon (see attached picture).

The normal-interpolation shaders are implemented as part of OCCT visualization core (see Graphic3d_ShaderProgram::ShaderName enumeration). To enable per-fragment lighting computations the following DRAW command can be used:

vshaderprog [name] phong

To enable normal-interpolation shading in your application, see the source code of VShaderProg function (in TKViewerTest toolkit).

New command vdefaults provide the way to control automatic triangulation parameters (deflection value and absolute/relative mode).
Revision 2013-10-28 16:18 by dbp
Additional information
and documentation updates
Phong shading (or normal-interpolation shading) overcomes some of the disadvantages of Gouraud shading implemented in the fixed OpenGL rendering pipeline. This technique performs per-fragment light calculations using custom vertex and fragment shaders. At each fragment the interpolated surface normal is used to evaluate light intensity. Interpolation of normal allows highlights smaller than a polygon (see attached picture).

The normal-interpolation shaders are implemented as part of OCCT visualization core and available in 'Shaders' resource directory. To enable per-fragment lighting computations the following DRAW command can be used:

vshaderprog <ShapeName> phong

To enable normal-interpolation shading in your application, see the source code of VShaderProg function (in TKViewerTest toolkit).
Revision 2013-10-10 19:42 by dbp
Additional information
and documentation updates


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker