fragment-shader

Temporal filtering on depth image

前提是你 提交于 2021-02-11 15:08:36
问题 I'm reading the following paper and I'm trying to implement it, but it seems I'm not understanding fully the paper. https://vcg.informatik.uni-rostock.de/~malub/publications/2016_depthenhance/16_ARLS_depthenhancement.pdf I have calculated optical flow and some history of the depth images, and took the a linear average over the history samples as shown in the shader code. What I get is an image that has holes however the original one doesn't have any holes. Current filtered image Shader

How to save a value inside a fragment shader to use it later?

自古美人都是妖i 提交于 2021-02-07 13:40:58
问题 I want to save a calculated value from fragment shader in some variable ,so that I would be able to use it next time. Currently, I am preparing a image using a huge algorithm and I want to save it to some vec4 and , once requested again , I want to just get that vec4 and should say gl_FragColor = vec4(previously saved variable) This question is related to another question here which is also asked by me , but I feel that if this question has a answer then I can easily crack the other one. Any

Pyglet shaders not working, keep erroring

五迷三道 提交于 2021-01-29 09:03:01
问题 so i am following a tutorial series on pyglet but i cant make shaders because it causes errors v Traceback (most recent call last): File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 20, in <module> window=window1(1280, 720,"tutorial", resizable=True) File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 9, in __init__ self.triangle=Triangle() File "/home/awesomenoob/Coding/Python/Triangle.py", line 52, in __init__ glUseProgram(shader) File "/home/awesomenoob/.local

Pyglet shaders not working, keep erroring

空扰寡人 提交于 2021-01-05 07:07:48
问题 so i am following a tutorial series on pyglet but i cant make shaders because it causes errors v Traceback (most recent call last): File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 20, in <module> window=window1(1280, 720,"tutorial", resizable=True) File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 9, in __init__ self.triangle=Triangle() File "/home/awesomenoob/Coding/Python/Triangle.py", line 52, in __init__ glUseProgram(shader) File "/home/awesomenoob/.local

OpenGL 3.0 Framebuffer outputting to attachments without me specifying?

本小妞迷上赌 提交于 2020-12-26 08:33:18
问题 Ok so I have a framebuffer with a bunch of attachments attached. The attachments are Color, Bloom, Velocity and Depth. I start by clearing the framebuffer to the values of my choosing with the following code. // Clear Color Buffer float colorDefaultValue[4] = { 0.5, 0.5, 0.5, 1.0 }; glClearBufferfv(GL_COLOR, 0, colorDefaultValue); // Clear Bloom Buffer float bloomDefaultValue[4] = { 0.0, 0.0, 1.0, 1.0 }; glClearBufferfv(GL_COLOR, 1, bloomDefaultValue); // Clear Depth Buffer float depth[1] = {

OpenGL 3.0 Framebuffer outputting to attachments without me specifying?

旧街凉风 提交于 2020-12-26 08:33:17
问题 Ok so I have a framebuffer with a bunch of attachments attached. The attachments are Color, Bloom, Velocity and Depth. I start by clearing the framebuffer to the values of my choosing with the following code. // Clear Color Buffer float colorDefaultValue[4] = { 0.5, 0.5, 0.5, 1.0 }; glClearBufferfv(GL_COLOR, 0, colorDefaultValue); // Clear Bloom Buffer float bloomDefaultValue[4] = { 0.0, 0.0, 1.0, 1.0 }; glClearBufferfv(GL_COLOR, 1, bloomDefaultValue); // Clear Depth Buffer float depth[1] = {

Drawing a triangle in OpenGL fragment shader

不问归期 提交于 2020-11-29 23:50:37
问题 I'm trying to draw a triangle using an OpenGL fragment shader. I succeeded in drawing a circle but I have a problem with handling the equation/logic or the code to draw a triangle. draw_triangle(vec2 v1 , vec2 v2, vec2 v3) Here is the fragment shader: #version 330 core out vec4 frag_color; void draw_circle(vec2 shift_val, int radius,int color) { vec2 res = vec2(1280,720); vec2 norm_cord = gl_FragCoord.xy; float dist = length(norm_cord - (res*shift_val)); if( dist < radius ) { if( color ==1 )

Drawing a triangle in OpenGL fragment shader

淺唱寂寞╮ 提交于 2020-11-29 23:46:23
问题 I'm trying to draw a triangle using an OpenGL fragment shader. I succeeded in drawing a circle but I have a problem with handling the equation/logic or the code to draw a triangle. draw_triangle(vec2 v1 , vec2 v2, vec2 v3) Here is the fragment shader: #version 330 core out vec4 frag_color; void draw_circle(vec2 shift_val, int radius,int color) { vec2 res = vec2(1280,720); vec2 norm_cord = gl_FragCoord.xy; float dist = length(norm_cord - (res*shift_val)); if( dist < radius ) { if( color ==1 )

Drawing a triangle in OpenGL fragment shader

笑着哭i 提交于 2020-11-29 23:43:16
问题 I'm trying to draw a triangle using an OpenGL fragment shader. I succeeded in drawing a circle but I have a problem with handling the equation/logic or the code to draw a triangle. draw_triangle(vec2 v1 , vec2 v2, vec2 v3) Here is the fragment shader: #version 330 core out vec4 frag_color; void draw_circle(vec2 shift_val, int radius,int color) { vec2 res = vec2(1280,720); vec2 norm_cord = gl_FragCoord.xy; float dist = length(norm_cord - (res*shift_val)); if( dist < radius ) { if( color ==1 )

Drawing a triangle in OpenGL fragment shader

有些话、适合烂在心里 提交于 2020-11-29 23:42:47
问题 I'm trying to draw a triangle using an OpenGL fragment shader. I succeeded in drawing a circle but I have a problem with handling the equation/logic or the code to draw a triangle. draw_triangle(vec2 v1 , vec2 v2, vec2 v3) Here is the fragment shader: #version 330 core out vec4 frag_color; void draw_circle(vec2 shift_val, int radius,int color) { vec2 res = vec2(1280,720); vec2 norm_cord = gl_FragCoord.xy; float dist = length(norm_cord - (res*shift_val)); if( dist < radius ) { if( color ==1 )