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...
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...
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
...
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?
...
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...
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...
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...
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 }, ...
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?
...
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 ...
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...
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...
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...
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...
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...
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...
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...
Hey guys, is there a way to crop a 2d texture?
Thanks,
Max
...
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.
...
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");
...