used Vector3f instead Vector4f because noramlized(Vector3f) != normalized(Vector4f)

This commit is contained in:
2022-01-18 12:10:02 +08:00
parent 3594a88232
commit 1d81121d30
8 changed files with 32 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
// Cubemap
// Cube<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Cubemap
// Cube贴图测试
#include"VulkanAppFramework.h"
#include<hgl/filesystem/FileSystem.h>
@@ -121,7 +121,7 @@ private:
envmap_mi=db->CreateMaterialInstance(envmap_material);
if(!envmap_mi)return(false);
{
{
MaterialParameters *mp_texture=envmap_mi->GetMP(DescriptorSetsType::Value);
if(!mp_texture)
@@ -200,7 +200,12 @@ public:
if(!CameraAppFramework::Init(SCREEN_WIDTH,SCREEN_HEIGHT))
return(false);
render_list=new RenderList(device);
camera->pos=Vector3f(10,10,0);
camera->target=Vector3f(0,0,0);
camera->Refresh(); //更新矩阵计算
render_list=new RenderList(device);
if(!InitMaterial())
return(false);

View File

@@ -44,17 +44,6 @@ private:
if(!pipeline)
return(false);
{
MaterialParameters *mp_global=material_instance->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",GetCameraInfoBuffer()))return(false);
mp_global->Update();
}
return(true);
}
@@ -98,7 +87,6 @@ private:
pgci.side_color.Set(0,0,1,1);
ro_plane_grid[2]=CreateRenderablePlaneGrid(db,vab,&pgci);
camera->pos=Vector4f(200,200,200,1.0);
}
bool InitScene()
@@ -107,6 +95,9 @@ private:
Add(ro_plane_grid[1],rotate(HGL_RAD_90,0,1,0));
Add(ro_plane_grid[2],rotate(HGL_RAD_90,1,0,0));
camera->pos=Vector3f(200,200,200);
camera->Refresh();
render_root.RefreshMatrix();
render_list->Expend(camera->info,&render_root);
@@ -140,6 +131,9 @@ public:
void BuildCommandBuffer(uint32 index)
{
render_root.RefreshMatrix();
render_list->Expend(GetCameraInfo(),&render_root);
VulkanApplicationFramework::BuildCommandBuffer(index,render_list);
}