Pete's GPU Notes http://petewarden.com/notes/ en 2006-06-28T12:31:25-08:00 Running out of VRAM on OS X http://petewarden.com/notes/archives/2006/06/running_out_of.html OpenGL on OS X virtualizes texture memory. This means you can allocate an almost unlimited amount of textures, and the OS will keep them in system memory, and only copy them up to the graphics card when they're needed. This is a lot better than the old model of keeping all textures only in VRAM, and texture creation failing once you run out of memory there. But there's still cases where you have to worry about how much VRAM is available.

]]>
petewarden 2006-06-28T12:31:25-08:00
Debugging OpenGL on OS X http://petewarden.com/notes/archives/2006/06/debugging_openg_1.html It's tough to debug OpenGL problems, especially with pixel shaders. I'll cover some tips for any platform, and then some of the OS X built-in tools that can help.

]]>
petewarden 2006-06-12T12:32:37-08:00
Fragment Program Utilities http://petewarden.com/notes/archives/2005/06/fragment_progra_3.html download it.
]]>
petewarden 2005-06-27T17:11:01-08:00
Fragment Program Reference http://petewarden.com/notes/archives/2005/05/fragment_progra_2.html The OpenGL Extensions Guide has a great chapter on the ARB fragment program language, I recommend buying it, but there aren't many good references online. The most useful is the official spec, but it's designed as an exhaustive guide, not a quick reference for programmers. Here's a rundown of the instruction set, and some tips and tricks.

]]>
petewarden 2005-05-18T16:28:52-08:00
Mac PBuffers http://petewarden.com/notes/archives/2005/05/mac_pbuffers.html If you ever need to do more image processing than you can with a single fragment program pass, you'll need to render to a texture. The best way to do that on OS X is using a pbuffer, here's some example code for creating and using them.

I've included the code inline below, or you can get a zip of the code from PBufferUtils.zip here

]]>
petewarden 2005-05-17T17:25:12-08:00
Emulating Bilinear Filtering http://petewarden.com/notes/archives/2005/05/emulating_bilin.html Most graphics cards that support float textures can't bilinear filter them. We can use a fragment program to do the filtering for us, but it's tricky to get right. Here's an example of how to do it:

]]>
petewarden 2005-05-17T16:32:56-08:00
GPU Optical Flow http://petewarden.com/notes/archives/2005/05/gpu_optical_flo.html Optical flow analysis is heavily used by video and film processing apps, to retime images smoothly, apply motion blur as a post-process, and guide the application of other processes. It's traditionally a slow operation, I wanted to see if a GPU version was possible.

]]>
petewarden 2005-05-10T18:02:50-08:00
Random Numbers in Fragment Programs http://petewarden.com/notes/archives/2005/05/random_numbers.html It's hard to write a fragment program that will calculate pseudo-random numbers. The usual random number algorithms need two things that we don't have on our GPU's:

]]>
petewarden 2005-05-10T17:06:37-08:00
Quick and Dirty Vectorization http://petewarden.com/notes/archives/2005/05/quick_and_dirty.html There aren't many fast techniques for vectorizing an image into polygons that approximate the original, or that take advantage of 3d hardware, so here's one I've used.

]]>
petewarden 2005-05-10T17:05:45-08:00
Fragment Program Snippets http://petewarden.com/notes/archives/2005/05/fragment_progra_1.html Here's some instruction sequences for common operations:

]]>
petewarden 2005-05-10T17:04:57-08:00
Fragment Programs-ATI R3xx vs NVidia NV34 http://petewarden.com/notes/archives/2005/05/fragment_progra.html ATI and NVidia cards have some differences it's important to know about when you're writing fragment programs to run on both.

]]>
petewarden 2005-05-10T17:03:01-08:00
Mac OpenGL contexts http://petewarden.com/notes/archives/2005/05/mac_opengl_cont.html A context is a container for the GL state information, things like the current color, transformation matrix, texture ID and anything else that needs to be remembered by OpenGL.

]]>
petewarden 2005-05-10T17:02:30-08:00
Straight Alpha and Bilinear Filtering http://petewarden.com/notes/archives/2005/05/straight_alpha.html There's a subtle problem using graphics hardware to do bilinear filtering on straight alpha images.

]]>
petewarden 2005-05-10T17:00:56-08:00
Animating Worley Noise http://petewarden.com/notes/archives/2005/05/testing.html Texturing and Modelling has a chapter by Steve Worley on using Voronoi diagrams to create a procedural noise pattern. I needed to find a way to animate and render this on a 2D plane using OpenGL.

]]>
petewarden 2005-05-10T16:38:33-08:00