Personal tools
You are here: Home downloads Gem Documentation GemFAQ
Document Actions


View entire FAQ in full Up to Table of Contents
Frequently Asked Questions

texture mapping

My image doesn't appear. What is going on?

Normally images have to be texture-mapped onto Geos. You have to use [pix_texture] to map the current image onto a Geo. "Current" means that any pix-manipulation that is done after texturing will not be displayed.

Any Geo has a color (which is initially set to white). If you have set the color to black, your Geo (including the image) might be very dark. If you are using alpha-blending, make sure that the Geo is not invisible.

Normally images that want to be texture mapped with openGL should have dimensions that are a power of 2 in both height and width. Now [pix_texture] will make this totally transparent to you (so normally you don't have to care about the size of the image). However with non-power-of-2 images pix_coordinate might not behave as expected, because these images need absolute texture-coordinates rather than normalized ones (as are used with power-of-2 images): so if the texture-coordinates are set to "(0,0) (1,0) (1,1) (0,1)" you might see only the first pixel of the image (which might be black).

Also, make sure that GEM can find your image (ie, that the path name is correct).

My image looks strange. What is going on?

GEM supports gray8, YUV, and RGBA images. If it sees that the number of bits per channel and the number of channels is something that it should be able to handle, it tries to load the raw data. If you have compressed or stored the pixel data in some "strange" format, then GEM will probably not read the information correctly. Also, if it is an RGBA image, then make sure that the alpha channel is something useful (this only matters if you are using the alpha channel, like in the alpha object or pix_mask).

Why does GEM say that it can't handle a gray image?

This error message occurs whenever a pix object receives a gray8 image and the implementor hasn't provided a way to deal with that format of image.

(Implementors often only provide functions for GEM's native color-format RGBA. Any other color-format (like BGR) will try to call the function for gray8 images, which might not be supported.)

If you do not want to change the image format with some extern image-programm (like Photoshop or the Gimp) you might want to try [pix_rgba] or harass whoever made the object to add the functionality.

What image formats can GEM handle?

GEM can read in TIFF, JPEG, and SGI images.

These can be in any color format. Gray scale images are loaded in as gray scale (ie, 1 byte per pixel). Everything else is loaded in or converted to an RGBA image (ie, 4 bytes per pixel).

If there is an alpha channel, then it will be respected. Otherwise, the alpha channel will be set to fully opaque (alpha == 255).

GEM can write TIFF and JPEG images. TIFF-images will be full RGBA-images, wheras JPEG-files only support (compressed) RGB.

What movie formats can GEM handle?

The movie formats GEM can handle (still) depend on the platform you are using.

On Windoze you can read all AVI-files you have codecs for

On linux the readable formats depend on the libraries you had installed when you compiled GEM. Currently there is (optional) support for AVI, quicktime (.MOV) and MPEG (.MPG) files. Not all quicktime-formats are supported. This is unfortunate but is due to linux restrictions. I highly recommend that you install the mpeg3-library from Heroine because it is much more stable than mpeg1 (which comes with many linux-distributions). If you have compiled in support for libavifile, you will be able to open Micro$oft-AVI-files. If you have installed the proper codecs (libavifile supports a mechanism for loading codecs from windows-DLLs?) you should be able to open almost any format. If you have serious problems, mail them to me. (Be ready to upload the movie-file that won't work)

On Mac os-X, just any format supported by that platform (this is basically QuickTime) should work fine.

Why is [pix_draw] so slow?

[pix_draw] is almost never hardware accelerated on PCs graphics accelerator. This means that it runs extremely slowly.

Always use [pix_texture], even if you are just displaying an image.

by IOhannes m zmoelnig last modified 2007-07-18 11:49 AM

Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser