Tag Info

New answers tagged

1

Please take note that the question was unclear and changed meaning 3 times, hence the 3 answers in one How can I verify that a given size is a multiple of another? This is a very good case to use the Modulo operator. Let's say you have a texture tex with size (width, height). Now you want to render the texture with size (drawWidth, drawHeight) on the ...


1

I don't think this is possible in your case. A repeating texture at the hardware level needs to span the entire texture, at least on the axis it is repeating. You can still repeat the sprite if you write your own routine. You would just call draw() multiple times. If you decide to load your repeating sprite as a separate texture so you can render it in one ...


0

I was not able to get additive blending working with an integer buffer, however I did get it working with a single channel 32 bit float. I got the effect I was going for by outputting 1 / 2^30 in fragment the shader, with glBlendFunc( GL_ONE, GL_ONE ), then multiplying by 2^30 after reading back the pixels.


1

GL_RGB32UI <- Is this right? Each texel value is 4 32bit integers? The last time I did this and wrote a single 32bit integer to a texture, I used GL_R32I and GL_RED_INTEGER. I've never had that error before but it seems reasonable if you're texture isn't big enough.


0

Basically, there is Vertex data, which is stored in one or more VBOs. Typical (3D) vertex has like: vec3 pos, vec2 uv, mat3 tbn (or vec3 normal) - maybe some other modifiers, possibly several different uv coords or something like that. Anyways, no matter if you store those to 1 or multiple VBOs, IBO will index all the buffers with same index. So, each ...


0

What you need, at least I guess, is an implementation of mipmaps for your 2D trees. A mipmap are a large frame in which the same object is present in different resolutions. For example, you can have a texture with a 1024x1024 tree image, next to it another one at 512x512, then a 256x256 one and so on... Then your tree object checks for the zoom level the ...


0

DirectX and OpenGl have different coordinate systems for their texture coordinates. OpenGl uses a origin in the lower left but your model assumes that the origin is in the upper left. Because of that you need to mirror the UV coordinates or your images along the y axis. You can do so by setting the v component to 1 - loadedV.


0

When using index buffers, you are indexing into all of the buffers at the same time. That means that if you have a point which can have multiple texture coordinates(If there is a seam at that point) or normals(for example if faceted) then you need to duplicate the given points vertex coordinates with all possible combinations. If you want to have indexing ...


0

For more efficient storage of font texture data, if you want to go beyond putting it all in one texture you should check out distance field textures. The technique was invented at valve and it stores the distance from each pixel to the shape (character in your case). This is great for monochromatic images, such as fonts and decals and gives you the ability ...


1

Your picture is of a cube, so I assume that's what you're talking about. You can only share vertices between continuous surfaces. That is, on a sphere, you share all/most of the vertices. On a cube, you must you separate vertices for each face. Aside from texturing, think of the normals you need for lighting. The normal for each side of a cube should point ...


0

I wouldn't recommend you creating texture atlas manually. With only two textures it looks like this: atlas.png size: 1024,256 format: RGBA8888 filter: Linear,Linear repeat: none player rotate: false xy: 404, 4 size: 400, 174 orig: 400, 174 offset: 0, 0 index: -1 tank rotate: false xy: 2, 2 size: 400, 176 orig: 400, 176 offset: 0, 0 ...


1

Texture2D.Resize does not resize texture, it changes amount of memory allocated by texture, like trimming an array. Check Texture Adjustments asset, it offers high performance GPU accelerated texture scale/resizing. https://www.assetstore.unity3d.com/en/#!/content/37732


2

It looks like the Wings3D object doesn't have texture coordinates. There is a texture applied, it's just not applied correctly. Without texture coordinates, it'll just stretch a single pixel of the texture over the entire object.


1

Try using CacheProceduralProperty to specify at runtime what properties you want to cache and which ones you don't.


1

If you're just looking to make your game compatible with some older devices consider using Quality Settings . Go to Edit->Project Settings->Quality Settings to set up each level and instruct Unity to use full size textures/half size etc.... Then add a Menu Scene that will load first allowing the User to select the settings he wants for his devices.


1

Alfonse Reinheart's post in this thread (#8) should shed some light. When you boil it down, the answer is "there's no such thing." Quadrilinear sampling is simply the term used for applying a linear sampling (GL_LINEAR_MIPMAP_LINEAR in OpenGL) to a 3D texture. You can almost argue the answer is "yes" since linear is at the hardware level and it's simply ...


1

From the looks of it, you have some other texture layer that's adding "wear and tear" to your model (for example the corners of the ammo cartridge). You should poke around for decals or other layers being applied to the model. I'd be particularly interested in the slider at the bottom:



Top 50 recent answers are included