Tag Info

New answers tagged

-1

power of 2 textures increase performance about 30% for any type of GPU not only old GPUs (30% faster is the difference between a high end GPU and an average one) they take 30% more ram but less vram is needed they increase quality by providing proper texture size for specific distance it works like anti-aliasing for textures dark line artifact should be ...


0

Well, I finally got it after messing around with the math for awhile I kinda understand it. If anyone wants the code here it is. double dcx = double(cx) / double(w); double dcy = double(cy) / double(h); double dcw = (double(cx)+double(cw)) / double(w); double dch = (double(cy)+double(ch)) / double(h); glBegin(GL_QUADS); glTexCoord2f(dcx, dcy); ...


0

I don't quite understand what your problem is, since you're not being very specific. But I'll try. Your code seems fine to me. glVertex2f() controls where you want to render your quad to the screen. glTexCoord2f() controls what part of the texture you want to apply to the quad. So obviously if you increase the size of your quad but don't increase the part ...


0

No, Pincushion distortion is not actually the inverse of Barrel distortion. (Proof below) This paper seems to be shooting for exactly what you want: http://sprg.massey.ac.nz/pdfs/2003_IVCNZ_408.pdf (Formulas inside) Proof as promised: By contradiction for simplicity. Extracting the relevant fact about Barrel (and/or Pincushion) distortion: (2): We ...


2

A possible problem is in your SetInStartPosition(). For setting the Y position it should be position.Y = screenBounds.Height - texture.Height... not screenBounds.Width - texture.Width...


0

I've done it the way I described in the update of the question. I'll refer to that.


0

The solution I found was to disable 'Generate Mip Maps'. Easy fix for me, just took a bit of messing around to find.


0

Since you mentioned legacy UI is not a necessity, you can check the tutorials for new UI. Some resources: Unity official tutorial 3D Buzz youtube tutorial much better


0

Shivam, If you create your mipmap programatically, you will experiance such a problem with no doubt! You have to create your mipmap in your 3D software, which will render each size seperatly,resampling with raster image editing tools and with programming will reduce the the pixel size without care and deletes a whole row or a whole col which hurts the ...


0

The problem is that obj files contain vertex data in parts:pos,tex,normal and indices in them point to each of these parts individually. In OpenGL you need to combine those parts into one data object - vertex. And have your indices point to vertices, not their parts. My code (scala, but should be ok) val vertexListB = new RList[vec3]()//output positions ...


8

TextureAtlas#findRegion(String) returns a region with a name that matches the name specified. It does not copy the region, therefore any changes you make to the region will be reflected in the TextureAtlas. To overcome this issue, simply instantiate a new TextureRegion object and pass it the region found inside your TextureAtlas: background1 = new ...


0

First, this question is about asking for a tutorial, and as far as i know googling "opengl tutorial" is enough to get you started. Second, i don't recommend you to use such an old version of opengl, even if you want to support an extremely large range of computers, the 'modern opengl' (a.k.a. Opengl 3.0+) is widely supperted as well. And imho learning opengl ...


3

So you're not using a modelling program- thus you'll have to provide the cube/texture information yourself from code. Let's start out simple with one textured triangle. VertexPositionTextures contains Vertex (location of points in space) and texture (where does that point match to a point on an image). Keep in mind that the location for the texture is on a ...


0

Using decals and even meshes of highly varying scale for additional detail is completely fine and has been done for quite some time already (I'd say at least 20 years or so, since the dawn of somewhat realistic 3D). Yes, it's definitely worth it. And no, there's nothing wrong about making something as long as it looks right and meets all performance ...


0

If you find that geometry is too heavy weight, bump mapping can be a great way of getting the appearance of geometric detail without paying the geometry costs.


0

Since it sounds like you're using a human sized perspective, you can either increase your texture or your polygon budget. Usually, you would bake fine geometry into something like a normal map, but if it's that small then it probably isn't worth it unless that's a vital part of gameplay. If it is, then go ahead and use a model for it. Just be careful that ...


2

If you open the image above in its full resolution and look closely (with something like Magnifier on Windows), you should see that all the pixels simply have something like a blurred edge. Since there can be seen standalone "edges" of pixels, it is clearly not a post-processing method. When looking at screenshots in different resolutions, the edge ...


3

Yes, it can. But certain devices will suffer. For example, iOS PVRTC texture compression doesn't work without square textures. I think Unity makes them square, so you end up with your textures taking up a bunch more RAM to accommodate PVRTC. See Unity Documentation: 2D Textures for more details.


0

I found a solution. I cannot really explain why it changes the outcome since all UV's are in the [0;1] range. Yet, addin the lines glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); Just after loading the texture solved the problem just fine.


1

I'm lazy, so here is the way I'd tackle this issue: it would be by coupling the graphics with a collision/physics engine. You could try and find a basic collision engine for your language and implement something like this for your collisions and graphics: The image is composed with square sprites images; here is the colour coding (note that the first row, ...


0

Below I've posted something I mocked up going for deformable pixel terrain. You may be able to get something from it... You may not... Either way, It can obtain the pixels of an image around the mouse position. The names are pretty self explanatory but if you don't understand something, post a comment here. using UnityEngine; using System.Collections; using ...


0

If your "base" tile in a tile set is white (1.0, 1.0, 1.0), then you can simply take advantage of the multiplicative identity (one times a thing is that thing) to multiply in the color of your choice from whatever source you want at draw time. For example, you might pass the desired color as a vertex attribute or a shader uniform, and in the fragment shader ...


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 ...



Top 50 recent answers are included