adjusted order of codes in draw_triangle_use_UBO.cpp
This commit is contained in:
parent
ce095f97f2
commit
383a568daa
@ -53,14 +53,6 @@ private:
|
|||||||
// v
|
// v
|
||||||
vil_config.Add(VAN::Position,VF_V2U16); //这里指定VAB中使用RG16U当做顶点数据格式
|
vil_config.Add(VAN::Position,VF_V2U16); //这里指定VAB中使用RG16U当做顶点数据格式
|
||||||
|
|
||||||
const auto ext=GetExtent2D();
|
|
||||||
|
|
||||||
for(uint i=0;i<VERTEX_COUNT;i++)
|
|
||||||
{
|
|
||||||
position_data[i][0]=position_data_float[i][0]*ext.width;
|
|
||||||
position_data[i][1]=position_data_float[i][1]*ext.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
vil_config.Add(VAN::Color,VF_V4UN8); //这里指定VAB中使用RGBA8UNorm当做颜色数据格式
|
vil_config.Add(VAN::Color,VF_V4UN8); //这里指定VAB中使用RGBA8UNorm当做颜色数据格式
|
||||||
|
|
||||||
cfg.local_to_world=false;
|
cfg.local_to_world=false;
|
||||||
@ -80,6 +72,14 @@ private:
|
|||||||
|
|
||||||
bool InitVBO()
|
bool InitVBO()
|
||||||
{
|
{
|
||||||
|
const auto ext=GetExtent2D();
|
||||||
|
|
||||||
|
for(uint i=0;i<VERTEX_COUNT;i++)
|
||||||
|
{
|
||||||
|
position_data[i][0]=position_data_float[i][0]*ext.width;
|
||||||
|
position_data[i][1]=position_data_float[i][1]*ext.height;
|
||||||
|
}
|
||||||
|
|
||||||
render_obj=CreateRenderable("Triangle",VERTEX_COUNT,material_instance,pipeline,
|
render_obj=CreateRenderable("Triangle",VERTEX_COUNT,material_instance,pipeline,
|
||||||
{
|
{
|
||||||
{VAN::Position,VF_V2U16,position_data},
|
{VAN::Position,VF_V2U16,position_data},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user