panoshader demo version 2.0
(Cg Implementation)Program code contributors:
Siu-Hang Or
Chi-Wing Fu
Tien-Tsin Wong
Dan WeiIntroduction
- This program demonstrates the ability to perform real-time dynamic lighting on highly compressed panoramic images. This kind of relightable (illumination-adjustable) panorama is especially useful for representing large-scale complex backgrounds in computer games. The real-time relighting is implemented by writing shaders on programmable graphics hardware.
- An image-based scene, "forbid" (less than 3MB in size), comes with this demo. There are three programs, one for directional-source relighting, one for point-source relighting, and the other is for relighting with slide projection. In all cases, the same data set "forbid" is loaded. To demonstrate the real-time performance, the light sources change in color, direction or position during the run-time.
This program is now in version 2.0. This version is implemented with Cg, in contrast to the low-level shading language in version 1.0. Since Cg is equivalent to HLSL of DirectX 9, this program can be easily ported to DirectX.
System Requirement
- Hardware: Pentium III or above, 128MB RAM, installed with nVidia GeForce FX graphics accelerator.
- OS: Windows 98/NT/2000/XP, with OpenGL
Installation Instruction
- (1) Download panoshader2
(2) Unzip the panoshader2 into a subdirectory, say panoshader2
(3) Run one of the three demos:
- - dir.exe (for directional-source relighting)
- pt.exe (for point-source relighting)
- slide.exe (for relighting with slide projector)
User Manual
Directional-source relighting:
Start "dir.exe" to run the demo. Once the program is started, a directional light source moves around and illuminates the scene forever. It changes its color from time to time.
Drag inside the window to accelerate the change of illumination.
Press "a" or "A" to pause/resume the change of illumination.
Press "p" or "P" to test performance in frame rate on your machine
Press "q" or "Q" or escape to quit the demo.
Point-source relighting:
Start "pt.exe" to run the demo. Once the program is started, a point light source moves around in the scene and illuminates the scene with changing color and intensity. It follows the animation script defined in "animation.txt". Inappropriate modification to this script file may cause program fault.
Press "a" or "A" to pause/resume the change of illumination.
Press "p" or "P" to test performance in frame rate on your machine
Press "q" or "Q" or escape to quit the demo.
Slide Projection:
Start "slide.exe" to run the demo. Once the program is started, a slide projector moves around in the scene and illuminates the scene with changing color and intensity. It follows the animation script defined in "slidepjanimation.txt" and projects the slide in "slide.bmp". Inappropriate modification to this script file may cause program fault.
Press "a" or "A" to pause/resume the change of illumination.
Press "p" or "P" to test performance in frame rate on your machine
Press "q" or "Q" or escape to quit the demo.
Related Publication
- " Real-Time Relighting of Compressed Panoramas",
T. T. Wong, S. H. Or and C. W. Fu,
Graphics Programming Methods, Edited by J. Lander, Charles River Media, 2003, pp. 375-288.
- " Interactive Relighting of Panoramas",
T. T. Wong, C. W. Fu and P. A. Heng,
IEEE Computer Graphics & Applications, Vol. 21, No. 2, March-April 2001, pp. 32-41.
- " Image-based Rendering with Controllable Illumination",
T. T. Wong, P. A. Heng, S. H. Or and W. Y. Ng,
in Proceedings of the 8-th Eurographics Workshop on Rendering (Rendering Techniques'97), St. Etienne, France, June 1997, pp. 13-22.
Contact Person