I have a sphere with per-vertex normals and I'm trying to derive the texture coordinates for the object using the algorithm:
U = Asin(Norm.X) / PI + 0.5
V = Asin(Norm.Y) / PI + 0.5
With a polka dot texture, I get:
Here's the same object without the texture applied:
The issue I'm particuarly looking at (I know there's a few) is t...
Hello, I'm making a game with python and OpenGL. I was making it with pygame but I realised quick enough that it was too slow. I've made a class which I want to reasonably act like the Surface class for pygame, where Surface objects can be blitted to other Surface objects. I'm wishing to use framebuffers for rendering textures to texture...
I'm making a game for android where I need to draw a lot of points that change position every frame. I use the ndk to get faster processing performance of the math/physics section of the game, so I need to use OpenGL to get the fastest performance.
Right now, I make a texture every frame out of an array that holds the colors of every p...
I'm using python but OpenGL is pretty much done exactly the same way as in any other language.
The problem is that when I try to render a texture or a line to a texture by means of a frame buffer object, it is rendered upside down, too small in the bottom left corner. Very weird. I have these pictures to demonstrate:
This is how it loo...
I'm creating an openGL game and so far I have been using .pngs in the RGBA8888 format as texture sheets, but those are too memory hungry, and my app crashes frequently. I read in Apple's site that such format such be used just when too much quality is needed, and recommends to use RGBA4444 and RGBA5551 instead ( I already converted my te...
I know this is such a trivial question, yet I haven't found any information that seems to help, starting from glGet()'s documentation. I'm using my textures as sprites, so it's crucial that I keep track of their sizes in texels/pixels.
When I'm creating my textures with glTexImage2D() I'm required to pass the size of the pixel data arra...
Saw that in some example codes, but ive never used it, unless im dynamically opening new different sized textures etc.
So does my OS or something take care of freeing the texture memory when my app is terminated? Or do i have to free it myself ?
...
Hello, I'm making a 2D game. I want to be able to render a texture on the screen after rotating it a certain amount around a centre point. Basically this is for a level rotation around a player. The player position being the rotation point and the direction of the player as the angle. This code wont work:
def draw_texture(texture,offset...
Hi everybody
I was trying to load a texture using joGL library but it seems that something is missing when using this method glTexImage2D at :
IOStream wdis = new IOStream(fileName);
wdis.skipBytes(18);
int width = wdis.readIntW(); // dis.skipBytes(2);
int height = wdis.readIntW(); // dis.skipBytes(2);
wdis.skipBytes(28);
byte buf[] =...
I have two textures (made from two different images). I want to mix these textures on one view. How I can rich this?
...
I'm a noob in openGL and trying to learn as much as possible. I'm using this method to load my openGL textures, loading every .png as RGBA4444. I'm doing anything incorrect ?
- (void)loadTexture:(NSString*)nombre {
CGImageRef textureImage =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:nombre ofType:nil...
Hi guys,
I started some months ago an OpenGL project which became larger and larger... I began with the crashLanding sample and i use Texture2D.
I also use a singleton class to load my textures, and here is what the texture load looks like :
//Load the background texture and configure it
_textures[kTexture_Background] = [[Texture2D a...
I use that function to get my texture from the graphics card,
but for some reason it doesnt return anything on some cards if miplevel > 0
Here is the code im using to get image:
glGetTexImage(GL_TEXTURE_2D, miplevel, GL_RGB, GL_UNSIGNED_BYTE, data);
here is the code i use to check which method to use for mipmapping:
ext = (char*)gl...
In DirectX 9 I have a .X file which I've loaded and I draw several copies of it. I need to be able to alter the texture coordinates for each copy (e.g. give each one a different scale). Unfortunately because they're all the same mesh and use the same materials, it seems that transforming the texture for one does the transformation for al...
I'm having trouble getting a texture to map onto geometry properly with OpenGL. In fact I seem to have even broken the colour interpolation that used to work fine. I've created a test case in C99 that uses SDL, GLee and SOIL.
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <S...
I am using code from this site:
http://www.spacesimulator.net/tut4_3dsloader.html
It works in their example project but when I placed the code into a class for easier and more modular use, the texture fails to appear on the object.
I've double checked to make sure the texture ID is correct by debugging them side by side.
On my project ...
Ok, what I'm trying to achieve is to load an image as a single resource and then save different parts of it as a number of different textures (basically chopping the image into smaller squares and then saving them separately).
For my game, simply mapping different sections of the original image to my shapes won't work and being able to ...
I'm trying to write an algorithm to generate the "ceiling panel" from a horiontally wrappable panoramic image like the one above. Images 1 to 4 are a straight cut out for the walls of the cube but the ceiling will be more complicated as I assume it needs to be composited from parts 5a to 5d. Does anyone know the solution in pseudocode?...
I am trying to Google for what I've mentioned in the title, but somehow I couldn't find it. This should not be that hard, should it?
What I am looking for is a way to gain access to an OpenGL ES texture on iPhone, and a way to get/set pixel with it. What are the OpenGL ES functions I am looking for?
...
Ok, so far, I can create an array on the host computer (of type float), and copy it to the gpu, then bring it back to the host as another array (to test if the copy was successful by comparing to the original).
I then create a CUDA array from the array on the GPU. Then I bind that array to a CUDA texture.
I now want to read that text...