Picking target texture is one float
@@ -139,7 +139,7 @@ pub fn ray_intersect(
0.0,
max_depth,
)?;
- let mut texture = Texture2D::new_empty::<Vector4<f32>>(
+ let mut texture = Texture2D::new_empty::<f32>(
context,
viewport.width,
viewport.height,
@@ -183,7 +183,7 @@ pub fn ray_intersect(
},
)?;
}
- let depth = texture.read::<[f32; 4]>(viewport)?[0][0];
+ let depth = texture.read::<f32>(viewport)?[0];
Ok(if depth < 1.0 {
Some(position + direction * depth * max_depth)
} else {
