Iti s alwasy easier to understand with a drawing so here is a level: Thanks for the designer's visplanes the engine sees four areas: Note : The switch from C to C++ is obvious here. C++ sort would have been faster thanks to inlining. R_SortDrawSurfs // A simple C qsort call. R_AddModelSurfaces // Instantiate animated models (for monsters) R_AddLightSurfaces // Find entities that are not in a visible area but still casting a shadow (usually enemies) R_ConstrainViewFrustum //Improve Z-buffer accuracy by moving far plan as close as the farthest entity. PointInArea //Walk the BSP and find the current AreaįlowViewThroughPortals //Recursively pass portals to find lights and entities interacting with the view. Static_cast(parms->renderWorld)->FindViewLightsAndEntities() ::R_RenderView(params) //This is the frontend That will be read by the backend so it can generate OpenGL Commands. The last step is to generate an Intermediate representation Is uploaded to the GPU Ram (it keeps track of everything via an "interaction table"). Once each interaction have been found the frontend makes sure everything needed by the backend Those combinations are called interactions. The goal is to find every light/entity combination affecting the view. The frontend performs the hard part: Visible Surface Determination (VSD).
0 Comments
Leave a Reply. |