I wondering if there is a faster (GPU time) way to draw a full-screen quad in OpenGL:
NewList();
PushMatrix();
LoadIdentity();
MatrixMode(PROJECTION);
PushMatrix();
LoadIdentity();
Begin(QUADS);
Vertex(-1,-1,0); Vertex(1,-1,0); Vertex(1,1,0); Vertex(-1,1,0);
End();
PopMatrix();
MatrixMode(MODELVIEW);
PopMatrix();
EndList();
note th...
I wondering if there is a way to optimize this vertex shader.
This vertex shader projects (in the light direction) a vertex to the far plane if it is in the shadow.
The aim of this shader is to create a shadow volume object that enclose the shadow of the object itself.
void main(void) {
vec3 lightDir = (gl_ModelViewMatrix * gl_Vertex ...
I've been working with the depth buffer in OpenGL (JOGL) to ensure certain items are rendered in front of others by disabling the depth buffer (detailed in my previous question http://stackoverflow.com/questions/2516086/java-opengl-saving-depth-buffer).
This works, except when I set the color of an item that is being drawn when the dept...
In my C OpenGL app the window style requires WS_SYSMENU to show the close and minimize buttons, but it also brings up a stupid menu everytime I press alt.
How can I disable this?
...
I want to write some games, but I don't have any game development experience. Any books are recommended? Is this necessary to have a good Maths skill when taking about some physical actions? Also, is it complex to do some AI design? thz a lot.
...
I want to scale an image using openGL, can anyone provide me with such code about how to do this ?
PS, I am using JGL as an openGL library for Java.
...
Hello:
I have implemented a Phong Illumination Scheme using a camera that's centered at (0,0,0) and looking directly at the sphere primitive. The following are the relevant contents of the scene file that is used to view the scene using OpenGL as well as to render the scene using my own implementation:
ambient 0 1 0
dir_light 1 1 1 ...
I am trying to use a trivial geometry shader but when run in Shader Builder on a laptop with a GMA X3100 it falls back and uses the software render. According this document the GMA X3100 does support EXT_geometry_shader4.
The input is POINTS and the output is LINE_STRIP.
What would be required to get it to run on the GPU (if possible)
...
I took advice from an answer to another question I asked which led to me using a DPI of 72 to match points to pixels for the text in my game.
The problem is that pyglet is rendering text far too big or far too small. Perhaps it depends on the framebuffer size? I haven't got a clue. Here's my code for rendering fonts:
class Font():
...
Usually when setting up OpenGL contexts, I've simply filled out a PIXELFORMATDESCRIPTOR structure with the necessary information and called ChoosePixelFormat(), followed by a call to SetPixelFormat() with the returned matching pixelformat from ChoosePixelFormat(). Then I've simply passed the initial descriptor without giving much thought...
I'm trying to design very simple animation in OpenGL such as rotating and translating objects.
In the red book, I found that using GLUT's glutIdleFunc() is okay for a simple animation.
How many times does glutIdleFunc(...) call the function in one second?
Thank you.
...
Hey,
I'm looking for a way to reproduce this foggy-sphere-glowing effect using Java3D.
http://bzflag.org/screenshots/bzfi0021.jpg
http://bzflag.org/screenshots/bzfi0019.jpg
http://bzflag.org/screenshots/bzfi0022.jpg
I'm creating a transform group with a point light source and an emissive-material-sphere, but I can't reproduce the fogg...
I'm getting in trouble. I'm trying to emulate the call Application.Run using Application.DoEvents... this sounds bad, and then I accept also alternative solutions to my question...
I have to handle a message pump like Application.Run does, but I need to execute code before and after the message handling. Here is the main significant sni...
I was porting a C++ program from Solaris Sparc to Solaris x86. The program utilizes OpenGL library and the compilation is performed in a Sun Ultra27 workstation with the default GCC (3.4.3) and OpenGL library come with the machine.
However, the following OpenGL call couldn't found while linking:
Undefined symbol firs...
Is it possible to set the color of a single vertex using a GLSL vertex shader program, in the same way that gl_Position changes the position of a vertex ?
...
Hi All,
I'm trying to perform hidden line removal using polygon offset fill. The code works perfectly if I render directly to the window buffer but fails to draw the lines when passed through a FBO as shown below
The code I use to draw the objects
void drawCubes (GLboolean removeHiddenLines)
{
glLineWidth(2.0);
glPushMatrix()...
I have built an OpenGL Viewer control that can simply be dropped onto a windows form (at design time) and assigned an OpenGL display list (at run time).
The viewer control handles navigation, display options (e.g. background color), etc. It is also responsible for creating and destroying rendering and device contexts as necessary.
Obv...
I'm trying to learn to play with OpenGL GLSL shaders. I've written a very simple program to simply create a shader and compile it. However, whenever I get to the compile step, I get the error:
Error: Preprocessor error
Error: failed to preprocess the source.
Here's my very simple code:
#include <GL/gl.h>
#include <GL/glu.h>
#include...
Hi,
I want to be able to calculate the direction of a line to eye coordinates and store this value for every pixel on the line using a vertex and fragment shader. My idea was to calculate the direction gradient using atan2(Gy/Gx) after a modelview tranformation for each pair of vertices then quantize this value as a color intensity to pa...
Hi, I'm trying to create a fullscreen application using Win32 and OpenGL. I change the resolution using EnumDisplaySettings and ChangeDisplaySettings and the OpenGL functions work fine. On its WndProc I handle WM_ACTIVATEAPP and detect when the user switched focus to another window, then I minimize the application's window. When the wind...