I've been trying to learn this stuff too. One useful way to learn different techniques is http://glsl.heroku.com/ It has loads of shaders for generating full screen effects with no textures, just...
Type: Posts; User: Stuart McDonald
I've been trying to learn this stuff too. One useful way to learn different techniques is http://glsl.heroku.com/ It has loads of shaders for generating full screen effects with no textures, just...
Solved. Like an idiot I'd put the call to turn off the stencil test in the wrong place. What I don't understand though is why it worked at all.
Just trying to use the stencil buffer for the first and and my first test worked straight away. To write to the stencil I used
// Clear the stencil to 0
glEnable(GL_STENCIL_TEST);
...
Thanks for that. I was planning on using it for effects. I'm working in 2D and can render an image using a tri-strip grid with a vertex for each pixel. I modify the grid to get wierd effects, but on...
I'm a bit confused about R2VB and googling only added to my confusion. If I want to modify the vertices of a mesh on the GPU is R2VB the way to go? The "easy" way seems VTF, but that appears to only...
Aha yes. I hadn't thought of using a shader. I'd just assumed that since my maths is so bad that there was way to do is just with a glFrustum. Cheers.
I'll probably use wrong terms but hopefully I can explain this to make some kind of sense...
I'd like to set the projection so that objects are scaled based on their Z value, but their X,Y screen...
If you don't get an answer here you could try the FTGL mailing list. https://lists.sourceforge.net/lists/listinfo/ftgl-devel they are very helpful.
The simple brute force way to do collision detection in a light cycle game is to have a large 2D grid of your world which you set the X,Y points of where there are walls/trails/anything you can hit....
Do you have to/want to do the collisions that way? Depending on memory/size of world/collision resolution you could just store a large 2D 1bit array of which locations have a trail and which don't....
The swap interval is to do with v-sync i.e. so you can wait until the current frame has been drawn before you start drawing the next one.
With v-sync off you can get what's called 'tearing' where...
Have you enabled blending? Otherwise the heart won't being drawn transparent. Try something like
glEnable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA,...
To answer my own question. There is both a bug in the Mali driver and in my calculation. To sample the center of the texel 0.5 needs added to the X,Y (since 0,0 is the bottom left corner of the first...
If I have a texture atlas, TexSize x TexSize square, and I want to access a Width x Height image at X,Y then are the texture coordinates
bottom left = X/TexSize, Y/TexSize
top right =...
You could use gDEBugger (http://www.gremedy.com/) to inspect the texture (doesn't do anything you can't do yourself, just makes it nice and easy and with a GUI). Lets you inspect the texture values,...
The point was to see if this is something specific to GLFW.
You could build a debug version with a static GLFW and step through it's code to see exactly what's going on. Also, you could use...
I'm using GLFW on Windows 7 with ATI card compiling with minGW and I've not seen this, but I did have a problem with fullscreen taking over a minute to start up. A couple of driver updates later and...
You also might want to consider GLFW. I prefer it to GLUT, it has joystick support and is still being updated. It's a very easy switch from GLUT to GLFW.
Maybe not of use (2D), but there is also this idea
pixel-perfect collsions using occulsion query
Never mind. My maths was correct. I had assumed the problem was with the amount I was moving the Texture Matrix to scroll a ground texture, but in fact I had a getY() call instead of getZ() for the...
Ok, it's too late and I just can't get my head round this.
I have a perspective projection onto a texture which is parallel to the screen. The camera is straight onto the texture and moves...
Only thing I can suggest would be to get the GLUT and GLFW sources, knock up a stripped down test program to init/terminate and proceed from there.
I used to use GLUT and switched to GLFW since I find it to be a nice interface, but you can do what you want in either. I solved a similar problem. I wanted the cursor to be clamped within a circle...
Thanks for the replys. Want to keep running on older cards, so Geom Shader is out, but I'll try the vertex shader approach and do some benchmarking. I've only just got it to the "it seems to run" and...
First off, thanks again Zbuffer for your invaluable help!
To make this topic more useful for anyone coming across it I thought I'd share what I came up with.
First, I render the scene to a 4x...