Freedom of knowledge and Sci-Hub

If you are a nerdy science type who likes to read academic and or research papers (for fun or for knowledge) you will have seen for a long time now that a lot of the papers get blocked behind a page that asks you to pay for access to the paper. These “paywalls” usually amount to around $30 to see one individual paper. If you are a university student you can get around this if your institution pays the publisher, but for your average person you do not have free access.

Science Paywall

This is very frustrating. Knowledge needs to be openly shared for the human race to advance. The power of shared knowlegde the Internet brings should not be restricted.

SCI-HUB is the latest completely awesome solution (note, may not be truly legal – see wikipedia article for the full history) that gets you access to these paywalled papers.

Here is an example. James Crutchfield’s seminal paper on Video Feedback “Spacetime dynamics in video feedback” is going for $37.95 (assuming after AUD conversion)!

In this case the paper is easily accessible elsewhere as a PDF, but a lot of papers can only be accessed behind a paywall.

If the paper you want is paywalled, take the DOI link, ie this one for the above paper
https://doi.org/10.1016/0167-2789(84)90264-1
and put it into the SCI-HUB search field to get
https://sci-hub.io/https://doi.org/10.1016/0167-2789(84)90264-1

Until the legal battles are fought and won or lost SCI-HUB is a great resource to access knowledge. Remember accessing papers this way does not take away any funds from the original researcher(s). They get nothing if you pay $30 to see a PDF.

Newton Quote

I could go on for pages about the arguments out there. Do some googling on “academic paywalls” to read all the hatred against them. I gave up trying to find a page that said it thought paywalled knowledge was a good idea.

Ever since starting this blog I have always tried to only post positive topics. The old “if you don’t have anything good to say then don’t say anything at all” line. But this topic has and will continue to annoy me past the point of silent indignation.

Jason.

ADDLED updated and re-released

After some updates for the latest Android versions I have now released the latest version of ADDLED to the Play Store. ADDLED is 100% free and ad free.

ADDLED Screenshot

The aim is to find a set of numbers that add up to a total value. Initially the levels are simple with just sums using positive numbers, but later levels give larger grid sizes and negatives, multiplication and division.

As the difficulty increases there are more strategies to implement to get through levels.

ADDLED Screenshot

The levels are quick enough to fill in a few minutes when you have some spare time. There are 5000 total levels to keep you more than occupied.

If you think this is your sort of puzzle game, download ADDLED through the Google Play Store.

Jason.

Updated Visions of Chaos for Android

I have updated my Visions of Chaos for Android application to version 1.19. Click here to go directly to the Google Play Store page.

Visions of Chaos for Android Screenshot

New features/fixes include;

1. Added more color palettes
2. Added more sample GLES shaders
3. Added Delete option to remove shaders that are incompatible with device
4. Fixed instabilities with pinch zooming
5. Fixed out of index bug that sometimes occurred with Buffalo Fractals
6. Fixed spinners’ dropdown text colors so they are more visible
7. Fixed bug in GLES shaders that date.w was passed as current second rather than seconds since midnight

Visions of Chaos for Android Screenshot

I do recommend using a new high end Android phone or tablet. The shaders can crash older devices and general performance can be frustratingly slow on old phones.

All of the images on my Instagram gallery were created using the app.

Jason.

Visions of Chaos now supports Pixar RenderMan

Visions of Chaos can now use Pixar‘s Free Non-Commercial RenderMan to render 3D scenes.

This is the same RenderMan engine used in movies like Finding Dory

Finding Dory Screenshot

and Rogue One

Rogue One Screenshot

I am only using a tiny fraction of RenderMan’s features. Rendering millions of spheres or cubes with nice shading and lighting covers my requirements, but it is good to know that I have the extra power of RenderMan to expand if needed in the future.

All the end user needs to do is download the stand-alone Pixar RenderMan and point Visions of Chaos to the main command line RenderMan prman.exe renderer file. After that Visions of Chaos constructs the RIB format files RenderMan understands and gets prman to render the images.

Currently RenderMan support is added to the following Visions of Chaos modes;

3D Ant Automata

3D Ant Automaton

3D Cyclic Cellular Automata

3D Cyclic Cellular Automaton

3D Cellular Automata

3D Cellular Automaton

3D Hodgepodge Machine

3D Hodgepodge Machine

3D Hodgepodge Machine

3D Voxel Automata Terrain

