specular OK in BlinnPhongDirectionLight sample. but direction error.

This commit is contained in:
2024-03-10 22:45:38 +08:00
parent f56928d734
commit 5347ac7091
2 changed files with 24 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ static Color4f white_color(1,1,1,1);
static mtl::blinnphong::SunLight sun_light=
{
Vector4f(1,1,1,0),
Vector4f(0,0,1,0),
Vector4f(1,0,0,1)
};
@@ -86,7 +86,13 @@ private:
mtl_sun_light->BindUBO(DescriptorSetType::Global,"sun",ubo_sun);
mtl_sun_light->Update();
mi_sphere=db->CreateMaterialInstance(mtl_sun_light,nullptr,&white_color);
float mi_data[4]=
{
1,0,0, //color
4 //gloss
};
mi_sphere=db->CreateMaterialInstance(mtl_sun_light,nullptr,&mi_data);
if(!mi_sphere)return(false);
p_sphere=CreatePipeline(mtl_sun_light,InlinePipeline::Solid3D,Prim::Triangles);