So I started writing Example Programs

Started by
17 comments, last by japro 11 years, 8 months ago
Well done , well done.

I'm still following the project ;)
Advertisement
Having a look now at how you encapsulate your shaders, thanks for sharing.

The tutorials out there are indeed pathetic, it has to be said. It's depressing to know how many others will suffer through that stuff just to get a working shader-based app running. There are precious few good tutorials, Durian Software's and lighthouse3d's being some of the best. For anyone else using LWJGL, this was also immensely useful. I'm learning the programmable OpenGL 2.0 ES subset of OpenGL 2.1 using VBOs, and in spite of the usefulness of this approach due to its applicability to desktop and mobile and the fact that it is "modern", it's still incredibly hard to find a single, comprehensive tutorial that foregoes all the fixed pipeline cruft. The iOS and Android tutorials don't help either, as they encapsulate too much, hiding the basic OpenGL function calls from you. I had to use a few 3.0 tutorials to help me get up to speed with 2.0; fortunately the only difference was in & out vs. varying in GLSL 1.5, AFAICT.

The basic Idea is that each example is self contained (not reliant on some base code or obscure libraries) in a single file and is meant to provide a clean usage of one or multiple OpenGL 3+ features. Sadly I still have to rely on some libraries for context creation etc. so the examples depend on glfw, glew and glm.


Since you want to use Forward-Compatible GL 3+ only, gl3w might be a better (and lighter) choice than glew.
Personally I'd also take Eigen over glm any day (although it admittedly does not include perspective projections... yet)
I got the suggestion to use gl3w more than once smile.png. For the moment I'll keep on this track, but since the examples are already partially "generated" (they are run through a simple program to create the index at the beginning) i guess i could also have that generate a gl3w version...

Somewhat related, after having completed the occlusion culling example I kept playing with it and after some amount of copy pasting from my own code and adding a deferred pipeline I ended up with this:

[media]
[/media]
Very good examples, good job!

Japro it's really nice!! I like it! wink.png
Really nice samples! Did anybody find a decent wrapper for shaders/programs in OpenGL?

I might consider not using SDL..
I just added the first OpenGL 4 example. It shows tessellation: https://github.com/p...tesselation.cpp

It also has a simple phong lighting implementation and is funny in that it doesn't use a vbo at all. It generates the sample points by "abusing" instanced rendering and only uses gl_VertexID and gl_InstanceID and the texture as inputs so to speak.

Here is a video:
Great!
Today I had some fun with ARB_shader_image_load_store (core in 4+): https://github.com/p..._load_store.cpp
It solves the electromagnetic wave equation on a 2d grid with shaders. Thanks to the extension the update can be done in place so there is no fbo ping pong rendering required. Just a single texture.
[attachment=10404:wave_equation.png]

This topic is closed to new replies.

Advertisement