wgpu_rust_renderer/material/node/
normal.rs

1use std::collections::HashMap;
2use crate::{
3	material::node::node::{
4		MaterialNode,
5		UniformContents,
6	},
7	resource::resource::{
8		ResourceId,
9		ResourcePool,
10	},
11};
12
13pub struct NormalNode {
14}
15
16impl NormalNode {
17	pub fn new() -> Self {
18		NormalNode {
19		}
20	}
21}
22
23impl MaterialNode for NormalNode {
24	fn collect_nodes (
25		&self,
26		_pool: &ResourcePool<Box<dyn MaterialNode>>,
27		nodes: &mut Vec<ResourceId<Box<dyn MaterialNode>>>,
28		visited: &mut HashMap<ResourceId<Box<dyn MaterialNode>>, bool>,
29		self_rid: ResourceId<Box<dyn MaterialNode>>,
30	) {
31		if !visited.contains_key(&self_rid) {
32			visited.insert(self_rid, true);
33			nodes.push(self_rid);
34		}
35	}
36
37	fn borrow_contents(&self) -> Option<&UniformContents> {
38		None
39	}
40
41	fn build_declaration(&self, _self_id: usize) -> String {
42		format!("")
43	}
44
45	fn build_functions(&self, _self_id: usize) -> String {
46		format!("")
47	}
48
49	fn build_fragment_shader(
50		&self,
51		_pool: &ResourcePool<Box<dyn MaterialNode>>,
52		_visited: &mut HashMap<usize, bool>,
53		_self_id: usize,
54	) -> String {
55		format!("")
56	}
57
58	fn get_fragment_output(&self, _self_id: usize) -> String {
59		format!("in.normal")
60	}
61}