Questions tagged [texturing]
119 questions
3
votes
1 answer
glTexImage2D vs. gluBuild2DMipmaps
Very basic OpenGL texture creation code:
int width, height;
BYTE * data;
FILE * file;
// open texture data
file = fopen( filename, "rb" );
if ( file == NULL ) return 0;
// allocate buffer
width = 256;
height = 256;
data =(BYTE*) malloc( width *…

jalal sadeghi
- 362
- 4
- 19
3
votes
0 answers
How to make Three.js Extrude Geometry use Local UV coordinates for texturing rather than using World Coordinates
I kept running into an issue while attempting to apply textures to my objects in three.js. Whenever I tried to texture an extruded geometry the texture just didn't show up. After giving up for a while then coming back and digging some more I found…

zaidi92
- 355
- 1
- 3
- 11
3
votes
0 answers
Applying textures correctly to extruded elliptical objects in three.js
For a while now I've been having difficulty correctly applying textures to three.js custom objects. Specifically extruded elliptical objects. I have looked around and from what I can see I need to generate the objects UV mapping by using it's…

zaidi92
- 355
- 1
- 3
- 11
3
votes
2 answers
OpenGL GL_R8 generates a 0x501, GL_RGB8 does not
This seems to be a rather straightforward problem (or at least as close as you can get). When I pass GL_RGB8, GL_RGBA8, or most any multiple-channel internal format, the below line produces no error.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8,…

Precursor
- 622
- 7
- 18
2
votes
2 answers
How do I apply a colour transformation matrix to a texture in OpenGL
Basically, I've got a colour matrix defined as such:
struct ColourXForm
{
float4 mul;
float4 add;
float4 Transform(float4 colour)
{
return float4(
colour.x * mul.x + add.x,
colour.y * mul.y + add.y,
…

Grant Peters
- 7,691
- 3
- 45
- 57
2
votes
1 answer
I need OpenGL ES 1.1 to render objects with texturing and others with just vertex paints and colors simple
I'm running on XCode and using OpenGL ES 1.1 and I have two classes one that is textured and the other one is just triangles with color data and they render fine until I render my textured triangles that work but then the others also become textured…

Geovanni-Mig
- 25
- 2
2
votes
0 answers
Rainbow artifact bug when displaying a earth texture onto a OpenGL sphere with SFML
I am using SFML for the window and OpenGL to display a sphere with a texture. However, instead of showing the earth texture, I see a weird rainbow artifact. I am running on Windows 11 and using SFML 2.5.1 and OpenGL 3.3.
here is the code
#include…

christian gaskins
- 33
- 4
2
votes
2 answers
Cocos2d Sprite Continuous
I am trying to create a background to flow with the game. However the image isn't Continuous. There is a space between each of the image loads. I want the image to continue to loop.
Here is the method to create the sprite
CCSprite *sprite =…

Bryan1234321
- 63
- 1
- 6
2
votes
1 answer
How to texture a cylinder in XNA4 with multiple textures?
Basically, I'm trying to cover a slot machine reel (white cylinder model) with multiple evenly spaced textures around the exterior. The program will be Windows only and the textures will be dynamically loaded at run-time instead of using the…

Scott
- 145
- 1
- 10
2
votes
1 answer
OpenGL - Texture Atlas "smudging"
I am using a texture atlas which I have a made by stitching 2 identically sized images together side-by-side.
When I modify the texture co-ordinates I do the following in this order:
if(texCoordx>1) texCoordx = texCoordx % 1 - So one texture…

DevGoldm
- 828
- 12
- 28
2
votes
1 answer
GLSL textureCube and texture2D in same shader
I can't seem to be able to have both texture2D() and textureCube() in one shader. When I do, nothing shows up and there is no error. I tried this both with my own shader loader and the Apple GLSL shader builder and the same thing happens. It happens…

toastie
- 1,934
- 3
- 22
- 35
2
votes
1 answer
how to use Tango3DR_updateTexture?
I am trying to make 3DR texturing but it always use only vertex colors in texture.
On every frame I store frame as PNG:
RGBImage frame(t3dr_image, 4);
std::ostringstream ss;
ss << dataset_.c_str();
ss << "/";
ss <<…

Luboš V.
- 51
- 1
- 7
2
votes
1 answer
spherical mapping artefacts
I have some problems with sphere map texturing in webgl.
My texture:
Now I texturize a sphere. Everything is OK, if the sphere is in front of the camera:
The sphere is a unit-sphere (r = 1), defined with longitudes and latitudes.
But i get some…

m1au
- 97
- 9
2
votes
1 answer
Projecting a texture from plane to object with Unity
I'm trying to project a texture from a plane to a wall using raycasts. This should happen in realtime. Since the plane is larger than the wall, only part of the texture is supposed to appear on the front side of the wall. So moving the plane will…

migg
- 21
- 3
2
votes
1 answer
OpenGL - rendering a textured teapot - .obj faces and normals
I have an .obj file with only v and f parameters.
I've got a task, to texture it up by "enclosing" it in a cuboid (defined by max and min vertices on every axis), calculating its centre, then dividing space coordinates of teapot's vertices from…

Kacper Kosikowski
- 143
- 1
- 9