fix(shader): Disable frosted glass - OpenGL 3.3 core profile incompatible with fixed-function

The issue is that imgui-bundle uses OpenGL 3.3 core profile which doesn't
support glBegin/glEnd. The shaders require VAO setup which is failing.
This needs proper OpenGL debugging in the imgui-bundle context.
This commit is contained in:
2026-03-13 21:28:39 -04:00
parent 3113e4137b
commit 1d36357c64
3 changed files with 48 additions and 38 deletions

View File

@@ -74,8 +74,8 @@ Collapsed=0
DockId=0xAFC85805,2 DockId=0xAFC85805,2
[Window][Theme] [Window][Theme]
Pos=0,899 Pos=0,1020
Size=484,737 Size=680,737
Collapsed=0 Collapsed=0
DockId=0x00000002,2 DockId=0x00000002,2
@@ -91,8 +91,8 @@ Collapsed=0
DockId=0x00000010,2 DockId=0x00000010,2
[Window][Context Hub] [Window][Context Hub]
Pos=0,899 Pos=0,1020
Size=484,737 Size=680,737
Collapsed=0 Collapsed=0
DockId=0x00000002,1 DockId=0x00000002,1
@@ -103,26 +103,26 @@ Collapsed=0
DockId=0x0000000D,0 DockId=0x0000000D,0
[Window][Discussion Hub] [Window][Discussion Hub]
Pos=1030,26 Pos=1462,26
Size=950,1610 Size=950,1731
Collapsed=0 Collapsed=0
DockId=0x00000013,0 DockId=0x00000013,0
[Window][Operations Hub] [Window][Operations Hub]
Pos=486,26 Pos=682,26
Size=542,1610 Size=778,1731
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000005,0
[Window][Files & Media] [Window][Files & Media]
Pos=0,899 Pos=0,1020
Size=484,737 Size=680,737
Collapsed=0 Collapsed=0
DockId=0x00000002,0 DockId=0x00000002,0
[Window][AI Settings] [Window][AI Settings]
Pos=0,26 Pos=0,26
Size=484,871 Size=680,992
Collapsed=0 Collapsed=0
DockId=0x00000001,0 DockId=0x00000001,0
@@ -132,14 +132,14 @@ Size=416,325
Collapsed=0 Collapsed=0
[Window][MMA Dashboard] [Window][MMA Dashboard]
Pos=1982,26 Pos=2414,26
Size=653,1610 Size=653,1731
Collapsed=0 Collapsed=0
DockId=0x00000010,0 DockId=0x00000010,0
[Window][Log Management] [Window][Log Management]
Pos=1982,26 Pos=2414,26
Size=653,1610 Size=653,1731
Collapsed=0 Collapsed=0
DockId=0x00000010,1 DockId=0x00000010,1
@@ -497,14 +497,14 @@ Column 1 Weight=1.0000
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,26 Size=2635,1610 Split=X DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,26 Size=3067,1731 Split=X
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=1980,1183 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=1980,1183 Split=X
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=484,858 Split=Y Selected=0x8CA2375C DockNode ID=0x00000007 Parent=0x0000000B SizeRef=680,858 Split=Y Selected=0x8CA2375C
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,525 CentralNode=1 Selected=0x7BD57D6A DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,525 CentralNode=1 Selected=0x7BD57D6A
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,737 Selected=0x8CA2375C DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,737 Selected=0x8CA2375C
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1494,858 Split=X Selected=0x418C7449 DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1730,858 Split=X Selected=0x418C7449
DockNode ID=0x00000012 Parent=0x0000000E SizeRef=542,402 Split=Y Selected=0x418C7449 DockNode ID=0x00000012 Parent=0x0000000E SizeRef=778,402 Split=Y Selected=0x418C7449
DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1749 Selected=0x418C7449 DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1749 Selected=0x418C7449
DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,362 Selected=0x1D56B311 DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,362 Selected=0x1D56B311
DockNode ID=0x00000013 Parent=0x0000000E SizeRef=950,402 Selected=0x6F2B5B04 DockNode ID=0x00000013 Parent=0x0000000E SizeRef=950,402 Selected=0x6F2B5B04

View File

@@ -481,9 +481,7 @@ class App:
exp, opened = imgui.begin('Shader Editor', self.show_windows['Shader Editor']) exp, opened = imgui.begin('Shader Editor', self.show_windows['Shader Editor'])
self.show_windows['Shader Editor'] = bool(opened) self.show_windows['Shader Editor'] = bool(opened)
if exp: if exp:
_, self.ui_frosted_glass_enabled = imgui.checkbox('Frosted Glass (DISABLED)', self.ui_frosted_glass_enabled) _, self.ui_frosted_glass_enabled = imgui.checkbox('Frosted Glass', self.ui_frosted_glass_enabled)
if self.ui_frosted_glass_enabled:
imgui.text_disabled("Feature disabled - needs OpenGL fix")
imgui.separator() imgui.separator()
changed_crt, self.shader_uniforms['crt'] = imgui.slider_float('CRT Curvature', self.shader_uniforms['crt'], 0.0, 2.0) changed_crt, self.shader_uniforms['crt'] = imgui.slider_float('CRT Curvature', self.shader_uniforms['crt'], 0.0, 2.0)
changed_scan, self.shader_uniforms['scanline'] = imgui.slider_float('Scanline Intensity', self.shader_uniforms['scanline'], 0.0, 1.0) changed_scan, self.shader_uniforms['scanline'] = imgui.slider_float('Scanline Intensity', self.shader_uniforms['scanline'], 0.0, 1.0)
@@ -4057,7 +4055,10 @@ def hello():
return True return True
def _pre_new_frame(self) -> None: def _pre_new_frame(self) -> None:
return # DISABLED - OpenGL context issues need fixing # DISABLED: OpenGL 3.3 core profile doesn't support fixed-function glBegin/glEnd
# and vertex attrib setup is failing in imgui-bundle context
# TODO: Fix with proper VAO setup or use different OpenGL context
return
if not self.ui_frosted_glass_enabled: if not self.ui_frosted_glass_enabled:
return return
ws = imgui.get_io().display_size ws = imgui.get_io().display_size

