Write your own Einstein@home screensaver

cecht
cecht
Joined: 7 Mar 18
Posts: 683
Credit: 728,602,878
RAC: 1,449,701

I got TEST05 Linux. It's

I got TEST05 Linux. It's beautiful! The animation is smooth, the zoom works great, the colors are good, and toggling different features is very instructive. Yes, what they say is true, you are a true coding genius.

However...., every time I run it, two stderr file are written to my Desktop, stderrgfx.txt and eahss_stderr.txt. ;)

Ideas are not fixed, nor should they be; we live in model-dependent reality.

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 124,555,914
RAC: 80,873

I blush at your kind

I blush at your kind comments. I'm especially pleased that you find it instructive. :-)

However let's fully accredit ....... the credit for the Earth texture goes to NASA. It's in the public domain ( provided it's non commercial usage etc ). The credit for the original code; the constellation, pulsar, and supernova data come from Bruce Allen, David Hammer, Eric Myers, Oliver Bock, Benjamin Knispel, Bernd Maschenchalk, Graham Woan and hopefully I've not left anyone out. I'm especially keen on Oliver's Resource Compiler gadgetry which turns binary file data into C++ code thus sucking some superb information into the executable at compile time.

The error files will get removed come time to 'officially' publish, whenever that will be, for now they serve guard as quality control/trace on my errors. 'stderrgfx.txt' I inherited from prior work done, the other I generated from my efforts. You can safely delete them otherwise, they exist mostly to trace the line of execution.

Speaking of which, there is a great utility called 'apitrace', or even better 'apitrace-gui', that can be installed on linux ( sudo apt-get install apitrace-gui is the magic spell on Ubuntu ) that can debug OpenGL code almost live. I say almost as one runs the OpenGL program of interest under its control for a short time, and it makes a log of each and every API call. You can then retrace or replay the calls to determine the changes to the state machine that OpenGL is. Hence the name. So I use apitrace alongside the app's behaviour, stdout/stderr and the log files. Makes it a doddle to pick up sloppy coding and obtuse failings.

{ The other good tool to use is good old Google. Chances are that if you have stepped on a mine then someone else has done that before you. I think Stack Overflow is brilliant. }

The executable for Windows is about twice the size of the Linux one. I think that is because of the vast amount of static linking that occurs during the build, which is necessary as you never quite know what will be on a win32 machine compared to linux. For that matter the Mesa drivers, while not the fastest, seem to be the closest to OpenGL standards too.

Apart from some logos, and some BOINC linked per-user activity reporting, I don't think I should crowd much more into the visuals. It looks busy enough so far. 'Less is more' I feel. I aim to make it more interactive with the mouse however. I 'just' need a method to work out what is under the mouse pointer at any given moment in time. That's not trivial.

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 124,555,914
RAC: 80,873

OK. We have TEST06 in Windows

OK. We have TEST06 in Windows and Linux versions available and yes, my name is upside-down in the top right of screen. Just a wee bug to fix on that .... :-)

We have a couple of logos that I've jazzed up a bit using gimp with the background transparent & the foreground colors opaque which I think gives a nice appearance as the stuff behind the HUD glides past. Now the next test is of the linkage to the BOINC client via an OS shared memory area. That way one can get all manner of user and task info onto the screen, in realtime as it were !

Cheers, Mike.

( edit ) Also I'm curious as to what appears to be the colors of the logos and text. I'm assuming little-endian systems you see ..... I had to write a little utility which swizzles the color ordering you see, & I could have got that wrong.

 

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

cecht
cecht
Joined: 7 Mar 18
Posts: 683
Credit: 728,602,878
RAC: 1,449,701

Here's a screenshot of the

Here's a screenshot of the TEST06 Linux version:

The zoom function from the mouse wheel is broken, so I couldn't check transparency.

Ideas are not fixed, nor should they be; we live in model-dependent reality.

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 124,555,914
RAC: 80,873

The mouse wheel changes the

The mouse wheel changes the field of view or how narrow/wide in angle is the 'lens'. I've disabled that until I get a workaround for the whacky results it can give ( the Earth upside-down business ). Hold the right mouse button down and move the mouse pointer up and down the screen to move the viewpoint toward or way from the Earth. You'll be able to check transparency that way. :-)

