texture

java/opengl: loading textures on 64bit VM

hello, it seems my texture loader doesnt work anymore when run in a 64bit environment. im not sure if the cause is the 64bit VM itself or if the file lying on a 64bit filesystem. the image to load is a RGBA png file, it shows up correctly on 32bit windows systems, but on my 64bit win7 some color channels seem flipped. here is my code: ...

How do I arbitrarily distort a textured polygon?

I'd like to write a program that lets me arbitrarily distort a textured polygon by dragging its vertices. I want the texture to distort fluidly and without overlap, assuming the new polygon doesn't intersect itself. I should also be able to repeat the process with the new shape, and with a minimum amount of loss. Are there any algorithm...

Directx9 Specular Mapping

How would I implement loading a texture to be used as a specular map for a piece of geometry and rendering it in Directx9 using C++? Are there any tutorials or basic examples I can refer to? ...

Opengl ES - drawing a plane of multiple vertices

Hi Using Opengl ES for Anroid we’re facing a problem when drawing a square with a texture. They look fine from a distance, but when getting close to the model the texture screws up. We believe this is caused by the fact that the model only consists of four vertices: float[] coords = { -1, 1, 0.0f, 1, 1, 0.0f, -1, -1, 0.0f, 1, -1, ...

Texture streaming, where do I begin?

I'm interested in texture streaming in DirectX but google seems unhelpful. Maybe I just don't know the right questions to ask, can anyone point me on where to begin reading to learn about impleneting texture streaming? ...

Direct3D: Draw textured cube with single DrawIndexedPrimitives call. Possible?

I am trying to draw a textured cube using just 8 vertices and one DrawIndexedPrimitives call. Is this even possible? I am having problems with the UV co-ordinates. I am finding it impossible to come up with suitable UV values which will work for all faces of the cube. Take the following numbering as an example: UV is set to (0, 0) ...

Why is my Python OpenGL render2DTexture function so slow?

SOLVED: The problem was actually using time.time() every CPU cycle to see whether the next frame should be drawn or not. The time it takes to execute time.time() was having an impact on the FPS. I made this function for drawing 2D textures as images in a 2D view in my OpenGL application. After doing some testing I found that it takes up...

iPhone, creating a texture using an array

I would like to copy an array of pixel data (colors) into a texture. Please could someone point me in the right direction? I have looked on google but all of the tutorials are for OpenGL, rather than OpenGL ES. Thanks :) ...

OpenGL: raster texture directly to screen?

I have an OpenGL texture. There is a rectangle on my viewport the same size as the texture. Is there a way to raster the texture directly to the screen, without pasting it first on some quad? Thanks! ...

How to detect a image texture?

So we have a photo like this How to detect that a red wall has a white figure painted on it and that that white figure is a texture and than how to cut that wall from the picture? I need an algorithm for performing such operation programaticly (not by hand) ...

problem while displayin the texture image on view that works fine on iphone simulator but not on device

hello i am trying to display an image on iphone by converting it into texture and then displaying it on the UIView. here is the code to load an image from an UIImage object - (void)loadImage:(UIImage *)image mipmap:(BOOL)mipmap texture:(uint32_t)texture { int width, height; CGImageRef cgImage; GLubyte *data; CGContextRef cgContex...

Can I apply a texture to UIToolbar?

I tried doing this: [toolbar setTint:[UIColor colorWithPatternImage:[UIImage imageNamed:@"thingFromMyBundle.png"]]]; but it just ended up black. At first I assumed you weren't allowed to "tint" with a texture, but I've seen apps recently that can do this. Am I missing something? Thanks. ...

[OpenGL] Interleaving Vertices and Texture Coords and Normals

My buddy read an OpenGL book that said interleaving your vertex pointers and the corresponding texture coords etc to be next to each other in a larger array gives a speed boost. How much of a speed boost? On which chip sets? ...

How to write to the OpenGL Depth Buffer

I'm trying to implement an old-school technique where a rendered background image AND preset depth information is used to occlude other objects in the scene. So for instance if you have a picture of a room with some wires hanging from the ceiling in the foreground, these are given a shallow depth value in the depthmap, and when rendered...

SDL_Surface to IDirect3DTexture

Can anybody help with converting an SDL_Surface object, a texture loaded from a file, into an IDirect3DTexture9 object. ...

Can CUDA results be stored in an OpenGL accessible texture?

Can CUDA be used to generate OpenGL textures? I know it can be done by reading the CUDA results back into system memory, and then loading that into a texture... But I'd like to find a way to save this copy... Can CUDA be used to generate textures? ...

Bind texture with pinned mapped memory in CUDA

I was trying to bind a host memory that was mapped for zero-copy to a texture, but it looks like it isn't possible. Here is a code sample: float* a; float* d_a; cudaSetDeviceFlags(cudaDeviceMapHost); cudaHostAlloc( (void **)&a, bytes, cudaHostAllocMapped); cudaHostGetDevicePointer((void **)&d_a, (void *)a, 0); texture<float, 2, cudaR...

Loading PNG textures to OpenGL

Hello, I'm working on a game, and all of my graphics use magenta as transparent/magic color. They are all 32-bit and the magenta is just for conveniency. Anyway, I would appreciate if someone could advice me what library should I use to load my images (I need to load them in GL_RGBA format, both internal and texture specific). ...

Optimizing texture swapping on opengles for the iPhone

I have 2 1024x1024 sprite sheets, one containing several 480x320 background images and another containing a variety of smaller elements as entities and interface. My framerate drops like a rock whenever I enter a scene in which I have to display sprites from both textures (forcing me to re-bind twice per frame, interface texture->bg text...

OpenGL texture randomly not shown

Hello, I have got a very, very strange problem in my C++ OpenGL application. I simply load a texture and apply it to a quadric: glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEARE...