glsl

If a `buffer` is `coherent`, is there any difference between reading a field or doing `atomicAdd(field, 0)`?

半城伤御伤魂 提交于 2021-01-28 05:03:09
问题 This is with Vulkan semantics, if it makes any difference. Assume the following: layout(...) coherent buffer B { uint field; } b; Say the field is being modified by other invocations of the same shader (or a derived shader) through atomic*() funcions. If a shader invocation wants to perform an atomic read from this field (with the same semantics as atomicCounter() in GLES, had this been an atomic_uint instead), is there any difference between the following two (other than obviously that one

OpenGl blurring

倖福魔咒の 提交于 2021-01-27 07:15:03
问题 I'm using libgdx and want to make a common Gaussian blur post-processing effect. Following this guide I faced some issues with texture filtering. Here the images: actual image: blurred with radius = 1: blurred with radius = 5: In the simplest case, I just have a transparent frame buffer object with some objects rendered to it. Then I need to apply some shader effects to this, basically only blur and then render the result to the screen. I also want to adjust the blur radius, but if I set the

OpenGl blurring

亡梦爱人 提交于 2021-01-27 07:14:08
问题 I'm using libgdx and want to make a common Gaussian blur post-processing effect. Following this guide I faced some issues with texture filtering. Here the images: actual image: blurred with radius = 1: blurred with radius = 5: In the simplest case, I just have a transparent frame buffer object with some objects rendered to it. Then I need to apply some shader effects to this, basically only blur and then render the result to the screen. I also want to adjust the blur radius, but if I set the

Simple OpenTK Shader not working

会有一股神秘感。 提交于 2021-01-27 05:35:56
问题 I'm currently trying to get into GLSL using the OpenGL superbible and http://www.learnopengl.com/. My desired environment is OpenTK. I tried to convert the "Hello Triangle" entry level tutorial from learnopengl.com into OpenTK, it is meant to draw a triangle using very simple shaders, without using any perspective/world/model transformations. My result is just the colorbuffer, but else an empty window and i simply do not understand where i have made a mistake so any help in finding and more

Simple OpenTK Shader not working

我怕爱的太早我们不能终老 提交于 2021-01-27 05:35:08
问题 I'm currently trying to get into GLSL using the OpenGL superbible and http://www.learnopengl.com/. My desired environment is OpenTK. I tried to convert the "Hello Triangle" entry level tutorial from learnopengl.com into OpenTK, it is meant to draw a triangle using very simple shaders, without using any perspective/world/model transformations. My result is just the colorbuffer, but else an empty window and i simply do not understand where i have made a mistake so any help in finding and more

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] = {

OpenGL ignores Quads and makes them Triangles

假如想象 提交于 2020-12-21 02:47:51
问题 This is the second time I'm making a game engine, but I'm a little stuck right now, since I cannot figure out why this is happening, no matter what object I send, OpenGL only draws a White Triangle on the center of the screen, like this. I've even coppied my old code from my last engine on the Renderer and the Camera Objects, still acts the same, so I´m guessing it has something to do with the Render Script. Renderer: Renderer2D::Renderer2D(const Shader& shader) { this->shader = shader; this-

OpenGL ignores Quads and makes them Triangles

我与影子孤独终老i 提交于 2020-12-21 02:47:44
问题 This is the second time I'm making a game engine, but I'm a little stuck right now, since I cannot figure out why this is happening, no matter what object I send, OpenGL only draws a White Triangle on the center of the screen, like this. I've even coppied my old code from my last engine on the Renderer and the Camera Objects, still acts the same, so I´m guessing it has something to do with the Render Script. Renderer: Renderer2D::Renderer2D(const Shader& shader) { this->shader = shader; this-

OpenGL ignores Quads and makes them Triangles

时光毁灭记忆、已成空白 提交于 2020-12-21 02:47:40
问题 This is the second time I'm making a game engine, but I'm a little stuck right now, since I cannot figure out why this is happening, no matter what object I send, OpenGL only draws a White Triangle on the center of the screen, like this. I've even coppied my old code from my last engine on the Renderer and the Camera Objects, still acts the same, so I´m guessing it has something to do with the Render Script. Renderer: Renderer2D::Renderer2D(const Shader& shader) { this->shader = shader; this-