增加材质和纹理
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "scene/dvu_load_gltf.h"
|
||||
#include "pipe/dvc_render_pipe.h"
|
||||
#include "device/dvc_device.h"
|
||||
#include "device/dvc_render_target.h"
|
||||
#include "shader/dvc_shader_interface.h"
|
||||
#include "buffer/dvu_dump_buffer.h"
|
||||
@@ -20,6 +21,7 @@
|
||||
|
||||
SDL_Window* main_window;
|
||||
|
||||
extern davinci::Device g_device;
|
||||
extern davinci::Scene g_scene;
|
||||
extern davinci::RenderTarget g_renderTarget;
|
||||
extern davinci::AntiAliasingTech g_aaTech;
|
||||
@@ -72,10 +74,11 @@ void OpenFileDialogFileCallback(void* userdata, const char* const* filelist, int
|
||||
{
|
||||
if (filelist == nullptr || *filelist == nullptr) return;
|
||||
|
||||
g_device.clear();
|
||||
g_scene.clear();
|
||||
|
||||
const char* szFileName = *filelist;
|
||||
if (!davinci_utils::load_scene_from_gltf(szFileName, g_scene))
|
||||
if (!davinci_utils::load_scene_from_gltf(szFileName, g_device, g_scene))
|
||||
{
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Open glf scene file error", main_window);
|
||||
}
|
||||
@@ -99,13 +102,13 @@ void drawMainUI()
|
||||
}
|
||||
if (ImGui::Button("Export"))
|
||||
{
|
||||
davinci_utils::export_mesh_to_obj(g_scene);
|
||||
davinci_utils::export_mesh_to_obj(g_device, g_scene);
|
||||
}
|
||||
const char* aaItem[] = { "None", "MSAA_2X2", "MSAA_4X4"};
|
||||
ImGui::Combo("AntiAliasing", (int*)(&g_aaTech), aaItem, IM_ARRAYSIZE(aaItem));
|
||||
if (ImGui::Button("Render"))
|
||||
{
|
||||
davinci::RenderPipe pipe;
|
||||
davinci::RenderPipe pipe(g_device);
|
||||
|
||||
davinci::UniformBuffer& uniformBuffer = pipe.getUniformBuffer();
|
||||
uniformBuffer.updateStandardAttribute(g_scene);
|
||||
|
||||
Reference in New Issue
Block a user