Skip to content

Commit

Permalink
[OpenGL] fix #1128
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Nov 13, 2023
1 parent ad3d66a commit 957bc34
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ namespace s3d
::glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

// ミップマップ無し
{
::glBindTexture(GL_TEXTURE_2D, texture);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
}

p->m_frameBuffer = frameBuffer;
p->m_texture = texture;
p->m_sampleCount = sampleCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ namespace s3d
//
//////////////////////////////////////////////////

if (m_sampler)
{
::glDeleteSamplers(1, &m_sampler);
m_sampler = 0;
}

if (m_vertexArray)
{
::glDeleteVertexArrays(1, &m_vertexArray);
Expand Down Expand Up @@ -133,11 +127,6 @@ namespace s3d
{
::glGenVertexArrays(1, &m_vertexArray);
::glBindVertexArray(m_vertexArray);

::glGenSamplers(1, &m_sampler);
::glSamplerParameteri(m_sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
::glSamplerParameteri(m_sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
::glSamplerParameteri(m_sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
}

CheckOpenGLError();
Expand Down Expand Up @@ -1451,10 +1440,10 @@ namespace s3d
// render states
{
const bool linearFilter = (textureFilter == TextureFilter::Linear);
::glBindSampler(0, m_sampler);
::glSamplerParameteri(m_sampler, GL_TEXTURE_MIN_FILTER, linearFilter ? GL_LINEAR : GL_NEAREST);
::glSamplerParameteri(m_sampler, GL_TEXTURE_MAG_FILTER, linearFilter ? GL_LINEAR : GL_NEAREST);

SamplerState samplerState = linearFilter ? SamplerState::ClampLinear : SamplerState::ClampNearest;
//samplerState.mip = TextureFilter::Nearest;

pRenderer->getSamplerState().setPS(0, samplerState);
pRenderer->getBlendState().set(BlendState::Opaque);
pRenderer->getRasterizerState().set(RasterizerState::Default2D);
pShader->setVS(m_standardVS->fullscreen_triangle.id());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ namespace s3d
//
//////////////////////////////////////////////////
GLuint m_vertexArray = 0;
GLuint m_sampler = 0;

// VertexBuilder でのメモリアロケーションを避けるためのバッファ
Array<Float2> m_buffer;
Expand Down

0 comments on commit 957bc34

Please sign in to comment.