mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-31 20:51:12 -06:00
Tech ENABLE_GL_IMGUI_SHADERS - Render imgui using shaders
(cherry picked from commit prusa3d/PrusaSlicer@d0d89a4d5b)
This commit is contained in:
parent
8dc82e7a8d
commit
15bad7fc19
6 changed files with 140 additions and 41 deletions
11
resources/shaders/imgui.fs
Normal file
11
resources/shaders/imgui.fs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#version 110
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
varying vec2 Frag_UV;
|
||||
varying vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);
|
||||
}
|
||||
17
resources/shaders/imgui.vs
Normal file
17
resources/shaders/imgui.vs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#version 110
|
||||
|
||||
uniform mat4 ProjMtx;
|
||||
|
||||
attribute vec2 Position;
|
||||
attribute vec2 UV;
|
||||
attribute vec4 Color;
|
||||
|
||||
varying vec2 Frag_UV;
|
||||
varying vec4 Frag_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
Frag_UV = UV;
|
||||
Frag_Color = Color;
|
||||
gl_Position = ProjMtx * vec4(Position.xy, 0.0, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue