update SceneTree example, OnlyPosition3D.vert shader

This commit is contained in:
2020-01-20 20:32:09 +08:00
parent 71e9808492
commit c5b5486969
2 changed files with 18 additions and 5 deletions

View File

@@ -17,6 +17,8 @@ constexpr uint32_t SCREEN_HEIGHT=128;
class TestApp:public CameraAppFramework
{
Color4f color;
private:
double start_time;
@@ -27,6 +29,8 @@ private:
vulkan::Material * material =nullptr;
vulkan::MaterialInstance * material_instance =nullptr;
vulkan::Buffer * ubo_color =nullptr;
vulkan::Renderable * renderable_object =nullptr;
vulkan::Pipeline * pipeline_line =nullptr;
@@ -67,6 +71,11 @@ private:
{
if(!InitCameraUBO(material_instance,"world"))
return(false);
color.Set(1,1,0,1);
ubo_color=device->CreateUBO(sizeof(Color4f),&color);
material_instance->BindUBO("color_material",ubo_color);
material_instance->Update();
return(true);