This is really an open ended question. What do you guys use for OpenGL 3.x rendering?
I've previously done everything with 2.1, but I'm trying to switch over to 3.2 so I can use geometry shaders. I was comfortable doing everything with SFML 1.6 so I tried moving over to SFML 2.0, got the context, but haven't gotten anything to display. I've seen code on how to do it from scratch, but I was hoping to avoid that so I don't end up reinventing the wheel.
OpenGL 3.x Rendering
SFML should work fine I would think, as long as you've got it setup I don't see any reason to change. Maybe you just haven't gotten anything to display because you're doing some 3.2 techniques incorrectly, or missed a step? I would think the initialization should be pretty much the same between opengl 2.1 and 3.2.
I use native Win32 and GLEW to get a 3.2 context on Windows and an NSOpenGLContext created with the NSOpenGLProfileVersion3_2Core attribute on OS X Lion.
I didn't need to change too much of my 2.1 code, but I did need to update all my shaders. Most worked out of the box once I changed the keywords around though.
I didn't need to change too much of my 2.1 code, but I did need to update all my shaders. Most worked out of the box once I changed the keywords around though.
This is really an open ended question. What do you guys use for OpenGL 3.x rendering?
I use the latest version of GLFW (from their SVN repository), but SFML should work just fine as well.
I tried moving over to SFML 2.0, got the context, but haven't gotten anything to display.[/quote]
The number one difference that catches people out when moving to a 3.x context? Vertex Array Objects. If nothing is rendering, and your shader compilation isn't giving any errors, then there is a very good chance you have forgotten to create a VAO.
For GL 3.2 (or 3.3) and using VAO, there is this Wiki example
http://www.opengl.org/wiki/Tutorial1:_Rendering_shapes_with_glDrawRangeElements,_VAO,_VBO,_shaders_%28C%2B%2B_/_freeGLUT%29
http://www.opengl.org/wiki/Tutorial1:_Rendering_shapes_with_glDrawRangeElements,_VAO,_VBO,_shaders_%28C%2B%2B_/_freeGLUT%29
I did update my shaders and write an entire matrix stack class. At first I thought my vertices weren't binding to the shaders, but I ran a glQuery and it said that they were all being generated. I thought that I only needed to use a VBO but I'll try switching the code to use a VAO. Thanks for the help.
As for what I'm going to do with geometry shaders, I need it for my senior project for college. Right now I store terrain in a large array and do some basic frustrum culling to know what to display. The terrain is based off of a heightmap created at run time from a 5 different perlin noise functions. I have water implemented as a plane with a procedural texture to simulate movement with the ability to do vertex displacement. The geometry shader would allow me to tesselate the water and generate normals for the water. I can also move to a 3D noise function to generate the terrain with a marching cubes implementation similar to what was outlined in the gpu gems 3 book. Geometry shaders aren't the main focus of the project, it's called "Procedurally Generating Everything." Right now I'm only using Perlin noise for all my work, but I may extend it to cellular and fractal generation for some things depending on how much time I have next semester and whether or not I feel like writing another chapter or two for the paper.
As for what I'm going to do with geometry shaders, I need it for my senior project for college. Right now I store terrain in a large array and do some basic frustrum culling to know what to display. The terrain is based off of a heightmap created at run time from a 5 different perlin noise functions. I have water implemented as a plane with a procedural texture to simulate movement with the ability to do vertex displacement. The geometry shader would allow me to tesselate the water and generate normals for the water. I can also move to a 3D noise function to generate the terrain with a marching cubes implementation similar to what was outlined in the gpu gems 3 book. Geometry shaders aren't the main focus of the project, it's called "Procedurally Generating Everything." Right now I'm only using Perlin noise for all my work, but I may extend it to cellular and fractal generation for some things depending on how much time I have next semester and whether or not I feel like writing another chapter or two for the paper.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement