350 likes | 478 Views
This report delves into the intricacies of sphere mapping using OpenGL, a project initiated in the summer of 1999. It presents approximately 25 pages focused on sphere maps, detailing techniques for creating maps from images (cubes) and explores advanced OpenGL code, including vendor-specific extensions like those from NVIDIA and SGI. The report discusses the challenges of projective textures, lighting setups, and various extensions enhancing visual realism in graphics. Ultimately, it examines how to effectively implement these technologies in practical applications while acknowledging limitations.
E N D
Christmas Break By Paul Zimmons
Anselmo’s Paper • Started from the Summer of 1999 • Destined to become a Tech Report • ~25 pages of just Sphere Maps • Conclusion: • “Sphere maps are cool but not that cool.”
OpenGL • Going through Advanced 97 codes, OpenGL extensions, and company demos • What can we use from these? • Apply to OFF
1997 Course Notes Code • Many good things • Making sphere map out of 6 images (cube) • Although I later found another way • Short projective texture demo • Not sure how applicable (shadows?) • Sphere map light source • Want a sphere map highlight at a certain direction • But as soon as you move your head it goes all over
Projective Texture Example Projtex.c: Projective textures are hard to control.
Just draw a mesh sphere with an OpenGL light at the right place. This should work with dual paraboloid maps too for a paraboloid highlight.
Extensions • Extensions are where its at • nVidia extensions are good • Extensions on SGI? Where? SGIS_?
nVidia Extensions • EXT_blend_subtract • C’ = (Cs * S) - (Cd * D), clamped to 0 • Ben’s stuff? • EXT_light_max_exponent • Makes Phong exponent very high • Diefenbach’s thesis: Phong -> BRDF
nVidia Extensions • EXT_paletted_textures • Color palette with texels containing indices • Quake, PSX uses these to reduce texture memory • Also why original Quake was so brown • Might be able to use in house (iffy)
nVidia Extensions • EXT_texture_cube_map • Not just a view independent low distortion mapping • More like a vector to vector lookup table • Many good things flow from here • EXT_filter_anisotropic • This is a good part of why distant roads are blurry in computer graphics
nVidia Extensions • EXT_vertex_weighting • Can associate two transform matrices to a single vertex • Could do something like Cohen’s 3D morph with EXT_vertex_weighting along a spline • NV_register_combiners • Can set options on texture (up to 4 texture inputs), color, and fog. Good but complicated.
nVidia Extensions • NV_texgen_reflection • Use raw (rx, ry, rz) eye-space reflected vector to index a map
Everybody Else • EXT_pixel_transform • PixelZoom-like but matrix applied to rasterizer • EXT_polygon_offset • Nudge depth buffer forward or back • Good for multipass without multitexture
More Extensions • EXT_fragment_lighting • Adds lighting stage to OpenGL • *The* mechanism for per-pixel lighting • Renderman in OpenGL would use this • PixelFusion is going to use this • EXT_multitexture • Multitexture
More Extensions • SGIX_depth_texture • For shadows • Adds RGBAZ • SGIX_pixel_texture • Color components -> texture components • RG(B) -> ST(U) • Wolfgang Heidrich wrote a whole paper on it! • Combing with env maps is key
Even More Extensions • SGI_cushion • Adds ‘cushion buffers’ to help achieve constant frame rate • Seems like it will start drawing next one if the earlier one finishes before vertical retrace • SGIX_shadow • Allows <=, => on R part of interpolated (S,T,R) per vertex (??? Confusing ???)
HP & WIN Extensions • HP_occlusion_test • Can find non-visibility of geometry based on whether boxing geometry is visible • Render and query if depth buffer changes • WIN_phong_shading • Phong shading per pixel
Vendor Demos • nVidia trounces them all • Check out BlendView utility (needs DX7) • Very good way to gain intuition • ATI has a simpler one for the TNT • Runs on NT • Very good way to gain intuition as well • Highlights dire need for multitexture (Quake)
Combiners • Combiners are even worse • EIGHT stages of blending • Can also do dot product (per pixel lighting anyone?)
Gloss Mapping • Modulate sphere map reflection with alpha of another texture • Good for house group! • glBlendFunc is KEY for this and general modulation effects • Originally from ATI (as far as I know)
glBlendFunc + Offset • For scuffs and colored glasses
What kind of FX? • Lights with shafts of light (through door) • Combing with animation for dust • Scuffs marks that affect a highlight • Grains in metals (brushed look) • Rough surfaces, grains • Wallpapers (different reflectances) • Marble (good when combined with reflect)
More FX • Refraction mapping • Wolfgang Heidrich invented that one • Slow on SGIs for a single polygon • Maybe in future could be used for planar glass simulation • SGI actually has a REFRACT texture generation mode (in gl.h)
Blend + Offset + Highlight • Plus reflection plus convolution plus view independent cube map plus bump map plus pixel textures plus scuffs… • The point is that the more realism you want, the more passes you need (at least for now)
Problem • How many textures can the IR combine at once (2?) • Kenny/Rui stuff uses no multitexture • GeForce can do 4 plus has funky combinings and texture generation modes • Next GeForce --> 8 textures at once??? • PixelFusion --> Programmable pixel shading (by July I think)
Idea • Create multipass versions for SGI • Try to see if single pass can be achieved on GeForce • Problem of texture memory • Need at *least* 64 megs • Highlight maps, bump maps all make it more • Palletized textures to the rescue?
What next? • HYR is the key to the next set of visual effects for these environments • Unfortunately, so are new extensinons :( • Supporting many types of mappings and passes • Like the current .atr/.fff idea but bigger • Still only an idea of HYR but something is there • Quake 3 Shader Manual
Bonus: Siggraph Paper • How to make images with alpha? • Start with an image that already has alpha • hurricane.tif • Import to Photoshop and alpha is another layer • From there it is EZ!
Bonus: Siggraph Paper • Making a Dual Paraboloid Map • Use GL_EXT_NORMAL_MAP and draw a mesh in the shape of the parabola • Normals are from center to mesh point • Then cube map… again EZ!
Converting • Cube map to Dual Paraboloid Map DP works on SGI too! Can do view independence on SGI!