mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-27 16:02:17 +00:00
Fix TBO norm issues on old GPUs
This commit is contained in:
parent
aa4ec53bb6
commit
0e5fd4e8e0
@ -155,3 +155,8 @@ Bump JEI/crafttweaker versions
|
|||||||
|
|
||||||
In my defence, they weren't out when I started the 1.15 update.
|
In my defence, they weren't out when I started the 1.15 update.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
bf6053906dc6a3c7b0d40d5b097e745dce1f33bc
|
||||||
|
Fix TBO norm issues on old GPUs
|
||||||
|
```
|
||||||
|
@ -80,7 +80,7 @@ public final class ClientMonitor extends ClientTerminal {
|
|||||||
GL15.glBufferData(GL31.GL_TEXTURE_BUFFER, 0, GL15.GL_STATIC_DRAW);
|
GL15.glBufferData(GL31.GL_TEXTURE_BUFFER, 0, GL15.GL_STATIC_DRAW);
|
||||||
this.tboTexture = GlStateManager.genTextures();
|
this.tboTexture = GlStateManager.genTextures();
|
||||||
GL11.glBindTexture(GL31.GL_TEXTURE_BUFFER, this.tboTexture);
|
GL11.glBindTexture(GL31.GL_TEXTURE_BUFFER, this.tboTexture);
|
||||||
GL31.glTexBuffer(GL31.GL_TEXTURE_BUFFER, GL30.GL_R8, this.tboBuffer);
|
GL31.glTexBuffer(GL31.GL_TEXTURE_BUFFER, GL30.GL_R8UI, this.tboBuffer);
|
||||||
GL11.glBindTexture(GL31.GL_TEXTURE_BUFFER, 0);
|
GL11.glBindTexture(GL31.GL_TEXTURE_BUFFER, 0);
|
||||||
|
|
||||||
GlStateManager.bindBuffers(GL31.GL_TEXTURE_BUFFER, 0);
|
GlStateManager.bindBuffers(GL31.GL_TEXTURE_BUFFER, 0);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
uniform sampler2D u_font;
|
uniform sampler2D u_font;
|
||||||
uniform int u_width;
|
uniform int u_width;
|
||||||
uniform int u_height;
|
uniform int u_height;
|
||||||
uniform samplerBuffer u_tbo;
|
uniform usamplerBuffer u_tbo;
|
||||||
uniform vec3 u_palette[16];
|
uniform vec3 u_palette[16];
|
||||||
|
|
||||||
in vec2 f_pos;
|
in vec2 f_pos;
|
||||||
@ -30,9 +30,9 @@ void main() {
|
|||||||
vec2 outside = step(vec2(0.0, 0.0), vec2(cell)) * step(vec2(cell), vec2(float(u_width) - 1.0, float(u_height) - 1.0));
|
vec2 outside = step(vec2(0.0, 0.0), vec2(cell)) * step(vec2(cell), vec2(float(u_width) - 1.0, float(u_height) - 1.0));
|
||||||
float mult = outside.x * outside.y;
|
float mult = outside.x * outside.y;
|
||||||
|
|
||||||
int character = int(texelFetch(u_tbo, index).r * 255.0);
|
int character = int(texelFetch(u_tbo, index).r);
|
||||||
int fg = int(texelFetch(u_tbo, index + 1).r * 255.0);
|
int fg = int(texelFetch(u_tbo, index + 1).r);
|
||||||
int bg = int(texelFetch(u_tbo, index + 2).r * 255.0);
|
int bg = int(texelFetch(u_tbo, index + 2).r);
|
||||||
|
|
||||||
vec2 pos = (term_pos - corner) * vec2(FONT_WIDTH, FONT_HEIGHT);
|
vec2 pos = (term_pos - corner) * vec2(FONT_WIDTH, FONT_HEIGHT);
|
||||||
vec4 img = texture(u_font, (texture_corner(character) + pos) / 256.0);
|
vec4 img = texture(u_font, (texture_corner(character) + pos) / 256.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user