Tag Info

Hot answers tagged

17

Your understanding is close. Each 3D model is made out of vertexes. Each vertex usually defines the location of a point in space, a normal (used in lighting calculations) and 1 or more texture coordinates. These are generally designated as u for the horizontal part of the texture and v for the vertical. When an object is textured, these coordinates are used ...


13

You can't. All right, that was a bit harsh. Let me illustrate this with two examples. Let's get outside of the computer graphics world. Suppose you are given a piece of paper with the texture you gave us printed on it. There's a faintly printed millimeter grid in the paper as well. Now you get some scissors and some paste, and your task is to make a ...


12

This is the way I understand it. Could be totally wrong, but I'm sure someone will flame correct me if I'm wrong. The mathematical theory behind UVW texture mapping is similar to the theory behind UV texture mapping. See Bummzack's link here: What exactly is UV and UVW Mapping? to get a better explanation of what UV mapping is. Basically, you're mapping ...


10

This is where I will use a 3D painting program. I primarily use Blender for my modeling, and it has a 3D painter built in. Being able to paint directly on the model in a 3D environment, makes the strokes continue across seams. I don't find the paint tools in Blender to be great, so I'll usually switch to something like GIMP once I've got a rough idea. Then ...


8

With full source (or even just a thorough explanation) of a perspective correct textured triangle rasterizer being too long for an answer, I'll gladly refer you to Chris Hecker's classic series of articles on the topic, including source: http://chrishecker.com/Miscellaneous_Technical_Articles From your link I assume you are using Flash as a platform, so I ...


8

I think you are right. You would really like to tile your bricks, because it saves a lot of memory space and is also quick in your GPU. Baking the lighting does need a unique texturing, because no place is the same. You could tile some parts of your texture, for example, on really straight long places. (I'm no UV wrapper, but I do think that is possible to ...


8

Texture mapping is a hard problem. For some primitives there is a mathematically sound way of finding the UV coordinates. This is only possible if we can think of a function F(u,v)->(x,y,z). An example of a figure where this is possible is the a cube. Here we can easily cut out a square for each of the surfaces. For a sphere this is also possible, here ...


7

UV interpolation needs to take into account the depth of the vertices. You need to perform perspective-correct interpolation, which involves dividing by the w coordinate of the interpolated homogeneous vector. The "folded plane" effect of affine interpolation becomes more pronounced at wide FOV or when the camera is close to an object, but it's not ...


6

First of all, for every 3D vertex there is infinite tangent and bi-tangent vectors. The below image explains why there is an infinite number of tangent spaces for each vertex, the tangent and bitangent can have any direction in the shown plane. So inorder to properly calculate the most useful1 tangent space, we want our tangent space to be aligned such ...


5

Consider a triangle. Each corner has a UV coordinate. You interpolate between these to get a set of UV coordinates for each pixel. (There's also perspective in play here but let's ignore that for the moment). Then, you fetch a texel from the texture from the coordinates U and V. Which is to say, a pixel from the texture coordinate x,y - same thing, ...


5

You are correct UV's typically go from 0-1 though as David X mentioned this isn't a requirement. In your case the issue is the frequency of the SketchUp generated UV coordinates. For example if your Y axis (V coordinate) goes from 0 to 46 then that texture, if wrapping is enabled, will repeat 46 times in the V direction. Wrapping also makes it look smaller ...


5

Alright, found my issue. Not sure if this applies to OpenGL but for my DirectX application I needed to invert the v coordinate for sampling the texture. u = u v = 1 - v;


5

One example is for light maps. Usually texture space is maximized by overlapping faces which have the same diffuse texture, like the six sides of a crate. With light mapping this would mean that all six sides get the same light and shadow, not to mention it would almost assuredly confuse the light mapper because it can't tell which point in space it should ...


5

This may be a winding issue. Are you sure that the texture coordinates are parsed in the right sense of rotation? However, this how you should debug you program. Draw in wire frame mode to find out how the rectangle is composed out of two triangles. The OpenGL command for this is glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);. Use a texture with a gradient ...


4

