mipmaps
This commit is contained in:
@ -145,8 +145,8 @@ namespace ia::iae
|
||||
s_state.ColorTargetInfo.clear_color = SDL_FColor{clearColor.x, clearColor.y, clearColor.z, 1.0f};
|
||||
s_state.ColorTargetInfo.texture = s_renderTargetSceneColor;
|
||||
s_state.DepthStencilTargetInfo.texture = s_renderTargetSceneDepth;
|
||||
s_state.ActiveRenderPass = SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1,
|
||||
&s_state.DepthStencilTargetInfo);
|
||||
s_state.ActiveRenderPass =
|
||||
SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1, nullptr);
|
||||
|
||||
SDL_BindGPUGraphicsPipeline(s_state.ActiveRenderPass, s_geometryPipeline->GetHandle());
|
||||
SDL_PushGPUVertexUniformData(
|
||||
@ -185,8 +185,8 @@ namespace ia::iae
|
||||
SDL_BeginGPURenderPass(s_state.ActiveCommandBuffer, &s_state.ColorTargetInfo, 1, nullptr);
|
||||
SDL_BindGPUGraphicsPipeline(s_state.ActiveRenderPass, s_postprocessPipeline->GetHandle());
|
||||
SDL_GPUTextureSamplerBinding textureBindings[2] = {
|
||||
{.texture = s_renderTargetSceneColor, .sampler = GPUResourceManager::GetSampler_LinearRepeat()},
|
||||
{.texture = s_renderTargetDebugDrawColor, .sampler = GPUResourceManager::GetSampler_LinearRepeat()},
|
||||
{.texture = s_renderTargetSceneColor, .sampler = GPUResourceManager::GetSampler_LinearClamp()},
|
||||
{.texture = s_renderTargetDebugDrawColor, .sampler = GPUResourceManager::GetSampler_LinearClamp()},
|
||||
};
|
||||
SDL_BindGPUFragmentSamplers(s_state.ActiveRenderPass, 0, textureBindings, 2);
|
||||
SDL_DrawGPUPrimitives(s_state.ActiveRenderPass, 6, 1, 0, 0);
|
||||
@ -287,8 +287,11 @@ namespace ia::iae
|
||||
s_fragmentUniform.FlippedH = s_state.FlippedH;
|
||||
s_fragmentUniform.FlippedV = s_state.FlippedV;
|
||||
s_fragmentUniform.TextureOffset = s_state.TextureOffset;
|
||||
SDL_GPUTextureSamplerBinding textureBinding{.texture = s_state.ActiveTexture,
|
||||
.sampler = ((s_state.TextureOffset.x <= FLOAT32_EPSILON) && (s_state.TextureOffset.y <= FLOAT32_EPSILON)) ? GPUResourceManager::GetSampler_LinearClamp() : GPUResourceManager::GetSampler_LinearRepeat()};
|
||||
SDL_GPUTextureSamplerBinding textureBinding{
|
||||
.texture = s_state.ActiveTexture,
|
||||
.sampler = ((s_state.TextureOffset.x <= FLOAT32_EPSILON) && (s_state.TextureOffset.y <= FLOAT32_EPSILON))
|
||||
? GPUResourceManager::GetSampler_LinearClamp()
|
||||
: GPUResourceManager::GetSampler_LinearRepeat()};
|
||||
SDL_BindGPUFragmentSamplers(s_state.ActiveRenderPass, 0, &textureBinding, 1);
|
||||
SDL_PushGPUFragmentUniformData(s_state.ActiveCommandBuffer, 0, &s_fragmentUniform, sizeof(s_fragmentUniform));
|
||||
|
||||
@ -404,6 +407,19 @@ namespace ia::iae
|
||||
sizeof(Mat4));
|
||||
}
|
||||
|
||||
VOID Engine::SetRenderState_TransformUI(IN Vec2 position, IN Vec2 scale, IN FLOAT32 rotation)
|
||||
{
|
||||
Renderer::s_state.ModelMatrix =
|
||||
glm::translate(glm::mat4(1.0f), glm::vec3{position.x, position.y,
|
||||
static_cast<FLOAT32>(0xFF << 13)});
|
||||
Renderer::s_state.ModelMatrix =
|
||||
glm::rotate(Renderer::s_state.ModelMatrix, rotation, glm::vec3(0.0f, 0.0f, 1.0f));
|
||||
Renderer::s_state.ModelMatrix = glm::scale(Renderer::s_state.ModelMatrix, glm::vec3{scale.x, scale.y, 1.0f});
|
||||
|
||||
SDL_PushGPUVertexUniformData(Renderer::s_state.ActiveCommandBuffer, 2, &Renderer::s_state.ModelMatrix,
|
||||
sizeof(Mat4));
|
||||
}
|
||||
|
||||
VOID Engine::SetRenderState_YSortingEnabled(IN BOOL value)
|
||||
{
|
||||
Renderer::s_state.YSortingEnabled = value;
|
||||
|
||||
Reference in New Issue
Block a user