updated CameraControl's codes.

This commit is contained in:
2022-03-11 19:13:20 +08:00
parent 5b5ec1df7a
commit 057a6e2bd0
3 changed files with 31 additions and 28 deletions

View File

@@ -70,17 +70,8 @@ public:
if(!ro->ubo_camera_info)
return(false);
{
MaterialParameters *mp_global=ro->material_instance->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",ro->ubo_camera_info))return(false);
mp_global->Update();
}
BindCameraUBO(ro->material_instance);
return(true);
}
@@ -142,20 +133,14 @@ public:
cube.sampler=db->CreateSampler();
if(!cube.sampler)return(false);
{
MaterialParameters *mp_texture=cube.material_instance->GetMP(DescriptorSetsType::Value);
if(!mp_texture)
return(false);
if(!mp_texture->BindSampler("tex",os.render_taget->GetColorTexture(),cube.sampler))return(false);
mp_texture->Update();
}
if(!cube.material_instance->BindSampler(DescriptorSetsType::Value,"tex",os.render_taget->GetColorTexture(),cube.sampler))
return(false);
{
CubeCreateInfo cci;
cci.tex_coord=true;
Renderable *render_obj=CreateRenderableCube(db,cube.material_instance->GetVAB(),&cci);
if(!render_obj)return(false);