opengl

How Do I Create Cheap Shadows In OpenGL?

I have two models, A and B, and one light, L. I would like model A to cast a shadow on model B. I don't want to bother with shadow volumes or proper shadows for the moment, just a simple circle shadow will suffice. The effect is that model A is treated as a sphere for shadow casting purposes. Here is how I envision the algorithm: Fo...

OpenGL quad rendering optimization

I'm drawing quads in openGL. My question is, is there any additional performance gain from this: // Method #1 glBegin(GL_QUADS); // Define vertices for 10 quads glEnd(); ... over doing this for each of the 10 quads: // Method #2 glBegin(GL_QUADS); // Define vertices for first quad glEnd(); glBegin(GL_QUADS); // Define vertices for...

How to use fonts in opengl in java?

The title pretty much sums it up - its the easiest thing in the world in C++ and Windows, but Java seems to struggle with this issue. I would like to stay away from solutions involving loading bitmaps of fonts, and instead try go for a native truetype font loader, if possible. Kerning and antialiasing is quite important in my applicatio...

Porting a Qt Application from Linux to Windows

I built a qt application that uses opengl on linux and am trying to build it on windows. I used g++ to make it on linux and am using command line nmake for Visual Studio 2005 to build it on windows. When I tryed to build my application I typed qmake -makefile app.pro nmake The nmake failed and said "bool qt_win_owndc_required"... alr...

How to use texture compression in openGL?

I'm making an image viewer using openGL and I've run into a situation where I need to load very large (>50MB) images to be viewed. I'm loading the images as textures and displaying them to a GL_QUAD which has been working great for smaller images, but on the large images the loading fails and I get a blank rectangle. So far I've implem...

How do I get all the shader constants (uniforms) from a ID3DXEffect?

I'm creating an effect using hr = D3DXCreateEffectFromFile( g_D3D_Device, shaderPath.c_str(), macros, NULL, 0, NULL, &pEffect, &pBufferErrors ); I would like to get all the uniforms that this shader is using. In OpenGL I used glGetActiveUniform and glGetUniformLocation to...

How to Detect Hardware Acceleration

Is there a Win32 API call that detects the current Hardware Acceleration level of a user's system? I have no need to change the setting, but I'd like to scale back the level of detail for my OpenGL display if hardware acceleration is disabled. ...

C++ vector element is different when accessed at different times

OK. I'm confused. I'm developing a 3D game using SDL and OpenGL on Ubuntu 9.04 using Eclipse CDT. I've got a class to hold the mesh data in vectors for each type. Such as Vertex, Normal, UVcoord (texture coordinates), as well as a vector of faces. Each face has 3 int vectors which hold indexes to the other data. So far my game has b...

C++ Cross Platform Image Loader for OpenGL

I have tried everything from SDL to DevIL, and they have all failed for various reasons. SDL segfaults for various reasons, and DevIL is having some weird problem where even after i include IL/ilut.h and linking everything, and including the other headers, it is not defining the functions i need to load images into opengl textures (som...

How to create a fractal cube?

I would like to render volumetric clouds in OpenGL. I found an interesting paper that describes a simple technique to render volumetric clouds. (http://www.inframez.com/events_volclouds_slide18.htm) However I don't know how to create their "fractal cube" (or perlin-noise cube). My question is: how to create the 6 tileable fractal textur...

Would it be useful for me to learn OpenGL?

I have had my OpenGL Redbook on the shelf for months. I am wondering if I should finally get around to reading it and learning OpenGL. Is it worth it for me to spend the time to learn OpenGL? ...

Textures not working in opengl/Tao for C# on intel chipsets

Hi all, I've got a lot of OpenGl rendering code in a C# .NET 3.5 sp1 application. Some of the code can be found in this question. Huge problem: The code is not running at all on intel chipsets, such as the 915M or the Q35. These chipsets are spec'd to run opengl 1.4, and my code is all power-of-two nice and so forth. I've tried upd...

Windows message loop

Theres some reason for this code not reach the first else? I got it exactly the same from vairous sources. Than I did my own encapsulation. Everything goes fine. Window is created, messages are treated, events are generated to keyborad input in the client area, the gl canvas works fine (when I force it to draw). The only problem is that...

OpenGL/JOGL: Can you render two quads with transparency at the same point?

I'm learning about how to use JOGL and OpenGL to render texture-mapped quads. I have a test program and a test quad, and I figured out how to enable GL_BLEND so that I can specify the alpha value of a vertex to make a quad with a sort of gradient... but now I want this to show through to another textured quad at the same position. Drawi...

OpenGL V DirectX (the endless war)

Hi there, I'm trying to work out whether to learn DirectX or to continue on with OpenGL... I dev mainly games, and I know enough of OGL to get by, nothing more. I know that DirectX and D3D are popular amongst professional games developers, is there any reason behind this? Which API is easier to learn and use? Is there any difference i...

Connecting Catmull-Rom splines together and calculating its length?

I'm trying to create a class which takes in any number of points (position and control) and creates a catmull-rom spline based on the information given. What I'm doing - and I'm really unsure if this is the right way to do it - is storing each individual point in a class like so: class Point { public: Vector3 position; Vector3 control...

GLSL extracting modelmatrix from modelviewmatrix and viewmatrix

hello, since in GLSL the modelmatrix is not available, i was wondering if it is possible to get it programatically from the gl_ModelViewMatrix and the "viewmatrix" which i would pass as a uniform? if yes, how? thank you! ...

3D Graphics Tutorials

I want to start writing simple iphone apps to simulate in 3D things like rolling dice, playing billiards, dropping objects from a certain height, throwing a ball, etc. Just basic motion simulation in 3D. I've searched and searched for a tutorial that would get me started here without success. A perfect intro tutorial for me would be a...

OpenGL texturing via vertex alphas, how to avoid following diagonal lines?

http://img136.imageshack.us/img136/3508/texturefailz.png This is my current program. I know it's terribly ugly, I found two random textures online ('lava' and 'paper') which don't even seem to tile. That's not the problem at the moment. I'm trying to figure out the first steps of an RPG. This is a top-down screenshot of a 10x10 heightm...

Is it possible to use texture coordinates/matrix with OpenGL point sprites?

I'm working on a particle system and point sprites would be nice to use. Unfortunately I have a constraint that I pack ALL my textures in a single texture atlas. This is a huge overall speed boost to my engine as I never have to switch texture bindings. But as a result I need to be able to specify a source texture rectangle for my partic...