Go to the source code of this file.
\file vmdsphere.frag \brief VMD OpenGL fragment shader implementing a ray-cast sphere primitive with per-pixel lighting, phong highlights, etc. The sphere is drawn within the confines of a correctly transformed bounding cube or viewer-aligned billboard. Much of the shading code is shared with the main VMD fragment shader, with a few optimizations that simplify the sphere shader due to the way it is specifically known to be used within VMD. Certain texturing modes can't actually occur in practice, so the shader can be simplified relative to what the main fragment shader must implement. VMD shaders require GLSL version 1.10 (or later) for minimum features XXX If/when we implement usage of ARB_sample_shading for antialiasing of the sphere shader, we will have to crank the GLSL fragment shader version to 130. macro to enable one-sided spheres for improved speed.
Definition at line 38 of file vmdsphere.frag.
VMD Sphere Fragment Shader (not for normal geometry).
Definition at line 93 of file vmdsphere.frag.
References dot, oglcolor, rayorigin, spherepos, sphereradsq, V, vmdfogmode, vmdlight0, vmdlight0H, vmdlight1, vmdlight1H, vmdlight2, vmdlight2H, vmdlight3, vmdlight3H, vmdlightscale, vmdmaterial, vmdopacity, vmdoutline, vmdoutlinewidth, vmdprojectionmode, vmdprojparms, vmdtex0, vmdtexturemode, and vmdtransmode.
interpolated color from the vertex shader.
Definition at line 44 of file vmdsphere.frag.
Referenced by main.
VMD light on/off state for all 4 VMD lights, represented as a scaling constant. Could be done with on/off flags but ATI doesn't deal well with branching constructs, so this value is simply multiplied by the light's contribution. Hacky, but it works for now.
Definition at line 60 of file vmdsphere.frag.
Referenced by main.
VMD material properties [0] is ambient (white ambient light only) [1] is diffuse [2] is specular [3] is shininess.
Definition at line 67 of file vmdsphere.frag.
Referenced by main.
VMD projection parameters [0] is nearClip [1] is farClip [2] is 0.5 * (farClip + nearClip) [3] is 1.0 / (farClip - nearClip).
Definition at line 74 of file vmdsphere.frag.
Referenced by main.
VMD texture mode 0=off 1=modulate 2=replace.
Definition at line 86 of file vmdsphere.frag.
Referenced by main.