Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Apr 2011
Offline Last Active Today, 08:00 AM

Topics I've Started

Having a lot of trouble getting OpenGL to work

19 January 2015 - 06:41 AM

In an effort to not lock out OSX/Linux users from things I hope to create, I'm learning OpenGL, using C++ on Windows 8.1. I'm compiling with CL (MSVC++2013 update 3) from the command line, and using VS2013 for debugging. Unfortunately I am having problems even getting to a stage where I can put a few test vertices on screen.


My main problem has been that I keep getting the error "invalid enumerant" when I try to create a vertex shader like so:

auto id = glCreateShader(GL_VERTEX_SHADER);

My initialization code looks like this:

GLFWwindow *window;
if (!glfwInit())
	return 0;


window = glfwCreateWindow(width, height, "My App", 0, 0);
if (!window)
	return 0;


glewExperimental = GL_TRUE;
int error = glewInit();

Here's a log dump from my console:

[Graphics] Vendor: NVIDIA Corporation
[Graphics] Renderer: GeForce GTX 670/PCIe/SSE2
[Graphics] Version: 4.1.0 NVIDIA 347.09
[Graphics] GLSL Version: 4.10 NVIDIA via Cg compiler
[Shaders] Compiling shader file: vs-default.glsl
[Shaders] Unable to create shader: invalid enumerant
  • I have the latest driver from NVIDIA
  • My video card supports up to version 4.5, but I have also tried setting 3.2, 3.3, 4.0, 4.1 and 4.4.
  • I'm using GLFW3 and GLEW.
  • I have glewExperimental = GL_TRUE right before glewInit().
  • I have tried setting glewExperimental = GL_FALSE, to no avail

The opengl32.dll in my system32 folder has the following properties:
I found some old thread from 2011 without much in the way of help, but one person said that GLEW wasn't great with core profile stuff, though that's around three years out of date. Nevertheless, I tried using the glbinding project, but I was unable to get it to work with glfw, as glfw defines __gl_h_, which causes glbinding to break on compile, complaining that it's not compatible with __gl_h_, which I find strange given that the glbinding readme file cites glfw as one of the possible opengl libraries that it can be used with.
Anyway, I'm stuck. Roadblocked before I even got a chance to start doing anything with OpenGL. Any help would be appreciated.

A few general questions to point me in the right direction

20 December 2014 - 09:01 PM

One thing I've found frustrating learning graphics programming is information overload - not knowing what approach to take for a given problem, or indeed what approaches are even available for a problem. Obviously "Google is your friend", but when you get a mass of different results and possible approaches, it can be hard to know which techniques are most commonly used, which are easiest to implement, which are outdated and have been superceded by better techniques, and so forth. I'd prefer to avoid wasting time on outdated techniques and wild goose chases as much as possible.


So here are some questions that maybe that the experienced graphics devs here can answer...


1) Paying for papers? To implement this or that algorithm it is clear that in a lot of cases I need to read a paper which describes an algorithm to solve the problem. Do you find you often have to pay for these papers? I have noticed that a Google search for an algorithm of some kind frequently results in me being stonewalled by payment gateway before I'm allowed to access a given paper. Is paying for papers just something I should accept is going to become the norm for me?


2) Patent concerns? As an extension of the above question, how afraid should I be of patents? Are you guys having to hold back from implementing what is described in certain papers due to patent infringement concerns? Does paying for papers usually grant me a license to use what the paper describes? What's the usual approach here?


3) Drawing 2D vector graphics? I've been learning the Paradox game engine this past week. I've started with 2D graphics so that I can learn the foundational stuff, and in the process I've found that it doesn't really give me anything for procedurally drawing and filling vector paths (e.g. lines, circles, bezier curves, etc.). Seeing as I have the option of creating an empty texture, populating a buffer with raw data and assigning that to the texture, I'm assuming I probably need to learn some algorithms to do so. Just to get my feet wet I learned Bresenham's line algorithm, which obviously is kind of old and ugly, but I started to realise as I looked for alternatives that there are a lot of ways to do things, and a lot of different papers describing those different ways. If I want to draw vector graphics to a byte array, ready for use as texture data, am I likely going to have to buy some papers and figure out how to translate what they describe into code and accept that it'll take me a while but ultimately I'll have a great vector library I can use for years to come? Or am I missing something obvious that would make my life easier?


