# User:Nyx Linden/Revisiting Render Cost

Rendering "Cost" is a difficult metric to compute and historically has been only of moderate usefulness.

With the advent of mesh, it is time to re-think how we measure rendering load of various pieces of content. As such, we're reviewing the algorithms used to compute render "cost". You can see a summary of changes below:

### 1.23 and prior:

- 1 point for the base avatar
- 10 points for each *attachment*
- 5 points for each unique texture (on prims).
- 1 point for each invisiprim.
- 1 point for each prim with glow. (If Glow value is set higher than 0.0 in Texture tab of the build tools)
- 1 point for each prim with shininess. (If Shininess is other than "None" in Texture tab of the build tools)
- 1 point for each face of every prim that's planar-mapped. (If Mapping is "Planar" in Texture tab of the build tools)
- 1 point per meter, per axis, for each prim.
- This most often affects skirts, capes, long hair, large wings and long tails.
- 4 points for each prim with bump mapping. (If Bumpiness is other than "None" in Texture tab of the build tools)
- 4 points for each prim face with transparency.
- 4 points for each prim face with an animated texture.
- 8 points for each prim that's flexible.
- 16 points for each prim that emits particles.

### 2.X :

- 100 point for the base avatar
- (-20 points for each baked texture marked invisible)

- 10 points for each *prim*
- 5 points for each unique texture (on prims).
- 1 point for each invisiprim.
- 1 point for each prim with glow. (If Glow value is set higher than 0.0 in Texture tab of the build tools)
- 1 point for each prim with shininess. (If Shininess is other than "None" in Texture tab of the build tools)
- 1 point for each face of every prim that's planar-mapped. (If Mapping is "Planar" in Texture tab of the build tools)
- 1 point per meter, per axis, for each prim.
- This most often affects skirts, capes, long hair, large wings and long tails.
- 4 points for each prim with bump mapping. (If Bumpiness is other than "None" in Texture tab of the build tools)
- 4 points for each prim face with transparency.
- 4 points for each prim face with an animated texture.
- 8 points for each prim that's flexible.
- 16 points for each prim that emits particles.

### "Render Weight"

(calculated by category in order; Base avatar then Base cost then Modifiers, etc. Result is rounded down)

- 1000 points for the base avatar
- (-200 points for each baked texture marked invisible)

- Base cost
- Base cost is a weighted average of the number of triangles times 5. Triangle count is weighted by the count of triangles at each LOD and the area each LOD is visible from, giving the average number of triangles visible within the visible range of the object. This uses the same distribution function as the streaming cost code, but left in terms of triangles, not scaled to prims.
- This is the base cost for regular prims, sculpties, and mesh prims.

- Multipliers (per prim)
- glow x1.5
- bump x1.25
- flexi x5
- shiny x1.6
- invisiprims x1.2
- rigged mesh x1.2
- planar mapped x1.0 (negligible impact)
- animated textures x1.4
- alpha x4.0

- additions
- particles: + 100 points per prim
- light emitting prims: + 500 points per prim
- media-enabled faces: + 1500 points per face
- for each unique texture (including sculpt textures) in the linkset: + 256 + 16 * (resX/128 + resY/128)

SL 3.0 These are placeholder costs. Don't rely on them. ring 75 = 10(prim) *1.5(sum of sides, min 1, max 4)*2+45(textures) tube 75 = 10(prim) *1.5(sum of sides, min 1, max 4)*2+45(textures) torus 105 = 10(prim)*1.5(sum of sides, min 1, max 4)*2*2+45(textures) hemisphere 111 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2*2+45(textures) sphere 105 sphere = 10 (prim) * 1.5 (scale) * 2 *2 + 45 (tex) half-cone 78 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2+45(textures) cone 75 = 10(prim)*1.5(sides, min 1, max 4)*2+45(textures) half-cylinder 78 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2+45(textures) cylinder 75 = 10(prim)*1.5(sides, min 1, max 4)*2+45(textures) tetrahedron 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) pyramid 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) prism 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) box 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) two linked spheres 210 box with 32x32 texture 22 = 10(prim) *(.5+.5+.5)(scale) + 7.5(textures) sphere with dimple & cut 117 = (10 "prim" +1+1)* 1.5 "scale" * 2 *2 + 45 "tex" sphere with dimple 111 = (10"prim" +1)* 1.5 "scale" * 2 *2 + 45 "tex" cube with 180 twist 75 = 10(prim) *(.5+.5+.5) *2 (twist) + 45(textures) cube with begin and end 5 degree twist 60 = 10(prim) *(.5+.5+.5) *1 (twist) + 45(textures) cube with 360 twist 105 = 10(prim) *(.5+.5+.5) *4 (twist) + 45(textures) box with 2 planar mapped sides 63 = (10 "prim" +1+1)* 1.5 "scale" + 45 "tex" 59 = box with 1 animated texture , (10 "prim" +4)* 1 "scale" + 45 "tex" 66 = box w/ 1 alpha texture, 10"prim" +4 *1.5(sum of sides, min 1, max 4) + 45(textures) 147 or 157 sphere invisiprim, (10"prim" +1 invisiprim) * 1.5 (scale) *4 sphere *2 bump + 25 (tex) 165 hollow sphere = 10 (prim) * 1.5 (scale) *4 *2+ 45 (tex) 75 hollow ring = 10(prim) *1.5 scale *2 *2 +45 texture sphere + hollow - 125 285 = sphere + hollow + glow , 10 (prim) * 1.5 (scale) *4 *2 *2+ 45 (tex) 525 = sphere + hollow + glow + bump 1005 = sphere + hollow + glow + bump +shiny 1005 = cube + hollow + glow + bump +shiny + flexi 175 sculpty = 10 * 1.5 *8 (sculpt) + 45 tex + 10 sculpt tex 1965 = cube + hollow + glow + bump +shiny + flexi + twist 180 3885 = cube + hollow + glow + bump +shiny + flexi + twist 360 285 = torus + 4x Revolutions 65 = box 0.5 x 0.5 x 1.0 75 = box 0.5 x 0.5 x 2.0 85 = box 0.5 x 0.5 x 3.0 85 = box 0.5 x 0.5 x 4.0 160 = box w/ particles 525 = box w/ 6 unique 1024x1024 textures

