framebuffer

Opengl and Webgl: sampling from a texture attached to current framebuffer

巧了我就是萌 提交于 2020-06-23 12:37:05
问题 I have a framebuffer with two textures t0 and t1 attached. On the first pass I render to both of them with multiple fragment shader output. Before the second pass I do thew following: Turn on a shader with one output only Bind t1 to a texture unit call glDrawBuffers to disable writing to t1 's attachment Note that t1 is used for sampling, but it's still bound to current framebuffer. As I understand, there are no loopbacks in such configuration. Is it legal in both OpenGL and WebGL? I made an

mmap /dev/fb0 fails with “Invalid argument”

我的未来我决定 提交于 2020-06-12 06:04:53
问题 I have an embedded system and want to use /dev/fb0 directly. As a first test, I use some code based on example-code found everywhere in the net and SO. Opening succeeds, also fstat and similar. But mmap fails with EINVAL. Source: #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <fcntl.h> #include <linux/fb.h> #include <sys/mman.h> #include <sys/ioctl.h> int main() { int fbfd = 0; struct fb_var_screeninfo vinfo; struct fb_fix_screeninfo finfo; long int screensize = 0; char

WebGL: using framebuffers for picking multiple objects

非 Y 不嫁゛ 提交于 2020-01-25 11:53:27
问题 I am trying to implement picking in WebGL. I have a lot of objects (around 500), and I'd like each one to be allowed to be picked. In order to do that, I did a loop which assigns a unique colour to each object (cf. picking principle): for (var i = 0, len = objects.length; i < len; i++) { framecolors[count++] = i % 256 / 256; //Red framecolors[count++] = Math.floor(i/256) / 256; //Green framecolors[count++] = Math.floor(i/(256*256)) / 256; //Blue } framecolors was then used in a classical

How to display image on secondary monitor in full screen?

隐身守侯 提交于 2020-01-16 08:55:12
问题 How can I use PyQt5/PySide or any other Python library to display a desired image on a secondary monitor in full-screen mode? In the past, I used a framebuffer image viewer (Fbi and Fbi improved). However, this approach requires me to use Linux. I prefer to work in Windows and preferably find a solution using Python. Motivation/Context I am working on a DLP projection based 3D printing process. When I connect a DLP projector to my Windows PC using HDMI, it shows up as a second monitor. I want

opengl - framebuffer texture clipped smaller than I set it?

谁说我不能喝 提交于 2020-01-15 03:40:12
问题 I'm using opengl ES 2.0 I'm using a framebuffer linked to a texture to compile an offscreen render (of some simplistic metaballs), and then I'm rendering that texture to the main back buffer. Everything is looking great except that the texture appears clipped, ie. it is not the full window dimensions (short of about 128 pixels on one axis). Here's a screenshot: http://tinypic.com/r/9telwg/7 Any ideas what could cause this? I read here to set glViewport to the size of the texture, but that

QOpenGLWidget with custom framebuffer and multiple render targets

人走茶凉 提交于 2020-01-14 19:20:39
问题 Related to my other question, I'm trying to render a segmentation mask to enable object picking. But I am not able to achieve the desired result. Option 1 did not work at all. I was not able to retrieve the content of color attachment 1, or check if it existed at all (I created the attachment using only native OpenGL calls). Using this post, I was able to reproduce the green.png and red.png images by creating a custom frame buffer with a second color attachment which is then bound and drawn

SDL2 on Raspberry Pi without X?

自古美人都是妖i 提交于 2020-01-13 19:52:27
问题 I'm hoping to develop some code that uses SDL2 to display graphics on the 7" RPi touchscreen, but I'd rather not install a full desktop OS. I've got Raspbian Buster Lite installed. Some simple test code gets an error when I try to run it: user@rpi4:~/01_hello_SDL $ ./hw Window could not be created! SDL_Error: Could not initialize EGL user@rpi4:~/01_hello_SDL $ sudo ./hw error: XDG_RUNTIME_DIR not set in the environment. Window could not be created! SDL_Error: Could not initialize EGL I'm

SDL2 on Raspberry Pi without X?

大憨熊 提交于 2020-01-13 19:52:05
问题 I'm hoping to develop some code that uses SDL2 to display graphics on the 7" RPi touchscreen, but I'd rather not install a full desktop OS. I've got Raspbian Buster Lite installed. Some simple test code gets an error when I try to run it: user@rpi4:~/01_hello_SDL $ ./hw Window could not be created! SDL_Error: Could not initialize EGL user@rpi4:~/01_hello_SDL $ sudo ./hw error: XDG_RUNTIME_DIR not set in the environment. Window could not be created! SDL_Error: Could not initialize EGL I'm