Extract a lib
This commit is contained in:
parent
bd5a140c84
commit
7ecbd50c05
|
|
@ -1,15 +1,13 @@
|
|||
use std::error::Error;
|
||||
|
||||
use glam::{vec2, vec3};
|
||||
use perlin::{Pipeline, Vertex};
|
||||
use raytracing3::perlin::{self, Pipeline, Vertex};
|
||||
use winit::{
|
||||
event::{Event, WindowEvent},
|
||||
event_loop::EventLoop,
|
||||
window::{Window, WindowAttributes},
|
||||
};
|
||||
|
||||
mod perlin;
|
||||
|
||||
fn make_viewport(w: u32, h: u32) -> [Vertex; 4] {
|
||||
let w = w as f32;
|
||||
let h = h as f32;
|
||||
|
|
|
|||
1
src/lib.rs
Normal file
1
src/lib.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub mod perlin;
|
||||
|
|
@ -42,7 +42,7 @@ impl Pipeline {
|
|||
mapped_at_creation: false,
|
||||
});
|
||||
|
||||
let shader = fs::read_to_string("src/bin/envmap/perlin.wgsl").unwrap();
|
||||
let shader = fs::read_to_string("shaders/perlin.wgsl").unwrap();
|
||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: None,
|
||||
source: wgpu::ShaderSource::Wgsl(shader.into()),
|
||||
Loading…
Reference in New Issue
Block a user