| 158 | } |
| 159 | |
| 160 | static inline float GetSubdivisionCount( float pixelSize, float low, float mid, float high, const EveUpdateContext& updateContext ) |
| 161 | { |
| 162 | if( pixelSize < updateContext.GetVisibilityThreshold() ) |
| 163 | { |
| 164 | return 0; |
| 165 | } |
| 166 | float lowCount; |
| 167 | float highCount; |
| 168 | float lowStep; |
| 169 | float highStep; |
| 170 | |
| 171 | if( pixelSize <= updateContext.GetLowDetailThreshold() ) |
| 172 | { |
| 173 | lowCount = 1; |
| 174 | highCount = low; |
| 175 | lowStep = updateContext.GetVisibilityThreshold(); |
| 176 | highStep = updateContext.GetLowDetailThreshold(); |
| 177 | } |
| 178 | else if( pixelSize <= updateContext.GetMediumDetailThreshold() ) |
| 179 | { |
| 180 | lowCount = low; |
| 181 | highCount = mid; |
| 182 | lowStep = updateContext.GetLowDetailThreshold(); |
| 183 | highStep = updateContext.GetMediumDetailThreshold(); |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | lowCount = mid; |
| 188 | highCount = high; |
| 189 | lowStep = updateContext.GetMediumDetailThreshold(); |
| 190 | highStep = updateContext.GetHighDetailThreshold(); |
| 191 | } |
| 192 | |
| 193 | float linstep = TriLinearize( lowStep, highStep, pixelSize ); |
| 194 | return floor( Lerp( lowCount, highCount, linstep ) ); |
| 195 | } |
| 196 | |
| 197 | // -------------------------------------------------------------------------------------- |
| 198 | // Description: |
no test coverage detected