Render a lot of imposters in imposter example
@@ -13,7 +13,7 @@ fn main() {
// Renderer
let mut renderer = DeferredPipeline::new(&gl, width, height, vec4(0.8, 0.8, 0.8, 1.0)).unwrap();
- let mut camera = Camera::new_perspective(vec3(2.0, 2.0, 5.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0),
+ let mut camera = Camera::new_perspective(vec3(10.0, 25.0, 40.0), vec3(0.0, 7.0, 0.0), vec3(0.0, 1.0, 0.0),
degrees(45.0), width as f32 / height as f32, 0.1, 1000.0);
camera.enable_matrix_buffer(&gl);
@@ -81,9 +81,16 @@ fn main() {
renderer.geometry_pass(&||
{
render_scene(&camera);
- mesh_shader.render(&plane, &(Mat4::from_scale(10.0)), &camera);
- imposter.render(&(Mat4::from_translation(vec3(0.0, 7.0, 0.0))
+ mesh_shader.render(&plane, &(Mat4::from_scale(100.0)), &camera);
+
+ for x in -10..10 {
+ for y in -10..10 {
+ if x != 0 || y != 0 {
+ imposter.render(&(Mat4::from_translation(vec3(10.0 * x as f32, 7.0, 10.0 * y as f32))
* Mat4::from_scale(10.0)), &camera);
+ }
+ }
+ }
}).unwrap();
// Light pass
