- App/editor: Hierarchy/Inspector/Viewport/Stats 四面板 + DockBuilder 默认布局,main.cpp 瘦身为场景搭建与生命周期 - 显示链: Tonemap→PresentTarget 经 ImGui::Image 呈现(零色偏),backbuffer 仅承载 ImGui;Direct/Viewport 双显示模式 + 面板分辨率上报 - 帧首同步 BeginFrameSync: resize/vsync/尺寸/模式意图统一帧首落定(修描述符悬垂);修复 vsync 意图未落 swapchain 导致的每帧重建交换链 - 输入: Editor 每帧判定键盘/鼠标归属(打字让位、Viewport hover/focus 放行、Fullscreen 全放行) - 材质: roughness 独立槽位 + 非 glTF 金属/粗糙贴图映射;透明队列 depthWrite=FALSE + translucent 独立 shader + scratch 清帧 - FBX: 非蒙皮网格烘焙节点链全局变换(Z-up 旋转/单位换算落顶点) - Hierarchy 行 ImGui ID 以 UUID 作用域(重名不冲突、改名不丢选中)
27 lines
855 B
C++
27 lines
855 B
C++
//
|
|
// ViewportPanel:场景渲染输出面板。
|
|
//
|
|
// tonemap 输出经 ImGui::Image 显示(Editor 模式),并提供
|
|
// Editor Viewport / Fullscreen 显示模式切换。面板可用区域
|
|
// (物理像素)上报为渲染分辨率 → 画面精确填满面板。
|
|
//
|
|
|
|
#ifndef HELLOVULKAN_VIEWPORTPANEL_H
|
|
#define HELLOVULKAN_VIEWPORTPANEL_H
|
|
|
|
#include "EditorContext.h"
|
|
|
|
// Viewport 面板每帧上报的输入焦点状态(Hazel 模式:编辑器据此决定
|
|
// 游戏侧输入是否放行——悬停/持焦 Viewport 才拥有 WASD/鼠标)
|
|
struct ViewportInputState {
|
|
bool hovered = false; // 鼠标悬停在 Viewport 面板上
|
|
bool focused = false; // Viewport 面板持有键盘焦点
|
|
};
|
|
|
|
class ViewportPanel {
|
|
public:
|
|
void Draw(const EditorContext& ctx, ViewportInputState& out);
|
|
};
|
|
|
|
#endif //HELLOVULKAN_VIEWPORTPANEL_H
|