Skip to content

Commit

Permalink
[animation] enabled window animation for the tree trunks in the fores…
Browse files Browse the repository at this point in the history
…t world
  • Loading branch information
PanosK92 committed Jan 17, 2025
1 parent ebda9ea commit c808533
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/shaders/common_vertex_processing.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct gbuffer_vertex

static float3 extract_position(matrix transform)
{
return float3(transform._14, transform._24, transform._34);
return float3(transform._31, transform._32, transform._33);
}

struct vertex_processing
Expand Down
5 changes: 3 additions & 2 deletions runtime/Game/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ namespace spartan

shared_ptr<Material> material = make_shared<Material>(); // create a material manually as the tree comes with empty materials
material->SetResourceFilePath("project\\terrain\\vegetation_tree_2\\trunk" + string(EXTENSION_MATERIAL));
material->SetTexture(MaterialTextureType::Color, "project\\terrain\\vegetation_tree_2\\trunk_color.png");
material->SetTexture(MaterialTextureType::Normal, "project\\terrain\\vegetation_tree_2\\trunk_normal.png");
material->SetTexture(MaterialTextureType::Color, "project\\terrain\\vegetation_tree_2\\trunk_color.png");
material->SetTexture(MaterialTextureType::Normal, "project\\terrain\\vegetation_tree_2\\trunk_normal.png");
material->SetProperty(MaterialProperty::AnimationFoliageWind, 1.0f);
renderable->SetMaterial(material);

// generate instances
Expand Down

0 comments on commit c808533

Please sign in to comment.