* Test deduplication of nodes that have inputs, some of them folded. */
| 245 | * Test deduplication of nodes that have inputs, some of them folded. |
| 246 | */ |
| 247 | TEST_F(RenderGraph, deduplicate_deep) |
| 248 | { |
| 249 | builder.add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry1")) |
| 250 | .add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry2")) |
| 251 | .add_node(ShaderNodeBuilder<ValueNode>(graph, "Value1").set_param("value", 0.8f)) |
| 252 | .add_node(ShaderNodeBuilder<ValueNode>(graph, "Value2").set_param("value", 0.8f)) |
| 253 | .add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise1")) |
| 254 | .add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise2")) |
| 255 | .add_node(ShaderNodeBuilder<MixNode>(graph, "Mix") |
| 256 | .set_param("mix_type", NODE_MIX_BLEND) |
| 257 | .set("Fac", 0.5f)) |
| 258 | .add_connection("Geometry1::Parametric", "Noise1::Vector") |
| 259 | .add_connection("Value1::Value", "Noise1::Scale") |
| 260 | .add_connection("Noise1::Color", "Mix::Color1") |
| 261 | .add_connection("Geometry2::Parametric", "Noise2::Vector") |
| 262 | .add_connection("Value2::Value", "Noise2::Scale") |
| 263 | .add_connection("Noise2::Color", "Mix::Color2") |
| 264 | .output_color("Mix::Color"); |
| 265 | |
| 266 | graph.finalize(scene.get()); |
| 267 | |
| 268 | EXPECT_EQ(graph.nodes.size(), 5); |
| 269 | |
| 270 | log.correct_info_message("XFolding Value1::Value to constant (0.8)."); |
| 271 | log.correct_info_message("Folding Value2::Value to constant (0.8)."); |
| 272 | log.correct_info_message("Deduplicated 2 nodes."); |
| 273 | } |
| 274 | |
| 275 | /* |
| 276 | * Test RGB to BW node. |
nothing calls this directly
no test coverage detected