I took a quick look at your example and your code. You're extremely close to solving this, so I don't mind helping with a question that looks suspiciously like homework ;). In data.js, you are assigning the same UV coordinates to the front and rear faces of the cube. The coordinates seem to be ([0,0], [0,0.5], [0.5,0.5], [0.5,0]). This means that you can ...


4

A quad with the texture coordinates 0,0 on the one corner and 2,2 on the other corner, means the texture is tiled 4 times, 2 times in each direction. Now if you have the same quad with 4,4 on the other corner instead you have the texture tiled 16 times, 4 times in each direction. If you increase the texture coordinates without increasing the size of the ...


3

First off, make sure you're adding a material on your mesh, then add the texture, set it as "image or movie", and chose "Coordinates: UV":


3

In the past I've fixed this sort of problem using a dilation filter. Basically, the idea is to go over the lightmap after it's rendered and expand the borders of all the pieces by a few pixels, by copying the values of filled pixels into adjacent empty pixels. This can be done with a pixel shader in a full-screen pass or two over the lightmap.


3

Either use a geometry shader (or possibly some vertex/fragment shader magic) to generate the border from each vertex of the cube, or write a function that generates a new box with a fixed border size. By scaling a box, you scale the whole box. There's no magical way of scaling the border separately. And it's a box, which should be simple enough to generate. ...


3

It sounds like you just need plain rectangular UV coordinates. The inner radius is V = 1, and the outer radius is V = 0. That angular procession from the bottom up is from U = 1 to U = 0 (or the opposite depending on tech). The vertex locations can be arranged in a curve, but the texture coordinates don't have to be.


3

First of all, the process of finding the pixels that fall in a triangle is called rasterization. You might want to look up some articles on fast software rasterization, or better yet move the lightmap build process (or at least the rasterization part of it) to the GPU, as it'll be much, much faster. There are two possible solutions to the problem of cracks ...


3

A simple method using only Photoshop: Crop the image vertically to remove anything that should be below the horizon (ie. not part of the sky dome) Scale up the height of the image to make it square Filter -> Distort -> Polar Coordinates


3

A line is a list of connected points. For each point you'll need to calculate the X-Texture coordinate of that point, the Y coordinate will always be 0 for the upper point and 1 for the lower point. After you have defined how long one texture segment is you can do so by stepping through all the segments you have generated and noting how much distance you ...


3

An UV map is usually literally 2 extra floats per vertex, one for the U, and one for the V, how they are stored is dependent on the model format used and not really relevant to how you use them. How they are used in modern applications is typically completely defined in the fragment shader, a common use is to take the UV values and use them as the ...


2

You can add to your vertex these arrays: int[4] TextureId; float[4] TextureWeight; and in your shader you can do the blend, finalTexColor = tex0sample * TextureWeight[0] + tex1sample * TextureWeight[1] +tex2sample * TextureWeight[2] + tex3sample * TextureWeight[3] you can see this article to know how.


2

I'm almost sure this is because you're using TextureAddressMode.Mirror instead of TextureAddressMode.Wrap. Change the value in the sampler state before rendering the primitives. I think it should be something like: GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap; GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;


2

Unless you're trying to change how the object is textured you shouldn't need to adjust the UVs at all.


2

Try using Blender to Average then Pack your UV Map. When averaging, it fairly distributes texture space to each surface; and when packing, it fits all the islands into your texture. For a good quick tutorial on UV Unwrapping in Blender, check out this video from Blender Cookie. (It applies to the latest versions of blender) Here is a screenshot of a silly ...


2

One simple solution is to keep the background of the asteroid very flat so it wraps well, then add detail away from the edges. Don't cross the edge. Put your craters and bumps and things inside. That should minimize the seam.


2

In the edit UV's we have flatten mapping, make sure you check down all the three boxes and click ok. This will adjust your UV's automatically in the texture space. But from your image, it seems like you are texturing a track or road something like that. If in that case, i suggest you to follow this tutorial. Explains how to texture road/race track using ...



Only top voted, non community-wiki answers of a minimum length are eligible