RE: [Algorithms] Doing lighting on CLOD (ROAM) terrain
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2002-02-26 21:30:33
|
I'm using GLspeak here, but you can translate to D3D if necessary: You can use TexGen in NORMAL_MAP mode to get coordinates suitable for diffuse lighting, and REFLECTION_MAP mode to get coordinates suitable for specular; each texture coordinate output can then be collapsed to a 1D texture using the texture matrix, or it can point into a cube map texture that you orient appropriately. Other ways to get the lighting into each vertex on a height field include calculating lighting and specify it as a vertex color, or to specify it as a 1D texture coordinate up-front; the former is 4 bytes per vertex; the lattr 2 bytes (SHORT texture coordinate assumed). Last, you can just turn on lighting and let the card/driver deal with it. I don't know why you'd need to re-calculate the light map when the camera/viewer is moving, though? Is the viewer an implicit light source? Else, you'd only need to re-calculate when the light is moving, which seems less intensive. The TexGen methods of course don't have problems with that, as you can orient the matrices once per frame (if you use EYE_SPACE texgen). Cheers, / h+ > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of Phil > Scadden > Sent: Tuesday, February 26, 2002 12:35 PM > To: gda...@li... > Subject: [Algorithms] Doing lighting on CLOD (ROAM) terrain > > > Running into a lighting issue with CLOD implimentation, putting a > 1D texture > over the terrain. How to do it? Calculating normals on patch is either > compute-intensive or memory intensive if caching. Calculating > lightmap when > camera moving with the observer is similarly tricky. Ideas anyone?? > > > ---------------------------------------------------------- > Phil Scadden, Institute of Geological and Nuclear Sciences > 41 Bell Rd South, PO Box 30368, Lower Hutt, New Zealand > Ph +64 4 5704821, fax +64 4 5704603 > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > |