[sldev] "background sky" render pass, render pass sequence

Dave Parks davep at lindenlab.com
Mon Mar 31 23:35:23 PDT 2008


If you look in LLPipeline::renderGeom, you can see a loop iterating 
through a series of draw pools (LLDrawPool subclasses).  These pools are 
sorted according to their type, which is one of the values in an enum in 
lldrawpool.h:

    POOL_SIMPLE = 1,
        POOL_FULLBRIGHT,
        POOL_TERRAIN,   
        POOL_TREE,
        POOL_SKY,
        POOL_WL_SKY,
        POOL_GROUND,
        POOL_BUMP,
        POOL_INVISIBLE,
        POOL_AVATAR,
        POOL_WATER,
        POOL_GLOW,
        POOL_ALPHA,

The HUD is rendered with a separate pass through LLPipeline::renderGeom 
with a different render matrix, after all other geometry.  If you have 
atmospheric shaders on in the RC viewer, there are two extra passes 
through renderGeom for the water reflection and distortion maps.  This 
isn't to say everything is rendered 3 times, however.  renderGeom works 
on a CullResult, which is populated by a call to updateCull and prepared 
for render by a call to stateSort (which is where the results of frustum 
culling are sorted by material, depth, etc., and where most vertex 
buffer packing happens). 

I'm doing some experimental work right now on per pixel lighting via 
deferred rendering which splits the main 3D render into two passes 
through renderGeom with the same CullResult, but with different pools 
masked on or off (see LLPipeline::mRenderTypeMask).  The geometry that 
can be lit using deferred rendering is rendered into screen space 
diffuse/specular/normal/position maps, lit, and then remaining geometry 
(water, transparency, fullbright, etc.) is rendered using the current 
shaders.

Chromanoid Xeno wrote:
> Hello,
> I could not really figure out when the background sky is rendered. Can 
> somebody say it is rendered at the end?
> Are the solid HUD elements rendered at the beginning?
> At all I would really like to know how the render passes are sorted. 
> Are there any documents about that? I searched quite a long time for a 
> general rendering rule in the viewer sourcecode but i did not really 
> find something...
> I presume the rule is:
> 1. Solids front to back
> 2. Transparent back to front
> 3. Sky/Background
>  
> Does anybody know if i am right?
>  
> I ask because i would really like to see depth of field effects etc.. 
> For a possible implementation i would really like to know more about 
> the rendering sequence...
>  
> Anything you can tell me would be much appreciated.
>  
> Best regards
> Christian
> ------------------------------------------------------------------------
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>   



More information about the SLDev mailing list