Category Archives: 3D

GUI Editor crash

I’ve been getting complaint about the Ryzom Core Studio GUI Editor plugin crashing instead of rendering what it should, so I did a little investigation. Apparently if you try to render OpenGL into a simple QWidget it will crash the driver ( at least the Intel one I have on my lappy ).
The solution: use QGLWidget instead of QWidget on Linux, even if you don’t use the rendering features of it.

Now it works just fine:

The screen shows it working on my HP 6910p laptop, running XUbuntu 14.04.


OVQT Material Editor plugin as of July 8

Finally I have something small to show off about this.
After having worked on all this for a week ( more or less ), It can already load/save/manipulate materials and shaders, and also has a widget for previewing the changes.
NOTE: The material/shader manipulation part and the preview part are not yet linked, as the preview uses the old driver, since the new programmable pipeline one isn’t YET implemented.

As I develop it further I will post more about it. Until then this video should be a nice preview 🙂

Let there be more lights!

Lately I’ve been messing around with OpenGL 3.3 core / GLSL lighting a bit more.

First I created a scene with a floor and the now used to boredom box of mine. Then I added a global light  source ( that is it doesn’t change with the camera like the one I posted about earlier ) with red color and started to experiment a little with light color and texture color mixing:

Obviously this one wasn’t a very successful experiment 😛

The next one was a little bit better already:

This time in addition to the color mixing changes, I also changed how ambient light is handled: The parts where the diffuse red light source cannot light the scene are only lit with the ambient light source, which basically only modifies the luminosity of the texels. The result is as it can be seen on the picture, the side of the box is not colored red.

After all this I worked on it a bit more and added another diffuse light source, with blue color and a direction that can hit the box where the red light can’t, therefore one side of the box becomes reddish the other side becomes blueish. The floor of course becomes a mix of the two.

Here’s video that shows it, enjoy!

Let there be light!

…and then I said, let there be light! …and there was light!

So after having studied OpenGL shaders a bit in my book, I’ve made another textured cube: this time the texture is a wooden box instead of the OpenGL logo. Also I’ve added lighting using vertex and fragment shaders.

Basically how it works is, there’s a diffuse light source in the scene at -100.0, 100.0, 100.0 and some ambient lighting too ( 30% ambient contribution ). The vertex shader interpolates the texture coordinates, and the diffuse lighting between the vertices for the fragment shader, and then the fragment shader samples the texture at the interpolated coordinates and multiplies the color with ( ambient + diffuse ).

Fairly simple, and yet looks pretty nice imho. So enjoy!


My first OpenGL demo

Since I’ve been playing around with OpenGL for a little while now, I could finally create a little demo.

It’s very very simple, but basically show the things I can already do. It has no shading/lighting, no music, or anything that fancy yet, but I’d think it’s a good start!

So, enjoy!


opengl texture mapping

Texture mapping makes 3D life just a little spicier.

My first OpengGL rendered cube!

So I’ve been reading OpenGL Superbible 5th edition a bit more, and playing around with some code, and eventually decided it’s time to try to render a cube. I also added support for rotating the cube with the up/down and left/right keys.

Here’s the result:

I think I am in love, with OpenGL! 😀


So I’ve started to learn 3D programming with OpenGL. One of my first little programs is demonstrated here:

It’s a little demo that does the same as the dxdiag directdraw bouncing box used to be. Nothing special, just a GL_TRIANGLE_FAN primitive with 4 vertices, moving around. However I enjoyed coding it, so it’s a good start!

I’m learning from the book OpenGL Superbible 5th edition. So far it seems to be a very good read, it starts from the basics and builds up your knowledge. The code examples are also fairly simple: It comes with a small library called GLTools and also it uses GLEW and GLUT, to make work faster and more focused on visible results, instead of writing pages of platform dependent initializing code. I can only recommend it!

Once I am a bit more confident with OpenGL I plan on starting to use Qt to actually display stuff.