Google Summer of Code - Shader Engine

Hi all,
I’m the creator of the Gephi project, an open-source network visualization software using JOGL. The project have been accepted as a mentoring organization by Google for the Summer of Code. I think I have an interesting proposal to share here: Shader Engine. You may already know how Google SoC works, basically a student will receive payment for working on mentoring open-source projects.

For interested students, see our forum. You can also suggest ideas, until April 3 however. Thanks.

Here is the short version of the proposal:

This proposal is an experimental work about drawing large networks using GPU Shaders technology to improve performances and scalability. The aim is to create a basic 3D engine using suggested technologies and use it for drawing as many nodes and edges as possible.

Existing Gephi 3D engine is intended to be used with old hardware and so don’t profit from GPU revolution. Basically the engine draw only very basic shapes (sphere or cube for nodes and lines for edges), but a LOT of them. Drawing millions of objects, even if it is the same object is currently far from possible.

Shaders technologies have interesting features for our topic. For instance Geometry Shaders and (Pseudo-)Instancing techniques enhance performance when duplicating objects. Other techniques could be explored to reduce the amount of needed vertices or computing.

We suggest this draft roadmap:

* Getting started with loading and executing vertex and fragment shaders within a JOGL routine in a sample application.
* Try pseudo-instancing techniques for duplicating an existing shape, for instance a sphere.
* If available, use Geometry Shaders to implement an instancing test case.
* Try to create a Shader which will help to reduce sphere mesh size. For instance see if it is possible to create a sphere from only few triangles.
* Experimentation for increasing edge drawing performance using Shaders.
* Propose nice post-processing effects if you like!

I’m interested with comments about feasability of this project and so on :wink:

Hi!

It is an interesting project, I wish you to succeed. Do you plan to use any system of spatial subdivision? some view frustum culling? I think that if you want to improve the frame rate on old hardware with no shader and even on recent hardware, it is better to look at this possibility too. Best regards.

the Gephi video is cool and very interresting to see.

[quote]Try pseudo-instancing techniques for duplicating an existing shape, for instance a sphere.
[/quote]
GPU instanciation works pretty well with display list in all GPU.

[quote]Try to create a Shader which will help to reduce sphere mesh size. For instance see if it is possible to create a sphere from only few triangles.
[/quote]
hehe maybe two : a quad with a diffuse map to make it pretty, a normal map to make it 3d and finally an alpha map to make it round :slight_smile:

good luck …

I don’t really understand the summer of code google thing.
But that video and the web-site for gephi, was as said before IMPRESSIVE!
I can’t really lend much of anything(due to my noob nature) aside from, keep it up!

And with my limited experiance with jogl, I’d say that it’s very possible:).

edit - Hey I’m a student! I dunno exactly what I could contribute but it might be fun trying!

I already use several high level optimisation like spatial subdivision (Octree), level of detail and frustum culling. Because we have strong requirements like dynamic update some other high-level optimization would be counter productive because the world has to be updated too frequently. Indeed from one frame to another, every object could have changed its position.
When profiling my software I see that more than 80% of time is spent in display loops (OpenGL calls), thus I think some optimization should be done there, and Shaders would be the solution I guess.

Google Summer of Code (GSoC) is a global program that offers student developers stipends to write code for various open source software projects, fund over a three month period (4500USD per student). Through this, accepted student applicants are paired with a mentor from the participating projects, thus gaining exposure to real-world software development scenarios and the opportunity for employment in areas related to their academic pursuits.

Then rather use a spatial subdivision that fits into this need, the fact you have to update the world often, don’t use trees because it is costly to maintain them “well balanced”.

If a certain group of items in your scene is always moving, and another part is (more or less) fixed in one position, why not use two datastructures. Any general (global) solution is probably suboptimal.

The role of data structures is indeed very important, I chose rather a static octree structure than dynamic octree or bounding boxes. You can see a screenshot of our octants.

Firstly, due to the fact objects are rarely moving in a continuous movement, we can’t use neighborhood of an octant to guess where could be an object which is not in his octant anymore. Octrees or bounding boxes allows varying height of the tree according to object’s count in leaves. In the context of the dynamic graph visualization we are doing, I think it’s not possible to maintain these trees efficiently. Actually I didn’t found any optimal solution for the highly dynamic context of data. I believe it is quite different from building maps or levels, which fits in static structures, for instance in video games.

However our performances are good and scalable. When visualizing the whole network is slow, zooming on some parts remains always fast. In addition, Updates of the structure represents very few computing compared to the OpenGL display routines.

Yes but then you have to synchronize the data in 2 data structures; if you update one, you have to update the other. However, you’re right, choosing a particular solution will always in some cases not be optimal.