1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use super::base_3d::*;
use crate::{
mtl::{TexAlbedo, TexEmission},
skinning::JointCombined,
};
use rendy::{
mesh::{AsVertex, Normal, Position, TexCoord, VertexFormat},
shader::SpirvShader,
};
#[derive(Debug)]
pub struct ShadedPassDef;
impl Base3DPassDef for ShadedPassDef {
const NAME: &'static str = "Shaded";
type TextureSet = (TexAlbedo, TexEmission);
fn vertex_shader() -> &'static SpirvShader {
&super::POS_NORM_TEX_VERTEX
}
fn vertex_skinned_shader() -> &'static SpirvShader {
&super::POS_NORM_TEX_SKIN_VERTEX
}
fn fragment_shader() -> &'static SpirvShader {
&super::SHADED_FRAGMENT
}
fn base_format() -> Vec<VertexFormat> {
vec![Position::vertex(), Normal::vertex(), TexCoord::vertex()]
}
fn skinned_format() -> Vec<VertexFormat> {
vec![
Position::vertex(),
Normal::vertex(),
TexCoord::vertex(),
JointCombined::vertex(),
]
}
}
pub type DrawShadedDesc<B> = DrawBase3DDesc<B, ShadedPassDef>;
pub type DrawShaded<B> = DrawBase3D<B, ShadedPassDef>;
pub type DrawShadedTransparentDesc<B> = DrawBase3DTransparentDesc<B, ShadedPassDef>;
pub type DrawShadedTransparent<B> = DrawBase3DTransparent<B, ShadedPassDef>;