### Testing Procedure for tweaking values

Post-mesh launch, ARC is going to be generalized and the new algorithm renamed (render complexity? visual complexity?). The new algorithm (above) will be able to be applied easily to both avatars and non-avatar content in-world. The new algorithm should take into account multiple factors that were left out in previous iterations. While it is more complex to describe where "cost" comes from in this case, it should be more representative of the graphical load that content presents. That being said, there is no guarantee that the current values given from the algorithm are representative of the performance impact.

As such, the weighting factors of each property of the algorithm need to be tested under controlled conditions to ensure that the relative weights are correct for the algorithm. As such, we will be conducting a series of performance tests to get the algorithm correctly tweaked. More details soon!

SL 3.something - when the new costs are implemented. Display weight = object streaming cost * 83.333333 * multipliers + additions. ring 0.5m ^3 = ring streaming cost [0.1] * 83.333333 * multipliers [1] + texture [5 * (256/128 + 256/128 + 1)] = 392 ring 75 = 10(prim) *1.5(sum of sides, min 1, max 4)*2+45(textures) tube 75 = 10(prim) *1.5(sum of sides, min 1, max 4)*2+45(textures) torus 105 = 10(prim)*1.5(sum of sides, min 1, max 4)*2*2+45(textures) hemisphere 111 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2*2+45(textures) sphere 105 sphere = 10 (prim) * 1.5 (scale) * 2 *2 + 45 (tex) half-cone 78 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2+45(textures) cone 75 = 10(prim)*1.5(sides, min 1, max 4)*2+45(textures) half-cylinder 78 = 10(prim)+1(cut)*1.5(sides, min 1, max 4)*2+45(textures) cylinder 75 = 10(prim)*1.5(sides, min 1, max 4)*2+45(textures) tetrahedron 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) pyramid 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) prism 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) box 60 = 10(prim) *1.5(sum of sides, min 1, max 4) + 45(textures) two linked spheres 210 box with 32x32 texture 22 = 10(prim) *(.5+.5+.5)(scale) + 7.5(textures) sphere with dimple & cut 117 = (10 "prim" +1+1)* 1.5 "scale" * 2 *2 + 45 "tex" sphere with dimple 111 = (10"prim" +1)* 1.5 "scale" * 2 *2 + 45 "tex" cube with 180 twist 75 = 10(prim) *(.5+.5+.5) *2 (twist) + 45(textures) cube with begin and end 5 degree twist 60 = 10(prim) *(.5+.5+.5) *1 (twist) + 45(textures) cube with 360 twist 105 = 10(prim) *(.5+.5+.5) *4 (twist) + 45(textures) box with 2 planar mapped sides 63 = (10 "prim" +1+1)* 1.5 "scale" + 45 "tex" 59 = box with 1 animated texture , (10 "prim" +4)* 1 "scale" + 45 "tex" 66 = box w/ 1 alpha texture, 10"prim" +4 *1.5(sum of sides, min 1, max 4) + 45(textures) 147 or 157 sphere invisiprim, (10"prim" +1 invisiprim) * 1.5 (scale) *4 sphere *2 bump + 25 (tex) 165 hollow sphere = 10 (prim) * 1.5 (scale) *4 *2+ 45 (tex) 75 hollow ring = 10(prim) *1.5 scale *2 *2 +45 texture sphere + hollow - 125 285 = sphere + hollow + glow , 10 (prim) * 1.5 (scale) *4 *2 *2+ 45 (tex) 525 = sphere + hollow + glow + bump 1005 = sphere + hollow + glow + bump +shiny 1005 = cube + hollow + glow + bump +shiny + flexi 175 sculpty = 10 * 1.5 *8 (sculpt) + 45 tex + 10 sculpt tex 1965 = cube + hollow + glow + bump +shiny + flexi + twist 180 3885 = cube + hollow + glow + bump +shiny + flexi + twist 360 285 = torus + 4x Revolutions 65 = box 0.5 x 0.5 x 1.0 75 = box 0.5 x 0.5 x 2.0 85 = box 0.5 x 0.5 x 3.0 85 = box 0.5 x 0.5 x 4.0 160 = box w/ particles 525 = box w/ 6 unique 1024x1024 textures