preparing LoadMaterialFromJson(....)
This commit is contained in:
parent
e8e6c20305
commit
4a4326826e
@ -1 +1 @@
|
|||||||
Subproject commit 0fae462338cd01c5a26d0a8f0175fe3729a65c94
|
Subproject commit 0244bff1b60119806f683b54a137cda2cacc17ac
|
@ -1 +1 @@
|
|||||||
Subproject commit be7f43d6a9077288e5ef883a56f54310dce5f735
|
Subproject commit 6da4b9973812162a966de0db505572f25f1caaca
|
@ -1,5 +1,6 @@
|
|||||||
macro(CreateProject name)
|
macro(CreateProject name)
|
||||||
add_executable(${name} ${ARGN} ${VULKAN_APP_FRAMEWORK})
|
|
||||||
|
add_executable(${name} ${ARGN} ${VULKAN_APP_FRAMEWORK} MaterialLoader/MaterialLoader.cpp)
|
||||||
target_link_libraries(${name} ${ULRE})
|
target_link_libraries(${name} ${ULRE})
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
@ -10,7 +11,7 @@
|
|||||||
set_property(TARGET ${name} PROPERTY FOLDER "ULRE/Example/Basic")
|
set_property(TARGET ${name} PROPERTY FOLDER "ULRE/Example/Basic")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
CreateProject(00_RenderFrameworkTest rf_test.cpp AssetData.h)
|
CreateProject(00_RenderFrameworkTest rf_test.cpp)
|
||||||
CreateProject(01_draw_triangle_in_NDC draw_triangle_in_NDC.cpp)
|
CreateProject(01_draw_triangle_in_NDC draw_triangle_in_NDC.cpp)
|
||||||
CreateProject(02_draw_triangle_use_UBO draw_triangle_use_UBO.cpp)
|
CreateProject(02_draw_triangle_use_UBO draw_triangle_use_UBO.cpp)
|
||||||
CreateProject(03_auto_instance auto_instance.cpp)
|
CreateProject(03_auto_instance auto_instance.cpp)
|
||||||
|
34
example/Basic/MaterialLoader/MaterialLoader.cpp
Normal file
34
example/Basic/MaterialLoader/MaterialLoader.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include<hgl/graph/mtl/MaterialLibrary.h>
|
||||||
|
#include<hgl/util/JsonTool.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
material json example:
|
||||||
|
|
||||||
|
{
|
||||||
|
"name":"material_name",
|
||||||
|
"type":"2d",
|
||||||
|
"parent":"parent_material_name",
|
||||||
|
|
||||||
|
"std2d":
|
||||||
|
{
|
||||||
|
"coordinate_system":"NDC",
|
||||||
|
"local_to_world:"false",
|
||||||
|
"position_format":"vec2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
STD_MTL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
MaterialCreateInfo *Load2DMaterialFromJson(const Json::Value& json_root)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialCreateInfo *LoadMaterialFromJson(const Json::Value &json_root)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
STD_MTL_NAMESPACE_END
|
@ -4,7 +4,6 @@
|
|||||||
#include<hgl/graph/mtl/Material2DCreateConfig.h>
|
#include<hgl/graph/mtl/Material2DCreateConfig.h>
|
||||||
#include<hgl/graph/VKMaterialInstance.h>
|
#include<hgl/graph/VKMaterialInstance.h>
|
||||||
#include<hgl/graph/mtl/MaterialLibrary.h>
|
#include<hgl/graph/mtl/MaterialLibrary.h>
|
||||||
#include"AssetData.h"
|
|
||||||
|
|
||||||
using namespace hgl;
|
using namespace hgl;
|
||||||
using namespace hgl::graph;
|
using namespace hgl::graph;
|
||||||
@ -56,7 +55,6 @@ private:
|
|||||||
|
|
||||||
//material_instance=CreateMaterialInstance(mci);
|
//material_instance=CreateMaterialInstance(mci);
|
||||||
|
|
||||||
|
|
||||||
//下面这个方式更直接,在WorkObject中封装了CreateMaterialCreateInfo(name,...)这个方法一步到位
|
//下面这个方式更直接,在WorkObject中封装了CreateMaterialCreateInfo(name,...)这个方法一步到位
|
||||||
material_instance=CreateMaterialInstance("VertexColor2D",&cfg); //这个是使用名称创建
|
material_instance=CreateMaterialInstance("VertexColor2D",&cfg); //这个是使用名称创建
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user