文件名称:euc-一种软件渲染板条箱,可让您使用Rust编写着色器-Rust开发
文件大小:167KB
文件格式:ZIP
更新时间:2024-06-16 12:38:50
Rust Graphics
例子struct例子; 例如,impl Pipeline {type Vertex = [f32; 2]; 输入VsOut =(); 像素类型= [u8; 4]; //顶点着色器示例struct示例; 例如,impl Pipeline {type Vertex = [f32; 2]; 输入VsOut =(); 像素类型= [u8; 4]; //顶点着色器fn vert(&self,pos:&Self :: Vertex)->([f32; 3],Self :: VsOut){([pos [0],pos [1],0.0],())} //片段着色器fn frag(&self,_:&Self :: VsOut)-> Self :: Pixel {[255,0,0,255] // Red}} fn main(){let mut color = Buffer2d :: new ([640,480],[0; 4]); let mut depth = Buffer2d :: new([640,480],1.0);
【文件预览】:
euc-master
----LICENSE-MIT(1KB)
----Cargo.toml(951B)
----.github()
--------workflows()
----src()
--------interpolate.rs(4KB)
--------texture.rs(1KB)
--------lib.rs(5KB)
--------buffer()
--------sampler()
--------rasterizer()
----LICENSE-APACHE(11KB)
----examples()
--------texture_mapping.rs(5KB)
--------teapot.rs(3KB)
--------triangle.rs(1KB)
--------data()
--------wireframes.rs(4KB)
--------spinning_cube.rs(4KB)
----README.md(4KB)
----misc()
--------icon.png(8KB)
--------banner.png(53KB)
--------example.png(51KB)
----.gitignore(30B)
----benches()
--------teapot.rs(3KB)