Using Shaders

Codes and executables for Windows, openFrameworks 0.074, Visual Studio Express 2010 C++: Download

Horizontal Distortion



Vertex Deformation

Furry Carpet

3 thoughts on “Using Shaders

  1. alp tuğan

    Hi Denis,
    I’ve learned a lot about shaders from your book. thanks.
    My question is about “Furry Carpet” tutorial. You commented out as follows;
    //Hint: for better performance, we can use ofMesh and GL_LINE_STRIP in shader ,
    //but in this example we use lines for simplicity

    when I compile the it runs really slowly on my Mac. The fps is about 2-3 frames per second.
    So, I try to re-write the code via ofMesh and GL_LINE_STRIP. But no chance. the frame rate is still too low. Could you share the code with ofMesh and GL_LINE_STRIP in shader version? I’m a newbie to shaders world. So, it would be great for me to see what I’m doing wrong.

    1. perevalovds Post author

      Hi Alp. Thanks you!
      It seems that such low performance is caused by the fact that geometry shader works slow on your video card.
      What is model of video card you are using for running Furry Carpet?
      Mesh/GL_LINE_STRIP will improve performance just a little in this case, and it is not so crucial in this example.
      Currently I have no version of the project with Mash/GL_LINE_STRIP, so you could send me the code, I will happy to check it anyway. (

      1. alp tuğan

        Great! I send my code and shader files to your e-mail. According to glInfo;
        opengl version: 2.1 INTEL-8.24.16
        vendor: Intel Inc
        renderer: Intel HD Graphics 3000 OpenGL Engine

        point sprites support: yes
        shader support : yes
        vbo support : yes

        I’ve 13 inch Macbook pro and it has onboard graphics card. I tried the same app with 2009 model 17 inch MacBook pro. 17 inch has extra graphics card. When I enable second graphics card on 17 inch, the app runs about 8-9 fps. But, still too low I think.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s