Go to advanced search

by paddyg
Sat Nov 16, 2019 10:31 pm
Forum: Python
Topic: how to filter certain values ​​from a list
Replies: 8
Views: 368

Re: how to filter certain values ​​from a list

Out of curiosity import timeit setup = ''' import random import numpy as np list_1 = ['1' , '2', '2', '2', '3', '4', '5'] list_2 = list_1 * 1000 random.shuffle(list_2) list_1n = np.array(list_1) list_2n = np.array(list_2) ''' fns = [ ''' #### vanilla loop len == 7 ##### 0.37 ms temp = [] for c in li...
by paddyg
Sat Nov 16, 2019 12:17 pm
Forum: Python
Topic: Pause a program in python
Replies: 7
Views: 514

Re: Pause a program in python

Is your code on a repository so we can look at it? With control programs generally I wouldn't use sleep or pause, apart from for a second or two every loop. I would check the time against a trigger time for the next action. That's kind of what the pause module intends to do but it might have lots of...
by paddyg
Sat Nov 16, 2019 8:49 am
Forum: Graphics programming
Topic: Open GL 2.1 on RPi 4
Replies: 8
Views: 1525

Re: Open GL 2.1 on RPi 4

Quite a few things without code or errors to look at. You might glean something by looking at pi3d shaders and the Shader class which does some parsing (near end of file) Between GL21 and GLES20 I think the only difference was #version and //precision GLES30 had in and out types to sub for varying a...
by paddyg
Thu Nov 14, 2019 10:22 am
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 244
Views: 43695

Re: Image viewer with transition between images

Glad you sorted it.. let me know if anything is broken (hopefully not) Another thing about pip that I've found is that it sometimes gets in a tangle with sudo. The problem is that things get installed for root and then there are subsequent permission issues. The best way (that I have found) is to us...
by paddyg
Wed Nov 13, 2019 11:27 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 244
Views: 43695

Re: Image viewer with transition between images

Hi, Sorry you're having difficulty. There's so much in that PictureFrame script now that it's pretty hard to set it all up (though sapnho's web site is very good). The first thing that occurs to me is the FIT option. True means that all the image is visible even if there are gaps (which will be fill...
by paddyg
Wed Nov 13, 2019 3:19 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 10503

Re: Pi3D transparent background on Pi4

Gavin, I was going to say no - the direct entry of shader code as strings hasn't been added to rust_pi3d... But when I looked it seemed I had left the functions public to do just that. So I just copy pasted from my earlier pi3d example and it worked straight off . On this gentoo64 pi the raymarch is...
by paddyg
Tue Nov 12, 2019 12:30 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

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: 10503

Re: Pi3D transparent background on Pi4

scrcap.jpg
scrcap.jpg (73.97 KiB) Viewed 2982 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: 10503

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: 10503

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: 10503

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: 10503

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: 640

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: 10503

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 3155 times
by paddyg
Fri Nov 01, 2019 1:41 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 10503

Re: Pi3D transparent background on Pi4

Interesting. Will definitely follow up.

Go to advanced search