This commit is contained in:
Benau 2017-02-13 00:45:18 +08:00
parent ca0a605b0e
commit d3cbc6ca0e
4 changed files with 17 additions and 4 deletions

View File

@ -91,6 +91,7 @@ public:
// ============================================================================
/** */
#if !defined(USE_GLES2)
class HeightmapSimulationShader :
public TextureShader<HeightmapSimulationShader, 1,
core::matrix4, int, int,
@ -110,6 +111,7 @@ public:
}; // class HeightmapSimulationShader
#endif
// ============================================================================

View File

@ -56,7 +56,7 @@ public:
} // bindVertexArray
}; // SkyboxShader
#if !defined(USE_GLES2)
class SpecularIBLGenerator : public TextureShader<SpecularIBLGenerator, 2,
core::matrix4, float >
{
@ -70,7 +70,7 @@ public:
1, "samples", ST_TEXTURE_BUFFER);
}
}; // SpecularIBLGenerator
#endif
namespace {
// ----------------------------------------------------------------------------

View File

@ -47,8 +47,11 @@ GLuint TextureShaderBase::m_all_texture_types[] =
/* ST_VOLUME_LINEAR_FILTERED */ GL_TEXTURE_3D,
/* ST_NEARED_CLAMPED_FILTERED */ GL_TEXTURE_2D,
/* ST_BILINEAR_CLAMPED_FILTERED */ GL_TEXTURE_2D,
/* ST_SEMI_TRILINEAR */ GL_TEXTURE_2D,
/* ST_TEXTURE_BUFFER */ GL_TEXTURE_BUFFER
/* ST_SEMI_TRILINEAR */ GL_TEXTURE_2D
#ifndef USE_GLES2
/* ST_TEXTURE_BUFFER */, GL_TEXTURE_BUFFER
#endif
};
// ----------------------------------------------------------------------------
@ -120,8 +123,10 @@ void TextureShaderBase::bindTextureNearestClamped(GLuint texture_unit,
// ----------------------------------------------------------------------------
void TextureShaderBase::bindTextureBuffer(GLuint texture_unit, GLuint tex_id)
{
#ifndef USE_GLES2
glActiveTexture(GL_TEXTURE0 + texture_unit);
glBindTexture(GL_TEXTURE_BUFFER, tex_id);
#endif
} // bindTextureBuffer
// ----------------------------------------------------------------------------
@ -246,8 +251,10 @@ GLuint TextureShaderBase::createSamplers(SamplerTypeNew sampler_type)
return createBilinearClampedSampler();
case ST_SEMI_TRILINEAR:
return createSemiTrilinearSampler();
#ifndef USE_GLES2
case ST_TEXTURE_BUFFER:
return 0;
#endif
default:
assert(false);
return 0;

View File

@ -43,8 +43,12 @@ enum SamplerTypeNew
ST_NEARED_CLAMPED_FILTERED,
ST_BILINEAR_CLAMPED_FILTERED,
ST_SEMI_TRILINEAR,
#ifdef USE_GLES2
ST_MAX = ST_SEMI_TRILINEAR
#else
ST_TEXTURE_BUFFER,
ST_MAX = ST_TEXTURE_BUFFER
#endif
}; // SamplerTypeNew
// ============================================================================