Search Blogs AGI.com Blogs

Collada FX shaders for Insight3D

By: sclaypoole
COLLADA FX is an effects framework for COLLADA (an open XML-based 3D model format) that allows you to manipulate the state of the graphics library (in AGI's case OpenGL), and to write programs that will execute on the graphics card for each vertex and each pixel. It also allows for multi-pass rendering techniques and texture render targets. Shaders are programs that execute on the graphics card. ColladaFX supports two types: vertex shaders and fragment shaders. The vertex shader is executed on each vertex and allows you to manipulate per-vertex data such as the position or color. The fragment shader is executed on each pixel and allows the user to manipulate the pixel’s color and depth, or discard it completely. Within these shaders, STK and Insight3D provide access to some useful information such as the position of the Sun, the current animation time and how to transform points between different coordinate systems. Probably the most common use of shaders is performing per-pixel lighting. This means that lighting calculations are done for each pixel. Previously all models were lit per vertex, which could cause artifacts if the mesh contained large primitives (e.g. triangles). The vertices were lit and that value was interpolated to calculate lighting for the rest of the primitive. In the figure below, you can see how much smoother the shadow line is in the per-pixel lit missile nose cone. Learn more about how Collada FX can enhance your Insight3D or STK graphics in our online InView magazine.
Posted: 6/22/2011 3:26:04 PM


Tags