forked from StrafesNET/strafe-client
add suzanne
This commit is contained in:
parent
c3290e2ce6
commit
df43dc6f6e
2580
models/suzanne.obj
Normal file
2580
models/suzanne.obj
Normal file
File diff suppressed because it is too large
Load Diff
34
src/main.rs
34
src/main.rs
@ -143,22 +143,7 @@ impl Skybox {
|
||||
}
|
||||
}
|
||||
|
||||
impl strafe_client::framework::Example for Skybox {
|
||||
fn optional_features() -> wgpu::Features {
|
||||
wgpu::Features::TEXTURE_COMPRESSION_ASTC
|
||||
| wgpu::Features::TEXTURE_COMPRESSION_ETC2
|
||||
| wgpu::Features::TEXTURE_COMPRESSION_BC
|
||||
}
|
||||
|
||||
fn init(
|
||||
config: &wgpu::SurfaceConfiguration,
|
||||
_adapter: &wgpu::Adapter,
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
) -> Self {
|
||||
let mut entities = Vec::new();
|
||||
{
|
||||
let source = include_bytes!("../models/teslacyberv3.0.obj");
|
||||
fn add_obj(device:&wgpu::Device,entities:& mut Vec<Entity>,source:&[u8]){
|
||||
let data = obj::ObjData::load_buf(&source[..]).unwrap();
|
||||
let mut vertices = Vec::new();
|
||||
for object in data.objects {
|
||||
@ -189,6 +174,23 @@ impl strafe_client::framework::Example for Skybox {
|
||||
}
|
||||
}
|
||||
|
||||
impl strafe_client::framework::Example for Skybox {
|
||||
fn optional_features() -> wgpu::Features {
|
||||
wgpu::Features::TEXTURE_COMPRESSION_ASTC
|
||||
| wgpu::Features::TEXTURE_COMPRESSION_ETC2
|
||||
| wgpu::Features::TEXTURE_COMPRESSION_BC
|
||||
}
|
||||
|
||||
fn init(
|
||||
config: &wgpu::SurfaceConfiguration,
|
||||
_adapter: &wgpu::Adapter,
|
||||
device: &wgpu::Device,
|
||||
queue: &wgpu::Queue,
|
||||
) -> Self {
|
||||
let mut entities = Vec::<Entity>::new();
|
||||
add_obj(device,& mut entities,include_bytes!("../models/teslacyberv3.0.obj"));
|
||||
add_obj(device,& mut entities,include_bytes!("../models/suzanne.obj"));
|
||||
|
||||
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
||||
label: None,
|
||||
entries: &[
|
||||
|
Loading…
Reference in New Issue
Block a user