This project orginated from MSU's Computer Science Senior Capstone Project. An SVT is a high resolution mip-mapped image format that efficiently lays out data on hard disk. This application was written in C++ and OpenGL using OpenSceneGraph (OSG).
Our plug-in reads in an XML file that defines geo-coordinate locations for each SVT supplied as well as embedded shader code that allows each XML to blend textures in a custom configuration.
In this project, I designed the classes required in order to extend the existing functionality. I worked with another team member to write the shader code that applies these textures to arbitrary objects. Our implementation requires a pre-render image for each SVT, supplied by the XML, in order to ascertain which texture coordinates are visible to the viewer. I wrote the shader code to do this by leveraging multi-sampling capabilities and rendered these samples into a frame buffer object to be processed by the CPU.
Embedded shader code is a powerful tool provided by this software and I designed its implementation. When embedded shader code is detected, preprocessor commands are used to compile a separate version of the shader to optimize performance. In this version, I defined an array of texture coordinates populated with correct information before the function call containing custom shader code. This array is then available in the custom shader code through TEXCOORDS and can use the supplied macro TEXTURES(i) to sample the i-th texture using the i-th texture coordinate.
Writing portable GLSL code is a challenge because Nvidia graphics cards support Cg and properly interpret deprecated commands whereas ATI's compiler is very strict about precision and use of deprecated commands. I did the extra work to test on both platforms and insure portability between either graphics card hardware.
This project received the 2010 Chrysler Praxis Award, which is presented to the most technical computer science project.
View project video here