Simplify block gen code path when all corners are empty
This commit is contained in:
		
							parent
							
								
									2f99b0ea4e
								
							
						
					
					
						commit
						a29b4979ef
					
				|  | @ -39,10 +39,13 @@ impl Chunk { | |||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             // If all the corners are negative, then all the interpolated values
 | ||||
|             // will be negative too. In that case we can just fill with empty.
 | ||||
|             if block_sign == -8.0 { | ||||
|                 block.resize(512, Voxel::Empty); | ||||
|             } else { | ||||
|                 let mut vals = [0.0f32; 512]; | ||||
|             if block_sign != -8.0 { | ||||
|                 math::tri_lerp_block(&noise_vals, &[8, 8, 8], &mut vals); | ||||
|             } | ||||
| 
 | ||||
|                 let mut idx = 0; | ||||
|                 for z in 0..8 { | ||||
|  | @ -63,6 +66,7 @@ impl Chunk { | |||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         block.to_owned() | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue