Rendering System

From Second Life Wiki
Revision as of 00:58, 15 November 2010 by HaZarD Gearhead (talk | contribs) (Created page with '== Rendering System of SecondLife Viewer 1.22 == Rendering in the viewer starts in llviewerdisplay.cpp in the display() method. * check window state * check if in startup state...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Rendering System of SecondLife Viewer 1.22

Rendering in the viewer starts in llviewerdisplay.cpp in the display() method.

  • check window state
  • check if in startup state (don't render)
  • if in teleport mode draw static screen and progress bar
  • if logout requested don't draw

prepare for next frame:

  • update camera
  • clear buffer, for drawing of dynamic textures
  • setup rendering
  • reset lights to SL defaults

update window and dynamic textures:

  • update (draw) dynamic(/render-to-texture) textures

for each dynamic texture:

-> save camera and viewport and clear the depthbuffer if required

-> render to framebuffer

-> use glCopyTexSubImage2D to copy results to texture

-> restore camera and viewport

  • if any dynamic textures were updated clear color and depth buffer
  • set viewport up (with offsets and window dimensions)

update scene:

  • set camera up

display_camera_update() creates projection matrix and clip distance

  • update HUD
  • update geometry
  • cull geometry
  • clear/flush last frame
  • update images (?)
  • state sorting
  • rebuild draw pools
  • update sky

redraw skytexture and cubic environment map

draw geometry

  • if render scene to texture (if vertex shaders supported) bind frame buffer to FBO
  • render pipeline
    • unbind vertex buffers (?)

set safe default state values (matrices and stuff)

set fog and lights

for each drawpool:

- render faces to vertex buffer

- render vertex buffer to frame buffer (?)