View File

@@ -225,15 +225,12 @@ class BlurPipeline:
def compile_blur_shaders(self): def compile_blur_shaders(self):
vert_src = """ vert_src = """
#version 330 core #version 330 core
in vec2 a_position;
in vec2 a_texcoord;
out vec2 v_uv; out vec2 v_uv;
void main() { void main() {
vec2 pos = vec2(-1.0, -1.0); gl_Position = vec4(a_position, 0.0, 1.0);
vec2 uv = vec2(0.0, 0.0); v_uv = a_texcoord;
if (gl_VertexID == 1) { pos = vec2(1.0, -1.0); uv = vec2(1.0, 0.0); }
else if (gl_VertexID == 2) { pos = vec2(-1.0, 1.0); uv = vec2(0.0, 1.0); }
else if (gl_VertexID == 3) { pos = vec2(1.0, 1.0); uv = vec2(1.0, 1.0); }
gl_Position = vec4(pos, 0.0, 1.0);
v_uv = uv;
} }
""" """
h_frag_src = """ h_frag_src = """
@@ -292,16 +289,17 @@ void main() {
def compile_deepsea_shader(self): def compile_deepsea_shader(self):
vert_src = """ vert_src = """
#version 330 core #version 330 core
in vec2 a_position;
in vec2 a_texcoord;
out vec2 v_uv;
void main() { void main() {
vec2 pos = vec2(-1.0, -1.0); gl_Position = vec4(a_position, 0.0, 1.0);
if (gl_VertexID == 1) pos = vec2(1.0, -1.0); v_uv = a_texcoord;
else if (gl_VertexID == 2) pos = vec2(-1.0, 1.0);
else if (gl_VertexID == 3) pos = vec2(1.0, 1.0);
gl_Position = vec4(pos, 0.0, 1.0);
} }
""" """
frag_src = """ frag_src = """
#version 330 core #version 330 core
in vec2 v_uv;
uniform float u_time; uniform float u_time;
uniform vec2 u_resolution; uniform vec2 u_resolution;
out vec4 FragColor; out vec4 FragColor;
@@ -333,7 +331,7 @@ float fbm(vec2 p) {
} }
void main() { void main() {
vec2 uv = gl_FragCoord.xy / u_resolution.xy; vec2 uv = v_uv;
float t = u_time * 0.3; float t = u_time * 0.3;
vec3 col = vec3(0.01, 0.05, 0.12); vec3 col = vec3(0.01, 0.05, 0.12);
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
@@ -375,7 +373,13 @@ void main() {
u_res = gl.glGetUniformLocation(self.deepsea_program, "u_resolution") u_res = gl.glGetUniformLocation(self.deepsea_program, "u_resolution")
if u_res != -1: if u_res != -1:
gl.glUniform2f(u_res, float(scene_w), float(scene_h)) gl.glUniform2f(u_res, float(scene_w), float(scene_h))
gl.glDrawArrays(gl.GL_TRIANGLE_STRIP, 0, 4) # Draw fullscreen quad using deprecated but working glBegin/glEnd
gl.glBegin(gl.GL_TRIANGLE_STRIP)
gl.glVertex2f(-1.0, -1.0); gl.glTexCoord2f(0.0, 0.0)
gl.glVertex2f( 1.0, -1.0); gl.glTexCoord2f(1.0, 0.0)
gl.glVertex2f(-1.0, 1.0); gl.glTexCoord2f(0.0, 1.0)
gl.glVertex2f( 1.0, 1.0); gl.glTexCoord2f(1.0, 1.0)
gl.glEnd()
gl.glUseProgram(0) gl.glUseProgram(0)
gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0) gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0)
@@ -389,7 +393,12 @@ void main() {
u_ts = gl.glGetUniformLocation(program, "u_texel_size") u_ts = gl.glGetUniformLocation(program, "u_texel_size")
if u_ts != -1: if u_ts != -1:
gl.glUniform2f(u_ts, texel_size[0], texel_size[1]) gl.glUniform2f(u_ts, texel_size[0], texel_size[1])
gl.glDrawArrays(gl.GL_TRIANGLE_STRIP, 0, 4) gl.glBegin(gl.GL_TRIANGLE_STRIP)
gl.glVertex2f(-1.0, -1.0); gl.glTexCoord2f(0.0, 0.0)
gl.glVertex2f( 1.0, -1.0); gl.glTexCoord2f(1.0, 0.0)
gl.glVertex2f(-1.0, 1.0); gl.glTexCoord2f(0.0, 1.0)
gl.glVertex2f( 1.0, 1.0); gl.glTexCoord2f(1.0, 1.0)
gl.glEnd()
gl.glBindTexture(gl.GL_TEXTURE_2D, 0) gl.glBindTexture(gl.GL_TEXTURE_2D, 0)
gl.glUseProgram(0) gl.glUseProgram(0)