Voxel Automata Terrain

3D Diffusion-Limited Aggregation

3D Diffusion-Limited Aggregation

3D Cube Divider

Cube Divider

RenderMan seems to be able to handle a massive number of objects so far. This next test 4K image was over 33 million little cubes. RenderMan churned away for over 2 hours on this one image. The main slowdown was my lack of memory and constant hard drive paging. 32 GB of RAM just does not cut it when rendering this sort of data. The RIB scene file alone was 13 GB.

Voxel Automata Terrain

RenderMan is slower than Mitsuba at this stage. But that could be down to any number of reasons including my lack of RenderMan knowledge.

Jason.

Voxel Automata Terrain

Voxel Automata Terrain

Brent Werness aka @R4_Unit tweeted about an algorithm he calls “Voxel Automata Terrain” that creates interesting 3D structures. He also provides some processing source code I was able to translate so I had to have a go at creating some of these myself.

Voxel Automata Terrain

These structures are created using a process similar to the diamond-square algorithm but in 3D. A 3D cube is repeatedly iterated and divided to leave these structures behind. I don’t really understand it beyond that so I cannot give a better explanation at this time.

Voxel Automata Terrain

The code for dividing the cube up is the first parts of Brent’s code. Mostly everything after the evaledges routine is display related.

Voxel Automata Terrain

For my images I use the states array to render solid cubes using the Mitsuba renderer. State 1 and state 2 cells can be shown or hidden and displayed using different colors.

Voxel Automata Terrain

I also setup a flickr gallery with more example images.

Voxel Automata Terrain

Voxel Automata Terrain

If you start the process without a random side and fill the initial base side with all state 1 or state 2 cells you get symmetric structures as a result.

Voxel Automata Terrain

Voxel Automata Terrain

Voxel Automata Terrain

I also tried extending the maximum possible cell states to 4. The rule arrays need to be changed to three dimensional. From some initial quick searches (a few hundred of the possible 4 billion rules) did not lead to any new unique structures, but it does add another color to the mix.

Voxel Automata Terrain

Voxel Automata Terrain

Voxel Automata Terrain

Here is a movie showing some samples with ncreasing levels of detail/recursion.

Voxel Automata Terrain are now available as part of the latest version of Visions of Chaos.

Jason.

Pushing 3D Diffusion-Limited Aggregation even further

If you don’t know what Diffusion-Limited Aggregation (aka DLA) is, see this post of mine.

3D Diffusion-Limited Aggregation

3D Diffusion-Limited Aggregation

Previous Results

Previously, my best 3D DLA movies were these two;

I had two main issues with those movies. Firstly, I used software based OpenGL which does not support shadows or any advanced lighting techniques. Secondly, I was launching the moving particles on the surface of a sphere that was biased to the poles, which meant the resulting growth tended to grow more in the “up” and “down” directions rather than a nice spherical shape. This is especially noticable in the first movie above that grows more in the up direction than the other directions.

64-bit

Now that Visions of Chaos is 64-bit I wanted to push the limits of the DLA animations even further. In the past the 32-bit executable limited me to around 3GB of usable memory which restricted the size of the arrays that I could grow DLA structures within to around 750x750x750. With a 64-bit executable Visions of Chaos can now use as much memory as the PC has available.

3D Diffusion-Limited Aggregation

3D Diffusion-Limited Aggregation

Bugs in old code

I have been experimenting with 2D and 3D DLA for many years now and my existing code reflected that. When I started expanding the grid size and particle counts I was getting strange crashes/hangs/poor behavior. As any programmer knows, you think “this will be an easy fix”. Well, 3 or 4 days later after trying to fix these simple bugs and rendering lengthy test runs I was ready to chuck my PC out the window. Having to wait a few hours to see if a fix works or not really tests the patience. In the end I bit the bullet and woke up one morning and rewrote the code from scratch. It took a few hours and I now have a much more stable and faster version. I also added support for Mitsuba so I get nicely shaded images. Back on track.

3D Diffusion-Limited Aggregation

3D Diffusion-Limited Aggregation

Latest results

With the extra memory available from a 64-bit Visions of Chaos executable and being able to use Mitsuba to render each frame it was time to let my PC churn away for a few days rendering DLA frames. The few days expanded into a few weeks as I kept tweaking settings and code and started to render the DLA movie parts again from scratch. But finally, the following movie was complete.

