This commit is contained in:
Junkui Zhang 2025-07-16 22:58:51 +08:00
parent 0d8600bf1e
commit 32758022df
2 changed files with 4 additions and 4 deletions

View file

@ -19,7 +19,8 @@ use windows::{
use crate::*;
const RENDER_TARGET_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM;
const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
// const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM;
pub(crate) struct DirectXRenderer {
atlas: Arc<DirectXAtlas>,
@ -1200,7 +1201,6 @@ fn set_rasterizer_state(device: &ID3D11Device, device_context: &ID3D11DeviceCont
let desc = D3D11_RASTERIZER_DESC {
FillMode: D3D11_FILL_SOLID,
CullMode: D3D11_CULL_NONE,
// FrontCounterClockwise: true.into(),
FrontCounterClockwise: false.into(),
DepthBias: 0,
DepthBiasClamp: 0.0,

View file

@ -342,8 +342,8 @@ float4 gradient_color(Background background,
}
// Get the t value for the linear gradient with the color stop percentages.
float2 half_size = float2(bounds.size.x, bounds.size.y) / 2.;
float2 center = float2(bounds.origin.x, bounds.origin.y) + half_size;
float2 half_size = bounds.size * 0.5;
float2 center = bounds.origin + half_size;
float2 center_to_point = position - center;
float t = dot(center_to_point, direction) / length(direction);
// Check the direct to determine the use x or y