Module darkplaces: Change committed

havoc at icculus.org havoc at icculus.org
Sun Oct 27 08:15:53 EST 2002


Commiter   : havoc
CVSROOT    : /cvs/cvsroot/twilight
Module     : darkplaces
Commit time: 2002-10-27 13:15:53 UTC

Log message:

gloss now works correctly
major speedups to realtime lighting mode (it's now actually playable on my machine)

world lights are now handled by r_shadow.c instead of the lights list in the world model
world lights can be ingame edited/loaded/saved (the file name ends in .rtlights), this is all controlled by r_editlights* commands/cvars
realtime lighting cvars renamed from r_light_* to r_shadow_*
r_shadow_realtime takes the place of r_shadows modes 2 and 3, mode 1 is realtime lighting, mode 2 is realtime lighting plus visible shadow volumes overlaid
r_shadow_lightingmode variable added (updated each frame) indicating whether or not realtime lighting is active
changed how player model and chase_active is handled (player model is now considered a forced RENDER_EXTERIORMODEL), so player now casts shadows
R_Shadow_Volume no longer takes a vertex parameter, it is implied that it is in varray_vertex (since all the code relied on this fact anyway)
R_Shadow_Volume's code has been split out into reusable functions (R_Shadow_ProjectVertices, R_Shadow_MakeTriangleShadowFlags, R_Shadow_BuildShadowVolumeTriangles)
R_Shadow_RenderLighting split into R_Shadow_DiffuseLighting and R_Shadow_SpecularLighting since sometimes it's usable to use more than one call to diffuse lighting (colormapped models)
R_Model_Alias_DrawLight now handles colormapping
added Light_CullBox and LightAndVis_CullBox functions for culling shadow volumes
R_DrawWorldLightShadowVolume has been moved to r_shadow.c
Mod_ShadowMesh_Begin now takes an initial number of triangles to hold, number of triangles in each additional shadowmesh is now based on previous mesh
R_Model_Brush_DrawLightForSurfaceList added to greatly reduce wasted lighting
rewrote visibility logic in R_Model_Brush_DrawLight, now uses different approachs for bmodels and world
lights are now pvs culled (according to what leafs are visible to the viewer, and what leafs are visible to the light)
R_Shadow_Stage_EraseShadowVolumes now returns an int, indicating whether or not to draw the shadow volumes again to erase
rewrote how texture info based on entity and time is updated (it is now a function called R_UpdateTextureInfo)
fixed a ton of bugs relating to animated textures and transparency of bmodels (also changed texture_t currentframe to no longer be an array)
disabled building of surface neighbors (oh sure I made it a lot faster and stuff, but it's still not practical, and is no longer necessary)
changed parameters of model_t DrawLight function to no longer take distbias and subtract
Mod_ProcessLightList is no longer called
mlight_t fields relating to shadow volumes have been commented out
Mod_ValidateElements function added
notes on enormous cost added to Mod_BuildTextureVectorsAndNormals (188 float operations per triangle, and 39 float operations per vertex)
added (disabled) code for allocating and freeing shadowmeshs in pieces, just for obsessive memory corruption detection (none was found)
Mod_ShadowMesh_AddTriangle and Mod_ShadowMesh_AddMesh functions added, and Mod_ShadowMesh_AddPolygon now uses AddTriangle (this is a slowdown but I'm not sure it matters that it is, it fills out meshs more completely)
added (disabled) code for Mod_ShadowMesh_Finish to work without reallocating meshs
R_Shadow_ResizeTriangleFacingLight and R_Shadow_ResizeShadowElements added
R_Shadow_RenderShadowMeshVolume added (properly renders shadowmesh_t chains, fixing all the bugs with static shadow volume rendering)
r_shadow_blankbumptexture is now 1x1
r_shadow_blankglosstexture and r_shadow_blankwhitetexture added (both 1x1)
added a 4 texture path for r_shadowtexture3d 0 mode
when static shadow volumes are constructed for world lights, it is now done by constructing a combined mesh of all lit geometry, and then casting shadows from that (this reduces shadow volume edges greatly, since separate polygons become a continuous mesh during the mesh creation)

Modified files:
     cl_main.c gl_models.c gl_rmain.c gl_rsurf.c model_alias.c
     model_brush.c model_brush.h model_shared.c model_shared.h
     r_light.c r_shadow.c r_shadow.h
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: darkplaces.20021027.131553.havoc.diff
URL: <http://icculus.org/pipermail/twilight-commits/attachments/20021027/3a362298/attachment.diff>


More information about the twilight-commits mailing list