Cheers, Mike.

( edit ) The colors are the same as my machine. I think I know why they aren't quite right though - the OpenCL logo should have red and orange in it - I've just now discovered some little known facts about the internal storage format used for the color components.

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

Holmis
Joined: 4 Jan 05
Posts: 1,117
Credit: 773,560,378
RAC: 648,500

I get the same color "issue"

I get the same color "issue" on the win version.

I also noted that if I change the viewpoint to just the right place, so that the stars, constellations etc. in the foreground are still visable they will pass over the logos. So the logos are "attached" to the viewpoint and follow it in 3D space, nice! (Check the OpenCL logo in the screenshot (avalible for a month from now)

I look forward to seeing some user stats and a crosshair to point out the target for the task at hand or whatever else you might come up with!

Keep up the good work!

cecht
cecht
Joined: 7 Mar 18
Posts: 683
Credit: 728,602,878
RAC: 1,449,701

Mike Hewson wrote:The mouse

Mike Hewson wrote:
The mouse wheel changes the field of view or how narrow/wide in angle is the 'lens'. I've disabled that until I get a workaround for the whacky results it can give ( the Earth upside-down business ). Hold the right mouse button down and move the mouse pointer up and down the screen to move the viewpoint toward or way from the Earth. You'll be able to check transparency that way. :-)

Okay, got it (cool mechanism).  For TEST06 Linux, there is transparency on "Mike Hewson", but the logos are opaque or nearly so.

Ideas are not fixed, nor should they be; we live in model-dependent reality.

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 124,555,914
RAC: 80,873

FWIW : one 'little known

Thinking Out Loud

FWIW : one 'little known fact' regarding BMP files & their pixel storage format is : "..... but the order of the sample fields is arbitrary. The most ubiquitous field order is: Alpha, Blue, Green, Red (MSB to LSB)." ( Wikipedia )

{ most ubiquitous != all }

On a little-endian system ( most are ) the ordering in memory is thus Red, Green, Blue, Alpha. 

While the order is arbitrary from a standards point of view, it is derivable in a given instance from other information in the file header. That involves a messy consideration of bitfields/masks. I'll stick with gimp which can store four component BMPs as ARGB and use my utility to swizzle to GL_RGBA  ( or GL_BGRA ) which OpenGL can use. And that's what the sampler object in a fragment shader is going to see.

It's also apparent that debugging a BOINC screensaver is going to be dicky as regards user and work unit data. There's a shared memory area which the BOINC client may write to so that a screensaver can pick information up and render using it. My experimentation seems to indicate that if the client didn't launch/initiate the screensaver activity then that memory area is not written to. I may be able to fudge this though, but I'll need to know where in the directories on given systems the screensaver is stored. I have a vague memory that one of the BOINC config files could help here.

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6,124
Credit: 124,555,914
RAC: 80,873

I've conquered the pixel

I've conquered the pixel ordering issue, here is TEST07 for linux and Windows. If you invoke them by following with --demo on command line eg.  graphics_starsphere_TEST07_x86_64-pc-linux --demo, you should get fullscreen mode ( ESC to exit ).

Cheers, Mike.

( edit ) I note that about a half dozen of you have cloned from my GitHub repo, which is fine & dandy. The hardest part is setting up a good build system. If you have any questions I'm happy to help. The dependencies can't all be checked for in a build script you see. The difficult part is getting all the right libraries onto the system and some of the error messages are a tad obtuse eg. the old yacc is really a bison these days etc ..... plus don't bother with any code in the solarsystem subdirectory, it's basically rubbish and it won't build. It was a dead end & I should really delete it.

I have made this letter longer than usual because I lack the time to make it shorter. Blaise Pascal

cecht
cecht
Joined: 7 Mar 18
Posts: 683
Credit: 728,602,878
RAC: 1,449,701

Yes, --demo option works and

Yes, --demo option works and logo colors look right in TEST07 Linux.  Progress!

Ideas are not fixed, nor should they be; we live in model-dependent reality.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.