OpenGL, How to create a “bumpy Polygon”?

I think what your looking for is actually Parallax mapping (Or Parallax Occlusion mapping). Demos: http://www.youtube.com/watch?v=01owTezYC-w http://www.youtube.com/watch?v=gcAsJdo7dME&NR=1 http://www.youtube.com/watch?v=njKdLvmBl88 Parralax mapping basically works by using the height map to alter the texture UV coordinate being used. The main disadvantage to parallax is that anything that appears to be ‘outside’ the polygon will be clipped (think of … Read more

Easy framework for OpenGL Shaders in C/C++

First of all, I’d avoid using glut — it’s buggy, hasn’t been updated in roughly a decade, and its design doesn’t really fit very well with what most people want today (e.g., though you can use it for animations, it’s really intended primarily to produce a static display). I pointed out a number of alternatives … Read more

Where are the OpenGL header files located on MacOSX?

They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use: #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> etc. Make sure to link against the appropriate frameworks, eg) cc <your_file.c> -framework GLUT -framework OpenGL for OpenGL and GLUT

Cmake link library target link error

The syntax for target_link_libraries is: target_link_libraries(your_executable_name libraries_list) And you don’t have to add add_definition statements (target_link_libraries adds this options) There are also some useful variables provided by OpenGL and GLEW packages. Your CMakeLists.txt should be like: cmake_minimum_required (VERSION 2.6) project (test) find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) include_directories(${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS}) add_executable(test main.cpp ) target_link_libraries(test ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES}) One important … Read more

What are shaders in OpenGL and what do we need them for? [closed]

The OpenGL wiki gives a good definition: A Shader is a user-defined program designed to run on some stage of a graphics processor. History lesson In the past, graphics cards were non-programmable pieces of silicon which performed a set of fixed algorithms: inputs: 3D coordinates of triangles, their colors, light sources output: a 2D image … Read more

Opengl pixel perfect 2D drawing

In OpenGL, lines are rasterized using the “Diamond Exit” rule. This is almost the same as saying that the end coordinate is exclusive, but not quite… This is what the OpenGL spec has to say: http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html Also have a look at the OpenGL FAQ, http://www.opengl.org/archives/resources/faq/technical/rasterization.htm, item “14.090 How do I obtain exact pixelization of lines?”. … Read more

Windowless OpenGL

Actually, it is necessary to have a window handle to create a “traditional” rendering context (the root window on X11 or the desktop window on Windows are good for this). It is used to fetch OpenGL information and extentions availability. Once you got that information, you can destroy the render context and release the “dummy” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)