Extract a lib

This commit is contained in:
numzero 2024-12-24 02:32:55 +03:00
parent bd5a140c84
commit 7ecbd50c05
4 changed files with 3 additions and 4 deletions

View File

@ -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
View File

@ -0,0 +1 @@
pub mod perlin;

View File

@ -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()),