Questions tagged [texture-mapping]

Texture mapping is a method for adding detail, surface texture (a bitmap or raster image), or color to a computer-generated graphic or 3D model.

971 questions
3
votes
0 answers

How to obtain texture coordinate from arbitrary position in HLSL

I'm working on a C++ project using DirectX 11 with HLSL shaders. I have a texture which is mapped onto some geometry. Each vertex of the geometry has a position and a texture coordinate. In the pixel shader, I now can easily obtain the texture…
Martin85
  • 308
  • 4
  • 13
3
votes
3 answers

Textures blur far from camera Three.js

I have a threejs scene, with my camera like this: var VIEW_ANGLE = 45, ASPECT = SCREEN_WIDTH / SCREEN_HEIGHT , NEAR = 0.1, FAR = 8000; camera = new THREE.PerspectiveCamera( VIEW_ANGLE, ASPECT, NEAR, FAR); and i create the material like this: var…
user1866818
3
votes
1 answer

Can I use an OpenGL compute shader to resolve a multisample texture?

My app renders a first scene into a texture bound to an FBO, then a compute shader does some processing on the texture image and writes it to another texture, which I then use for rendering a second scene. All fine. Now I'd like the first scene to…
3
votes
1 answer

Calculating uv texture coords for a procedurally generated circle mesh

I am trying to calculate the uv's for a mesh I generate in code. It's a very simple circle (2d) and I want to texture it like follows and using this code for the uvs uvs[i] = new Vector2((verts[i].x+radius)/(radius),…
KMoore
  • 171
  • 1
  • 10
3
votes
2 answers

WebGL Texture resize unexpected output

When using textures in WebGL, sometimes I need to make them larger than they were originally. When I do that, it causes the textures to appear differently, especially on lighter backgrounds. I have the following image (256 x 256): When rendered in…
vcapra1
  • 1,988
  • 3
  • 26
  • 45
3
votes
2 answers

OpenGL - loading an object with multiple texture

I'm trying to draw a quadcopter model using OpenGL. The quadcopter object has an .obj file, an .mtl file and three .tga file for texturing(one for rotors, one for body, one for guns). My problem is I don't know how to apply these three textures on…
user3817833
  • 97
  • 1
  • 9
3
votes
2 answers

What's the difference between TMU and openGL's GL_TEXTUREn?

I can't quite understand what's the difference. I know TMU is a texture mapping unit on GPU, and in opengl, we can have many texture units.I used to think they're the same, that if I got n TMU, then I can have n GL_TEXTURE to use, but I found that…
3
votes
1 answer

OpenGL GLSL texture(...) function always returning v4(0,0,0,1)

I have the following setup for basic texture mapping void init(void) { glGenVertexArrays(NumVAOs, VAOs); glBindVertexArray(VAOs[Triangles]); GLfloat vertices[6][2] = { { -0.90, -0.90 }, // Triangle 1 { 0.85, -0.90 }, { -0.90, …
WSkinner
  • 2,147
  • 1
  • 19
  • 21
3
votes
0 answers

three.js how to render a texture mapped OBJ file in WebGL?

three.js: how to render a texture mapped OBJ file in WebGL? I'm a newbie to Three.JS and WebGL. I have a 3D scanner that makes texture mapped OBJ files and I want to create a simple WebGL viewer that allows the user to view the 3D model from any…
mcgregor94086
  • 1,467
  • 3
  • 11
  • 22
3
votes
0 answers

Isolate a UV Island (aka Shell)

Alright, I'm in the middle of making a decal system that paints directly on textures. I also have it doing the legwork on the video card so there's no lag like using a Texture2D.Apply() approach. Anyway, essentially I'm just stamping the texture…
gord0
  • 111
  • 5
3
votes
2 answers

Avoiding seam in 3D cylinder model

I have this texture representing internal area of a pipe: I have created a simple cylinder model (GeometryModel3D) by dissecting the above texture to a grid of points and than wrapping this to form a cylinder, then mapping the above texture to it…
Libor
  • 3,285
  • 1
  • 33
  • 41
3
votes
1 answer

opengl texture mapping off by 5-8 pixels

I've got a bunch of thumbnails/icons packed right up next to each other in a texture map / sprite sheet. From a pixel to pixel relationship, these are being scaled up from being 145 pixels square to 238 screen pixels square. I was expecting to get…
badweasel
  • 2,349
  • 1
  • 19
  • 31
3
votes
1 answer

opengl texture lod bias adjusting via opengl function call?

how is it possible to change the lod bias via an opengl function call? i dont like the default settings, changes the miplevels too early and makes the nearby ground look ugly. i couldnt find any codes to do this, every topic was about some external…
Newbie
3
votes
1 answer

why are integer UV coordinates needed for fetching multisampled texture

when sampling a multisampled texture, we have to use integer coordinates, i.e ivec2 Texcoord = ivec2(textureSize(texsampler) * In.Texcoord); vec4 color = texelFetch(texsampler, Texcoord, i); //i = sample, Texcoord is integer instead of vec4 color…
viktorzeid
  • 1,521
  • 1
  • 22
  • 35
3
votes
2 answers

Power of two textures

Can you explain me, why hardware acceleration required for a long time textures be power of two? For PCs, since GeForce 6 we achieved npot textures with no-mips and simplified filtering. OpenGL ES 2.0 also supports npot textures without mipmaps and…
demi
  • 5,384
  • 6
  • 37
  • 57