textures

Opengl: use a texture only to give alpha channel to a colored object

I'm new at OpenGL and I can't find out how to do this: I want to render a letter and be able to change it's color, so I have a texture with the letter on a transparent background. I managed to render it using this code: glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) But that renders the letter in black, as it's...

OpenGL named textures not working

glBindTexture(GL_TEXTURE_2D, texidx); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 512, 512, 0, GL_RGBA, GL_FLOAT, texdata); If texidx == 0 everything works perfectly, but if texidx != 0, or is generated using glGenTexture(&texidx,1), the eventual rendering shows just solid color (last glColor) instead of the texture. I've been debugging fo...

GLPaint sample set background image

Hi all! I'm looking the GLSample provided by apple and I have a question... how can I change the background (now is black)?? best was to use an image!! thanks ...

how to detect if openGL/card supports non power of 2?

What is the best way to detect if a graphics card and compiled openGL binary supports textures which are not a power of 2 at run time? ...

How to check for mip-map availability in OpenGL?

Recently I bumped into a problem where my OpenGL program would not render textures correctly on a 2-year-old Lenovo laptop with an nVidia Quadro 140 card. It runs OpenGL 2.1.2, and GLSL 1.20, but when I turned on mip-mapping, the whole screen is black, with no warnings or errors. This is my texture filter code: glTexParameteri(GL_TEXTU...

How can I parse through a texutre in DirectX? (IDirect3DTexture9*)

I've been trying to figure out how to parse textures in directx for two reasons: to write my own texture format and to manipulate data in existing IDirect3DTexture9 type textures. I've been looking at the IDirect3DTexture9::LockRect() function but I'm unsure how it works, are the void* pBits I get out of it in D3DLOCKED_RECT the data in...

[WPF or other 3D tech] Light Map projection

Hi, What i'm trying to do is making a "light projector" with visible ray(like with fog) also called volumetric light; and which project a image (bitmap) ; Because i would like to keep this project connected with a wpf application ( to get brush, position, rotation from data), i've choose to use WPF 3D But it seem that WPF can't hand...

Could somebody explain how to use glDrawElements (iPhone)?

Sorry for the duplicaiton, but I've been googlin' for hours now without any result. I have this (optimized) data of a simple cube exported from a converter: // 8 Verticies // 4 Texture Coordinates // 6 Normals // 12 Triangles static GLshort cubeFace_indicies[12][9] = { // Box001 {2,0,3 ,0,0,0 ,0,1,2 }, {1,3,0 ,0,0,0 ,3,2,1 }, ...

OpenGL textures fails on Motorola Milestone

Hi, I have troubles with OpenGL textures on Motorola Milestone with 2.1 firmware. Each call to glGenTextures fails with error GL_INVALID_OPERATION and sets the id with random numbers. The exact same application works on G1 without any error. Does anybody have a hands-on experience with a similar issue and knows a way around? ...

How can I repeat a 3x9 texture in OpenGL's GLSL?

I have a texture with a 3x9 repeating section. I don't want to store the tesselated 1920x1080 image that I have for the texture, I'd much rather generate it in code so that it can be applied correctly at other resolutions. Any ideas on how I can do this? The original texture is here: http://img684.imageshack.us/img684/6282/matte1.png I ...

How to apply multiple textures to a VBO of a cube?

Dear reader, I'm new to VBO's and read some articles on creating and using VBO's. I am working on a application where I want to create a dozen of rotating cubes. I'm connected to a server which pushes text messages to my application. When I receive 6 text messages, I render these messages using Pango and Cairo. Then I want to create t...

Problems with glDrawTex_OES

I'm not sure I'm using glDrawTex_OES correctly. In fact, I'm sure I'm not because I'm getting a black rectangle on the screen rather than the intended texture. To get the silly points out of the way: Yes, the GL Extension string contains the OES_draw_texture token. Yes, the texture is loaded into memory/etc. correctly: it displays ju...

Draw a texture in OpenGL while ignoring it's alpha channel.

I have a texture loaded into memory that is of RGBA format with various alpha values. The image is loaded as so: GLuint texture = 0; glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); self.texNum = texture; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE...

OpenGL: GL_TEXTURE_1D trouble

I'm trying to add a simple repeating shaded gradient (think laminated layers) along the Z axis of arbitrary, highly tessellated objects (STL imports). It's mostly working, but I get some really weird faces where the texture is not parallel to Z, but rotated and scaled differently. These faces are usually (possibly always) oriented vert...

Copy Texture to Texture

I've done 2 programs to use Shared Resources, running on SlimDX & DirectX10. One program will display the shared texture on a 3D mesh. The 2nd program will load an image as texture. So far I need to pass the shared handled everytime the texture is update from a new image. Now, is there a way that I can initialize a fixed size shared tex...

OpenGL Hemisphere Texture Mapping

I need to have a hemisphere in opengl. I found a drawSphere function which I modified to draw half the lats (which ends up drawing half of the sphere) which is what I wanted. It does this correctly. However, I don't know what i should do with glTexCoordf to get the textures to map properly onto this half sphere. I'm really not great w...

How do I set a world background texture in Blender 2.49 using Python ?

Hello, I'm trying to set a background World Texture in Blender 2.49. I've made a texture: import Blender from Blender import * import bpy world = World.GetCurrent() worldTex = Texture.New('worldTex') worldTex.setType('Image') worldIm = Image.Load('//blender_scene/tex/bg 001.jpg') worldIm.source = Image.Sources.SEQUENCE worldT...

XNA crop 2d Texture

Hey guys, is there a way to crop a 2d texture? Thanks, Max ...

Opening Images into OpenGL textures and saving textures as PNGs with Cocoa

Hello. There is a lot of conflicting information on how to open images with Cocoa for use with OpenGL. I want to open JPG and PNG files and save PNG files for my program which uses Cocoa on the Mac version. What is the best way to do these two tasks? Thank you. ...

Loading textures using TextureLoader from Resources

Hello, I'd like to ask how could I load textures from program resources. This code works fine, but its only from file. How about loading from resources? texture = TextureLoader.FromFile(device, "file.png"); ...