Go to advanced search

by paddyg
Tue Nov 12, 2019 12:30 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Just tried https://github.com/paddywwoof/rust_pi3d on gentoo64 and it seems to render fine. The Rust version uses SDL2 so that looks to be the simplest option - to crank pi3d over to SDL. That will probably be a fairly major mod (though non-breaking as far as I can possibly make it) so it might be v...
by paddyg
Mon Nov 11, 2019 11:13 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Hi, didn't know there was a 64bit raspbian. I might give that a go. When I try running the same code (as below) on the normal raspbian it gives me 32 different configs approximately matching the list I posted before (from gentoo) but with the SURFACE_TYPE mask including WINDOW_BIT and PIXMAP_BIT (i....
by paddyg
Mon Nov 11, 2019 3:07 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Gavin, There's a script in pi3d/experiments/ that I've used for finding leaks in python in the past. GPU is much harder as the python GC won't tidy it up - you just have to keep track and destroy things. I've eliminated a few reasons why pi3d doesn't render on gentoo64 but not managed to get it to w...
by paddyg
Sun Nov 10, 2019 8:31 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Yes integer size is a likely culprit. There are a few places where a python int is fed into a c function. Also it uses ctypes.c_int in quite a few places which probably should be c_int32 or other way round! But pi3d works fine on 64b Ubuntu laptop. libbcm isn't available in RPi4 so those calls won't...
by paddyg
Sun Nov 10, 2019 1:05 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Had a look at this and for some reason the egl functions don't work properly around here Almost certainly the wrong kind of pointer annoying as the same code works ok other places 32 or 64 bit. The egl.h is rather opaque and the pyopengl code also pretty hard to figure - but I suppose I will have to...
by paddyg
Sat Nov 09, 2019 12:29 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Hi, it looks like it is using fake KMS and, presumably the desktop (X11) is running as in your screen cap. Could be all sorts of things then, I would work my way through pi3d/util/DisplayOpenGL.py sticking print(x) statements until I found where it went wrong.. looks like I might have to set up a ge...
by paddyg
Sat Nov 09, 2019 8:25 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Gavin, that error is a bit hard to pin down as it just arises at the end of the display surface creation process if it's failed! On the pi4 pi3d checks that fakeKMS has been set by looking for vc4 in /proc/modules and then uses the x11 libraries to create a GL compatible window. So those are the mai...
by paddyg
Fri Nov 08, 2019 12:54 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Looks good. Your scissor method is pretty handy. If you want multiple windows in different places then you need to redefine the scissor inside the loop before drawing what you want to show - but in your demo you could move that out of the loop. If you have a big shape that can be seen through two wi...
by paddyg
Thu Nov 07, 2019 10:44 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Ah, so you want the shapes you draw to disappear as they move off the edge of the pi3d screen? You could do that by making a single pi3d full screen window then masking off the bits you wanted to appear 'off screen' with zero alpha Plane objects like below. I also remembered that the stereo demo use...
by paddyg
Wed Nov 06, 2019 4:06 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

JeDy111, I've pushed up a few fixes for things that cropped up on different machines and OSs. I've also made Display.resize(x,y,w,h) work with x11 windows. However the actual position seems to be set by the desktop window manager so (0,0) only gets to be top left corner if all the desktop stuff is p...
by paddyg
Tue Nov 05, 2019 11:32 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Hi JeDy111, thanks for testing. Yes the borders and other decoration should be fixable with xlib function calls. There are some window creation options already here but I think the removal of all decoration is even messier than the xatom and XChangeProperty() full screen and window title stuff. Posi...
by paddyg
Tue Nov 05, 2019 5:38 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

scrcap.jpg
scrcap.jpg (73.97 KiB) Viewed 2655 times
Working version now on pi3d develop branch. Also revised shaders and examples on pi3d_demos develop branch. Tests ok on laptop and RPi4, will check out on other machines.

