pub fn create_skybox(device: &wgpu::Device) -> (wgpu::Buffer, wgpu::Buffer) {
    let mut vertices = Vec::new();
    let mut indices = Vec::new();

    for i in 0..6 {
        for l in 0..4 {
            vertices.push(SkyboxVertex {
                position: [POS[i][l][0], POS[i][l][1], POS[i][l][2]],
            });
        }
        for l in 0..6 {
            indices.push(MESH_INDEX[l] + (i as u32 * 4));
        }
    }

    (
        {
            let vertices_slice = to_u8_slice(&vertices);
            device.create_buffer_init(&BufferInitDescriptor {
                label: Some("skybox_vertices"),
                usage: wgpu::BufferUsage::COPY_SRC | wgpu::BufferUsage::VERTEX,
                contents: &vertices_slice
            })
        },
        {
            let indices_slice = to_u8_slice(&indices);
            device.create_buffer_init(&BufferInitDescriptor {
                label: Some("skybox_indicies"),
                usage: wgpu::BufferUsage::COPY_SRC | wgpu::BufferUsage::INDEX,
                contents: &indices_slice
            })
        }
    )
}
/// Create the vertex and the index buffer for the skybox.
Create the vertex and the index buffer for the skybox.
Create the vertex and the index buffer for the skybox .
pub fn create_skybox(device: &wgpu::Device) -> (wgpu::Buffer, wgpu::Buffer) {
    let mut vertices = Vec::new();
    let mut indices = Vec::new();
    for i in 0..6 {
        for l in 0..4 {
            vertices.push(SkyboxVertex {
                position: [POS[i][l][0], POS[i][l][1], POS[i][l][2]],
            });
        }
        for l in 0..6 {
            indices.push(MESH_INDEX[l] + (i as u32 * 4));
        }
    }
    (
        {
            let vertices_slice = to_u8_slice(&vertices);
            device.create_buffer_init(&BufferInitDescriptor {
                label: Some("skybox_vertices"),
                usage: wgpu::BufferUsage::COPY_SRC | wgpu::BufferUsage::VERTEX,
                contents: &vertices_slice
            })
        },
        {
            let indices_slice = to_u8_slice(&indices);
            device.create_buffer_init(&BufferInitDescriptor {
                label: Some("skybox_indicies"),
                usage: wgpu::BufferUsage::COPY_SRC | wgpu::BufferUsage::INDEX,
                contents: &indices_slice
            })
        }
    )
}
pub fn create_skybox ( device : & wgpu :: Device ) -> ( wgpu :: Buffer , wgpu :: Buffer ) { let mut vertices = Vec :: new ( ) ; let mut indices = Vec :: new ( ) ; for i in 0 .. 6 { for l in 0 .. 4 { vertices . push ( SkyboxVertex { position : [ POS [ i ] [ l ] [ 0 ] , POS [ i ] [ l ] [ 1 ] , POS [ i ] [ l ] [ 2 ] ] , } ) ; } for l in 0 .. 6 { indices . push ( MESH_INDEX [ l ] + ( i as u32 * 4 ) ) ; } } ( { let vertices_slice = to_u8_slice ( & vertices ) ; device . create_buffer_init ( & BufferInitDescriptor { label : Some ( " " ) , usage : wgpu :: BufferUsage :: COPY_SRC | wgpu :: BufferUsage :: VERTEX , contents : & vertices_slice } ) } , { let indices_slice = to_u8_slice ( & indices ) ; device . create_buffer_init ( & BufferInitDescriptor { label : Some ( " " ) , usage : wgpu :: BufferUsage :: COPY_SRC | wgpu :: BufferUsage :: INDEX , contents : & indices_slice } ) } ) }
Create the vertex and the index buffer for the skybox.
Create the vertex and the index buffer for the skybox .
device
&wgpu::Device
device
&wgpu::Device