4) Current vector drawing algorithms? If the answer to the above question is that I'm going to need to read papers and figure it out, is there a resource that I can refer to that highlights the most common modern algorithms and/or techniques for drawing vector graphics? If not, can you recommend any standard modern algorithms that I should be trying to implement? I want to be drawing curves, ellipses, straight lines, rectangles, etc. I want the option to stroke and fill in different colours (and possible with patterns or textures).


5) Shader programming? I understand the basics of shader programming, as I have followed basic tutorials and lessons in setting colours, interpolating and so forth. In other words I understand the basic concept behind shader programming. I know the GPU Gems series offers a lot of miscellaneous techniques for doing random pretty things, but it's not really structured at all. I was wondering if there is a particular book (or online resource) that focusses on shader programming and takes a beginner from a basic foundation and builds up to implemention of various advanced techniques. What resources do you recommend above others?


6) Bonus question - vector glow effects? In Limit Theory, the developer has nice glowy effects around his vector shapes, which he generates procedurally. I don't need to know how to implement this right now, but it would be nice to have an idea about where to even start implementing such an effect when I'm ready to do so. Should I want to do this, what should I look into? See below for an example of what I'm talking about:



Edit: regarding question 6, I found a clue in this: http://forums.ltheory.com/viewtopic.php?f=6&t=1843


Edit: found another gold mine of information here: http://www.iquilezles.org/www/index.htm

Logging in logs me out elsewhere

20 December 2014 - 01:39 PM

I doubt this is a bug so much as dodgy login code. It is annoying that the site only lets you maintain one login at a time. It means that I can't easily switch back and forth between my computer and my mobile device, e.g. checking for new content using my phone, and my main desktop computer. Logging in on one device causes me to become logged out on another. This creates friction when trying to be involved and means that sometimes when I might participate in a thread, I don't, because my phone has become logged out as usual, so I am forced to log in to see what content is new or to reply to a thread. Most other forums do not have this problem.

Limit Theory update #21

13 December 2014 - 11:01 PM

Josh Parnell's work is seriously awe-inspiring. Check out his latest:


Graphics programming theory help - trade for web dev help/advice/work?

04 December 2014 - 11:59 PM

Hey all, I really want to gain some expertise in graphics programming and am trying (currently going through Real Time Rendering, and calculus on Khan Academy), but I am finding that I hit roadblocks where if I just had someone I could have a conversation with to help me clarify things, I'd be able to move a lot faster and skip over some of the frustration I'm experiencing. I can post individual questions on here I guess, but it's really hard to get the clarity I want and hone in on the answers to the questions I have without having that opportunity to have an actual back and forth conversation with someone who is experienced and knows what they are doing.


So here's my offer, if anyone is even remotely interested. I have been doing full-stack web development my entire career (1998+). I know design, I know typography, I know advanced JavaScript and CSS like the back of my hand. I know cross-browser development and responsive design. I know the .Net stack (C# in particular) very well, having used them since 1.1 in 2003, and I am well-versed in various database technologies. I feel very comfortable with general problem-solving, system design, planning and architecture. If you need any assistance or advice in any of these areas, I'd love to get you on Skype and trade some knowledge, or maybe help you out a bit with tuning up your website's design or functionality (within my skill set) in return for a bit of just general help understanding the theory. I actually really enjoy helping others learn in areas  I have skills in, so trading some knowledge, or just being generally available for when you have questions would be no problem at all.


My trouble area right now is understanding lighting fundamentals. I'm getting there, but it doesn't feel intuitive at all yet, and I'm having trouble understanding some parts of the radiometry section of Real Time Rendering (if you have this book and understand its contents, that's a big plus).


At the very least it'd be nice to have a few contacts in this space that I can bounce stuff off of. Skype and Google Hangouts are my primary means of communication. Let me know.