opengl

glTexGeni and glBindTexture

To call glTexGeni(), must I call the following first? glBindTexture(texType, texId); glEnable(texType); Doing that will I set glTexGeni() to a desired texId? Otherwise, what's the behaviour if I call glTexGeni() before glBindTexture(): glTexGeni(...); glBindTexture(texType, texId); glEnable(texType); ...

What are the differences between a Frame Buffer Object and a Pixel Buffer Object in OpenGL?

What is the difference between FBO and PBO? Which one should I use for off-screen rendering? ...

Is it possible to render 2 different framebuffer objects from 2 different threads in opengl?

Or put in other words: Are different framebuffer objects different opengl contexts? If so, I could render the different FBO's in different threads and pass them once they are rendered off-screen to the main thread that will actually draw them in the screen context. Is it possible? Thanks ...

shadow mapping multitexture

There is this tutorial about shadow mapping: http://www.paulsprojects.net/tutorials/smt/smt.html Ok, but I did not realize how to make a scene with multitexture. If in the third pass of shadow mapping It is need to bind the shadow mapping projected texture to perform depth comparison, HOW can I bind another textures if I need to bind t...

iPhone & cocos2d - Interval Action timing problem while running in device

I'm using the cocos2d framework for various of my applications, and have run into the following problem. I have set up a few sequences of actions and CallFuncNDs, the actions have durations set up and when I run it in the iPhone simulator, it works just like I expect it to: transitions take the amount of time I set them to and they go in...

How do I make textures transparent in OpenGL?

I've tried to research this on Google but there doesn't appear to me to be any coherent simple answers. Is this because it's not simple, or because I'm not using the correct keywords? Nevertheless, this is the progress I've made so far. Created 8 vertices to form 2 squares. Created a texture with a 200 bit alpha value (so, about 80% t...

Converting an OpenGL application to make it work on the iPhone

Hello everyone, I am trying to convert an openGL application to make it work for iPhone. I am almost finished with everything. but got nothing & stuck up with this part. Can anyone tell me is everything ok with the following converted part. for(int y=0;y<wet->h-1;y++) { glDrawElements(GL_TRIANGLE_STRIP, wet->w, GL_UNSIGNED_BYTE,tex)...

Trouble porting OpenGL code to iPhone's OpenGL ES

Here, is the sample code which I am using. This code is in OpenGL. I want to port it to OpenGL ES. glArrayElement() is not supported in OpenGL ES. Instead, it was recommended to use glDrawElements(), glDrawArrays(). I am not able to convert this. Can you please help me out to convert the code. glTexCoordPointer(2,GL_FLOAT,sizeof(struct ...

Polygon math

Given a list of points that form a simple 2d polygon oriented in 3d space and a normal for that polygon, what is a good way to determine which points are specific 'corner' points? For example, which point is at the lower left, or the lower right, or the top most point? The polygon may be oriented in any 3d orientation, so I'm pretty sur...

3d Camera Position given some points

Heyo, I'm currently working on a project where I need to place the camera such that the full motion of a character would be viewable without moving the camera. I have the position where the character starts, as well as the maximum distance that the character will travel in all three directions (X,Y, & Z). I also have the field of view (...

Take screenshot of any external application using C#

We have a C# (WPF) application in which we want to take a screenshot of an arbitrary application launched by us (i.e. so we have a reference to the Process we started). The application may be minimized or behind other windows but we still only want the image of the individual application, not overlapping pixels. I know the typical P/In...

OpenGL alpha value makes texture whiter?

I'm trying to load a texture with RGBA values but the alpha values just seem to make the texture more white, not adjust the transparency. I've heard about this problem with 3D scenes, but I'm just using OpenGL for 2D. Is there anyway I can fix this? I'm initializing OpenGL with glViewport(0, 0, winWidth, winHeight); glDisable(GL_TEXTU...

What percentage of Windows boxes have OpenGL support

I've been thinking about starting a new graphics project and I want to use Java. Java has wrappers for all of the relevant GL functionality but I wonder how many people, including casual users, actually have decent GL drivers installed. By decent, I mean somewhat stable and fairly new (GL 1.5 support would probably do although the GLSL...

If you were to clone Monopoly Tycoon in Python, what libraries would you use?

Ever played the game Monopoly Tycoon? I think it's great. I would love to remake it. Unfortunately, I have no experience when it comes to 3D programming. I imagine there's a relatively steep learning curve when it comes to openGL stuff, figuring out what is being clicked on and so on... If you were to undertake this task, what librari...

Is it possible to do a nice bloom filter on the iPhone?

I'm working on an iPhone game with simple vector graphics and though it would look extra nice if the objects on screen glowed (i.e. had a bloom filter applied to the render). I'm fairly new to post-processing techniques and most of the tutorials I'm reading utilize shaders on the GPU. I'm just wondering if this is possible on the iPh...

Quaternion math for rotation?

I'm drawing a flat disk using gluDisk() in my scene. gluDisk() draws the disk facing the positive Z axis but I want it to be facing some arbitrary normal I have. Clearly I need to use glRotate() to get the disk facing properly but what should be the rotation? I remember this can be calculated using Quaternions but I can't seem to remembe...

Best way to organize entities in a game?

Let's say I'm creating an OpenGL game in C++ that will have many objects created (enemies, player characters, items, etc.). I'm wondering the best way to organize these since they will be created and destroyed real-time based on time, player position/actions etc. Here's what I've thought of so far: I can have a global array to store po...

glReadPixels from FBO fails with multisampling

I have an FBO object with a color and depth attachment which I render to and then read from using glReadPixels() and I'm trying to add to it multisampling support. Instead of glRenderbufferStorage() I'm calling glRenderbufferStorageMultisampleEXT() for both the color attachment and the depth attachment. The frame buffer object seem to ha...

Learning OpenGL through Java.

I'm interested in learning OpenGL and my favorite language at the time is Java. Can I reap its full (or most) benefits using things like JOGL or should I instead focus on getting stronger C++ skills? Btw, which is your Java OpenGL wrapper library of choice and why? ...

Obtaining current ModelView matrix

In OpenGL, how do I read the current x/y translation in the modelview matrix? I know that you have to load the current matrix into an array and read the floats from there, but I don't know precisely how to do it. ...