Shadows for alpha-masked polygons with limited hardware

Started by
3 comments, last by GameDev.net 19 years, 8 months ago
I'm trying to draw shadows for some texture-mapped polygons with alpha of either 0 or 1 at each pixel, which I'm using for trees, fences, etc. I read several tutorials on shadow mapping, and that sounds like it would work great, except that my graphics card doesn't support two required extensions, ARB_depth_texture and ARB_shadow. I know, I could get a better card - but I'm wondering whether there's any other approach I could try. Shadow volumes won't work, since some polygons are transparent, but perhaps there's something else. I'm willing to make a few compromises. Specifically, - I only need a single, directional light (the Sun). - I'm fine with only drawing shadows onto the terrain, rather than allowing self-shadowing and having different objects cast shadows on each other. My terrain is made of square tiles, all the same size, but not necessarily coplanar (it can have elevation). - My view will be sort of isometric, like an RTS, so I won't have too many objects in it at once. However, I would like the shadows to be re-calculated each frame, so I can have animation. One idea I have is to somehow render the visible part of the scene, other than the terrain, onto some plane perpendicular to the light direction, drawing everything in black; then somehow project this image onto the terrain, so the shadows fall on the terrain. I don't know how to do this though, especially the rendering to a texture. Here's a list of the OpenGL extensions my card supports. The actual card is GeForce 4 440 Go, with the latest drivers.

GL_ARB_imaging
GL_ARB_multitexture
GL_ARB_point_parameters
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_mirrored_repeat
GL_ARB_transpose_matrix
GL_ARB_vertex_program
GL_ARB_window_pos
GL_S3_s3tc
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_multi_draw_arrays
GL_EXT_packed_pixels
GL_EXT_paletted_texture
GL_EXT_point_parameters
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shared_texture_palette
GL_EXT_stencil_wrap
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_object
GL_EXT_vertex_array
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_fence
GL_NV_fog_distance
GL_NV_light_max_exponent
GL_NV_packed_depth_stencil
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_register_combiners
GL_NV_texgen_reflection
GL_NV_texture_env_combine4
GL_NV_texture_rectangle
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NVX_ycrcb
GL_SGIS_generate_mipmap
GL_SGIS_multitexture
GL_SGIS_texture_lod
GL_WIN_swap_hint
WGL_EXT_swap_control



Advertisement
You could try to determine which tiles will be shadowed by an object, and then draw that object on these tiles, but completely black (using the alpha from the object and a black color).
its possible to do shadowmapping without depth_testure + arb_shadow. (but its quite slow + not as acurrate)
check out the old nvidia pdf's on shadowmapping
The technique you describe is called projective shadowing and could be suitable solution.

Frustum has a nice OpenGL demo of this with source:
http://www.frustum.org/3d/index.php?demo=9
Thanks, I'll look into that. I also dug up my copy of Game Programming Gems (1), which came out before the shadow extensions were common, and found a demo there.

This topic is closed to new replies.

Advertisement