Thanks JeDy111 for pointing this out and 6by9 and Paeryn for pointing me in the right direction.
by paddyg
Tue Nov 05, 2019 8:54 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Ah, extra confusion of GL v. GLES. My (why?) was really a note to myself to do some more investigation. In order to get rust_pi3d running (essentially the same shaders using the same GL drivers) I had to translate more things than just commenting out the precision in order to be able to switch betwe...
by paddyg
Tue Nov 05, 2019 12:37 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Annoyingly I can't get the glXCreateContextAttribsARB() to work. But if I fix the shaders it works on the RPi4 (at last!). Commenting out the precision lines in pi3d/shaders/std_head_vs.inc and std_head_fs.inc seems sufficient (why?) but I might as well make it do 'version', 'Texture2D', 'gl_FragCol...
by paddyg
Mon Nov 04, 2019 10:03 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

@paeryn yes. I started down that route trying to get the c code (that 6by9 pointed me at) to work with the shader pipeline. On laptop then pi4 and finally hack it to ctypes python. Gratifying that your code snippet matches mine... Apart from it still not rendering... But it will do with further hack...
by paddyg
Mon Nov 04, 2019 10:54 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

It's using the xlib method that @6by9 pointed me at. i.e. libGLX.so and libXrender.so.1 both of which seem to be available on RPi4 and can give a transparent background to a normal X11 window (with xcompmgr running). It should be possible to position windows by giving the X11 server a 'hint' though ...
by paddyg
Sun Nov 03, 2019 11:30 pm
Forum: Python
Topic: class Texture
Replies: 2
Views: 623

Re: class Texture

Yes the docs FAQ probably needs some additional info about big Textures. Before the RPi4 it was possible to run two instances of pi3d using the old bcm driver and split a texture, but with the latest model and Fake KMS you can do 4K OK, so the extra parameter to Texture() sneaked in. The original 'm...
by paddyg
Sun Nov 03, 2019 11:04 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Yoohoo, result! pi3d X11 window (on ubuntu laptop but should transfer to Pi4)
scrshot.jpg
scrshot.jpg (111.61 KiB) Viewed 2828 times
by paddyg
Fri Nov 01, 2019 1:41 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Interesting. Will definitely follow up.
by paddyg
Fri Nov 01, 2019 12:20 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Yes, that probably is the case :( The KMS,DRM route leads to the C example on my earlier post... but converting that to python ctypes looks pretty tough. However the use of libGLX seems a bit more feasible and the C version seemed reasonably easy to get working on the RPi4 so I will try to use that ...
by paddyg
Fri Nov 01, 2019 10:27 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

@JeDy111, that is exactly what I would like to be able to do as if follows what pi3d did on previous versions of the RPi. The code was started from the examples in /opt/vc/ which showed how to use the libELG.so and libGLESv2.so libraries for fast 3D rendering. However on the RPi4 these examples just...
by paddyg
Thu Oct 31, 2019 10:08 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

Works OK in C and on my laptop. Will try it on Raspberry Pi next. https://www.youtube.com/watch?v=9_GvvyYklqk&feature=youtu.be All the OpenGL code seems to be fixed pipeline stuff but hopefully it will convert. :) PS Sadly, though it compiles and runs without error on the RPi4 I can't get the transp...
by paddyg
Thu Oct 31, 2019 8:29 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

@6by9, Thanks for that link, it seems to do what the author says. I will have a go, initially, to get the C version working with a transparent background and a solid cube! Then the ordeal of getting it to do the same from python. The option of using pi3d without X11 desktop is actually preferable fo...
by paddyg
Thu Oct 31, 2019 4:10 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

OK, I've played around with X11 a bit. The consensus (when I can find anyone interested in this) seems to be that it could be done by taking a snap of what was on the screen then using it as background for the window. However this is unsatisfactory if the stuff behind the pi3d window is changing (a ...
by paddyg
Sun Oct 27, 2019 11:58 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9127

Re: Pi3D transparent background on Pi4

It's something that's been niggling for a while.

Just to check; for your purposes is it no use making the whole window partly transparent (as attached) as opposed to the background only?
scrshot.jpg
scrshot.jpg (104.9 KiB) Viewed 3528 times

Go to advanced search