diff --git a/shaders/voxelAOApplyCS.hlsl b/shaders/voxelAOApplyCS.hlsl index 16a1865..947ce78 100644 --- a/shaders/voxelAOApplyCS.hlsl +++ b/shaders/voxelAOApplyCS.hlsl @@ -55,12 +55,13 @@ float3 computeSky(float2 uv) { sky = lerp(horizonColor, nadirColor, h); } - // Sun glow near sun direction (soft halo) + // Sun glow near sun direction (compact disc + subtle haze) float3 L = normalize(-sunDirection.xyz); float sunDot = saturate(dot(viewDir, L)); - float sunGlow = pow(sunDot, 32.0) * 0.4; - float sunHaze = pow(sunDot, 4.0) * 0.15; - sky += float3(1.0, 0.85, 0.5) * (sunGlow + sunHaze); + float sunDisc = pow(sunDot, 256.0) * 0.6; // tight bright disc + float sunGlow = pow(sunDot, 64.0) * 0.2; // narrow glow ring + float sunHaze = pow(sunDot, 8.0) * 0.08; // subtle atmospheric haze + sky += float3(1.0, 0.85, 0.5) * (sunDisc + sunGlow + sunHaze); return sky; } diff --git a/src/app/main.cpp b/src/app/main.cpp index d3a4d62..265b3a3 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -139,19 +139,29 @@ int APIENTRY wWinMain( wcex.lpszClassName = L"BVLEVoxels"; RegisterClassExW(&wcex); - // Screenshot mode: small minimized window to avoid interrupting user + // Compute window size so the client area is exactly 1920x1080 + DWORD style = WS_OVERLAPPEDWINDOW; + int clientW = isScreenshot ? 640 : 1920; + int clientH = isScreenshot ? 480 : 1080; + RECT rc = { 0, 0, clientW, clientH }; + AdjustWindowRect(&rc, style, FALSE); + int windowW = rc.right - rc.left; + int windowH = rc.bottom - rc.top; + + // Center on screen + int screenW = GetSystemMetrics(SM_CXSCREEN); + int screenH = GetSystemMetrics(SM_CYSCREEN); + int posX = isScreenshot ? 0 : (screenW - windowW) / 2; + int posY = isScreenshot ? 0 : (screenH - windowH) / 2; + HWND hWnd = CreateWindowW( wcex.lpszClassName, isScreenshot ? L"BVLE Screenshot" : L"BVLE Voxels - Prototype", - WS_OVERLAPPEDWINDOW, - isScreenshot ? 0 : CW_USEDEFAULT, - isScreenshot ? 0 : 0, - isScreenshot ? 640 : 1920, - isScreenshot ? 480 : 1080, + style, + posX, posY, windowW, windowH, nullptr, nullptr, hInstance, nullptr ); - // SW_SHOWNOACTIVATE: visible but doesn't steal focus (minimized windows don't render) - ShowWindow(hWnd, isScreenshot ? SW_SHOWNOACTIVATE : SW_SHOWMAXIMIZED); + ShowWindow(hWnd, isScreenshot ? SW_SHOWNOACTIVATE : SW_SHOW); // Initialize Wicked Engine application.SetWindow(hWnd); diff --git a/src/voxel/VoxelRenderer.cpp b/src/voxel/VoxelRenderer.cpp index a3864ea..831f41e 100644 --- a/src/voxel/VoxelRenderer.cpp +++ b/src/voxel/VoxelRenderer.cpp @@ -1433,6 +1433,14 @@ void VoxelRenderPath::Update(float dt) { renderer.debugBlend_ = !renderer.debugBlend_; wi::backlog::post(renderer.debugBlend_ ? "Blend debug: ON" : "Blend debug: OFF"); } + if (wi::input::Press(wi::input::KEYBOARD_BUTTON_F6)) { + // In-app screenshot: saves voxelRT_ directly (immune to HDR/SDR mismatch) + static int screenshotIdx = 0; + char fname[64]; + snprintf(fname, sizeof(fname), "bvle_screenshot_%03d.png", screenshotIdx++); + wi::helper::saveTextureToFile(voxelRT_, fname); + wi::backlog::post(std::string("Screenshot saved: ") + fname); + } if (wi::input::Press(wi::input::KEYBOARD_BUTTON_F5)) { if (!renderer.rt_.isShadowsEnabled()) { renderer.rt_.setShadowsEnabled(true); renderer.rt_.setShadowDebug(0);