mouse0w0 / mouse0w0.github.io

https://mouse0w0.github.io
5 stars 0 forks source link

OpenGL在一定区域中渲染2D图形 | 耗子的博客 #15

Open mouse0w0 opened 5 years ago

mouse0w0 commented 5 years ago

https://mouse0w0.github.io/2018/10/04/OpenGL-render-2D-graphics-in-a-region/

要实现该功能只需修改片元着色器,其核心代码如下: 1234567891011121314#version 330 core// ins and outs ...// uniforms...uniform vec4 region;void main() { if(gl_FragCoord.x < region.x || gl_FragCoord.x > region.z