I only have 32 GB memory in my main PC so those sample movies run out of RAM when around 10 million particles are reached. This is double the maximum particles I achieved in the past. I need to look at maxing out my memory to 128 GB so I can create even larger DLA structures.

Something to observe in that movie is how once the particle count gets beyond around one million the overall structure remains the same as it continues to grow. This is a great example of the self-similarity properties of fractals. With more memory and more particles the overall structure would not suddenly change beyond 10 million particles. The individual spheres would shrink into sub pixel sizes, but the overall growing shapes would remain self-similar (as render times continued to increased per frame). This is also noticeable in most of the sample images in this post.

Some DLA coding tips for programmers

If you are not programming 3D DLA then this next bit will be of little use to you and you can feel free to skip it.

3D Diffusion-Limited Aggregation

When launching particles into the DLA space use random points on a sphere surrounding the current growth. If you use random points on a cube surrounding the growth it will be biased to grow along the axiis. Using a sphere helps maintain a more spherical growth. Set the radius of the sphere slightly larger than the furthest distance the dla structure has grown. ie if the furthest particle is 10 units of length from the origin, then set the sphere size to 13. Also make sure you use an even distribution of points on the sphere surface. My original code was biased to the poles and this is why the first sample movie above grows towards the up/north direction more than evenly in all directions. Some quick code to evenly distribute random points on a sphere is


theta:=2*pi*random;
phi:=arccos(1-2*random);
px:=round(sin(phi)*cos(theta)*launchradius)+centerx;
py:=round(sin(phi)*sin(theta)*launchradius)+centery;
pz:=round(cos(phi)*launchradius)+centerz;

3D Diffusion-Limited Aggregation

The usual DLA method is to wait until a moving particle goes “off screen” before a new particle is launched. For 3D, off screen is the array dimensions. Waiting for particles to move off the existing DLA grid can really slow down the process (especially for large sized grids). Rather than wait for the edge of the grid, use a few grid units distance beyond the launch sphere radius. So if the launch sphere is radius 13 then moving particles get discarded if they travel more than 16 distance from the origin.

3D Diffusion-Limited Aggregation

Calculating distances involves costly sqrt calculations. If you are doing a sqrt each time the particle is moving they quickly add up and slow down the simulation. To speed up distance calcs I fill an array once at the start of the simulation that contains the distance from the origin (grid center) to each array location. This makes it much quicker when you want to know how far a moving particle is from the origin. All it takes is a single array lookup rather than a sqrt distance calculation.

3D Diffusion-Limited Aggregation

Another thing you want to know for moving particles is how many neighbor particles is it touching. For example if the current settings make a particle stick to 3 or more existing neighbors then you usually do a quick loop of neighbor cells adding them up. Again, doing this every time the moving particles move adds up and slows everything down. I use another array that holds the neighbor count for each grid location. When a new particle attaches to the existing DLA structure, you add 1 to the surrounding cells in the neighbors array. Much faster.

3D Diffusion-Limited Aggregation

If you are rendering a very dense DLA then there will be a lot of particles within the middle that remain hidden. Doing a quick check to see if a particle is surrounded (ie using the above neighbors array means if neighbors=26) means it can be skipped and not sent to Mitsuba for rendering. On the densest DLA structures this cut down the number of spheres passed to OpenGL and/or Mitsuba to only 7% of the total spheres. A huge speed up in terms of time per frame.

3D Diffusion-Limited Aggregation

You need to auto-increase the hits per update each frame. ie if you set the display to update every time 10 particles get stuck to the growing structure it will look fine at the start, but once the structure starts growing you will have a long wait to get to a million particles and beyond. I used a simple formula of increasing the stuck particles per frame as the number of total stuck particles div 40. Once you get to 100000 particles, keep the update at 25,000 particles per frame. This allows a nice smooth increase in stuck particles and gets you to the more interesting million+ range quicker.

3D Diffusion-Limited Aggregation

Using the above tricks you will find the particle movements and sticking part of the code takes seconds rather than minutes per frame. The main slowdown is now in the display code.

Jason.

10 years on YouTube

Today marks 10 years since I started my YouTube channel.

Back then a video with a resolution of 240p (426×240 pixels) like the following was considered OK.

These days I can upload a 4K video (nine times the vertical and horizontal resolution of that 240p video) and once YouTube puts it through their internal conversion routines it will usually come out looking excellent.

Jason.