remove redundant vertexRounding uniform from interface shader

interface is always drawn without super-sampling anyway
This commit is contained in:
Kae 2024-06-26 13:03:30 +10:00
parent c405fda45c
commit 563d95b9e6
3 changed files with 2 additions and 16 deletions

View File

@ -1,13 +1,7 @@
{ {
"blitFrameBuffer" : "main", "blitFrameBuffer" : "main",
"effectParameters" : { "effectParameters" : {},
"vertexRounding" : {
"type" : "bool",
"default" : false,
"uniform" : "vertexRounding"
}
},
"effectTextures" : {}, "effectTextures" : {},
"effectShaders" : { "effectShaders" : {

View File

@ -6,7 +6,6 @@ uniform vec2 textureSize2;
uniform vec2 textureSize3; uniform vec2 textureSize3;
uniform vec2 screenSize; uniform vec2 screenSize;
uniform mat3 vertexTransform; uniform mat3 vertexTransform;
uniform bool vertexRounding;
in vec2 vertexPosition; in vec2 vertexPosition;
in vec4 vertexColor; in vec4 vertexColor;
@ -21,13 +20,6 @@ void main() {
vec2 screenPosition = (vertexTransform * vec3(vertexPosition, 1.0)).xy; vec2 screenPosition = (vertexTransform * vec3(vertexPosition, 1.0)).xy;
gl_Position = vec4(screenPosition / screenSize * 2.0 - 1.0, 0.0, 1.0); gl_Position = vec4(screenPosition / screenSize * 2.0 - 1.0, 0.0, 1.0);
if (vertexRounding) {
if (((vertexData >> 3) & 0x1) == 1)
screenPosition.x = round(screenPosition.x);
if (((vertexData >> 4) & 0x1) == 1)
screenPosition.y = round(screenPosition.y);
}
int vertexTextureIndex = vertexData & 0x3; int vertexTextureIndex = vertexData & 0x3;
if (vertexTextureIndex == 3) if (vertexTextureIndex == 3)
fragmentTextureCoordinate = vertexTextureCoordinate / textureSize3; fragmentTextureCoordinate = vertexTextureCoordinate / textureSize3;

View File

@ -254,7 +254,7 @@ void OpenGlRenderer::loadEffectConfig(String const& name, Json const& effectConf
effectParameter.parameterUniform = glGetUniformLocation(m_program, p.second.getString("uniform").utf8Ptr()); effectParameter.parameterUniform = glGetUniformLocation(m_program, p.second.getString("uniform").utf8Ptr());
if (effectParameter.parameterUniform == -1) { if (effectParameter.parameterUniform == -1) {
Logger::warn("OpenGL20 effect parameter '{}' has no associated uniform, skipping", p.first); Logger::warn("OpenGL20 effect parameter '{}' in effect '{}' has no associated uniform, skipping", p.first, name);
} else { } else {
String type = p.second.getString("type"); String type = p.second.getString("type");
if (type == "bool") { if (type == "bool") {