the Fiddler's picture

Call for help: OpenCL and tutorials

With OpenGL 3.1 released and OpenCL drivers poised for release, the graphics ecosystem is slowly beginning to change. OpenTK needs your help to adapt and stay ahead of the curve.

If you have written or are interested in writing tutorials; or if you are interested to help bring OpenCL to the .Net world, please make a post to this thread, indicating which topic(s) you are interested in and whether you have any relevant experience. Prior experience is welcome, but not necessary: this is an excellent chance to familiarize yourself with advanced topics.

The posts below contain more detailed information regarding the topics you can help with.


Comment viewing options

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

OpenGL 3.1 deprecates the fixed function pipeline and changes the way programs communicate with shaders. We need tutorials to show how the new forward-compatible pipeline works and how it interacts with FBOs (MRT).

Tutorials also provide a good opportunity to learn how to implement advanced effects: from shadow mapping techniques, to HDR, SSAO, procedural texture genreation ... Simply pick an effect that you are interested in and implement it using OpenTK. You can also keep a blog with your efforts - and of course, members of this forum will provide any help and tools you may need.

Other functionality, for example Windows.Forms & OpenTK or OpenGL 1.0 - 2.1 (e.g. classic NeHe), is also useful, so do post if you happen to have any such tutorial lying around.

General guidelines:
Tutorials should strive to be self-contained: a single source file is best, but this is not a strict requirement. In any case, all tutorials should come with a short summary and usage overview (e.g. "Before using FBOs, you need to check for the existence of the EXT_framebuffer or Version30 extension strings. If those are present, you can create an FBO with ..."). You should also include any external resources (e.g. images) your tutorial needs.

the Fiddler's picture

An effort bring create OpenCL bindings is already underway. The code currently resides in the cl branch and the ultimate goal is to create a strongly-typed, object-oriented API for OpenCL.

The first step is to create the necessary p/invoke signatures, as listed in OpenTK.Compute. The next step is to expose those methods in a user-friendly manner, using .Net features like classes and properties. The C++ header will likely prove invaluable for the second step.

The OpenCL bindings are an excellent opportunity to gain early experience with the upcoming API. The platform invoke layer also touches topics such as memory management, managed -> unmanaged transitions and the type system, which will help you deepen your knowledge in the .Net platform.

objarni's picture

Just wanted to applaud this idea Fiddler! More tutorials and your suggestion of how to create them (blog about progress + ask for help + writeup the tut) is great!

Inertia's picture

How about tutorials related to WinForms and other classes that can be found within the .Net Framework? Yes, there already is quite some documentation for it on the web, but since it's a dependency of OpenTK it might make sense to cover some of it too.

The path of thought here is that a person who writes database applications with .Net for a living might be able to contribute some valuable tricks and hints how to design great network protocols using .Net, but has no clue what SSAO abbreviates. Just a random example, but actually I do picture that database programmer when writing book pages for OpenTK's documentation .... why shouldn't it work the other way around, too?

the Fiddler's picture

If you happen have an idea for a tutorial not covered above, by all means submit it.

The main technical constraint is keeping the tutorial relatively short and self-contained. Some topics are more complex than others and require larger tutorials - that's fine. What we cannot do is add external dependencies: things like Cg or Sqlite or FreeType, no matter how awesome they are. :)

However, things like network programming, asset (de-)serialization, asset streaming can all fit the constraints. GUIs from an OpenGL/OpenTK perspective might fit, too, e.g. a simple graph control, or a typical heads-up display. Other potential ideas: simple AI (pathfinding, flocking); different camera systems (first-person, third-person, top-down, isometric); 3d sound.

If you feel like toying with any of these subjects, make a post. Remember, the benefit goes both ways: you get to learn the subject matter and potentially make your life much easier in the future, by accessing the knowledge accumulated by other users.

boris59's picture

I'd like to raise my hand for the OpenCL-only faction as I'm not an OpenGL geek (though I had my hands on GL4Java for my bachelor thesis a while ago). Being relatively new to the .NET world and having great interest in harvesting the computation power of my two graphics cards makes me think I might be able to contribute by sharing my first experiences with OpenCL.

For now I'll try to get the SVN trunk version to stress my NV 8800 GTS - as soon as that NV developer application got through.

the Fiddler's picture

Great, any feedback on the OpenCL bindings will be greatly appreciated.

I expect the bindings will be rather hard to use in their current form (OpenCL is a low-level API and makes extensive use of pointers, pointers to pointers and other stuff that doesn't map to .Net very well), but this will change gradually as we find ways to make them easier to use. The current plan is to ensure the bindings work; ensure they work *well*; and make them easier to use.

douglas125's picture


In my opinion, OpenTK is absolutely great and I'm looking forward to using the OpenCL bindings.

Currently, I'm using OpenCL.NET bindings and I would like to share the tutorial I'm currently developing about OpenCL. I have posted examples and sample code:

Alternatively, go to and select Developers section. I have posted sample codes as well.

If, by any chance, you happen to speak Portuguese, I have translated the tutorial:

I appreciate comments and, if you want to incorporate what I've done into OpenCL, I offer to help.