mipmaps

Is iOS glGenerateMipmap synchronous, or is it possibly asynchronous?

末鹿安然 提交于 2019-12-04 10:44:18
I'm developing an iPad app that uses large textures in OpenGL ES. When the scene first loads I get a large black artifact on the ceiling for a few frames, as seen in the picture below. It's as if higher levels of the mipmap have not yet been filled in. On subsequent frames, the ceiling displays correctly. This problem only began showing up when I started using mipmapping. One possible explanation is that the glGenerateMipmap() call does its work asynchronously, spawning some mipmap creation worker (in a separate process, or perhaps in the GPU) and returning. Is this possible, or am I barking

How to load images from mipmap folder programmatically? [duplicate]

只愿长相守 提交于 2019-12-04 00:16:46
This question already has an answer here : Closed 4 years ago . Mipmaps vs. drawable folders [duplicate] (1 answer) How to load images from the mipmap folder programmatically (as done with the drawables)? img.setImageResource(imageId); I am using Android Studio 1.2.1. In Android Studio We have mipmap instead of drawable You Can Find Documents Related To Your Assets Here You can use it Like img.setImageResource(R.mipmap.ic_launcher); You can do img.setImageResource(R.mipmap.imageid); 来源: https://stackoverflow.com/questions/30800708/how-to-load-images-from-mipmap-folder-programmatically

Does it make sense to use own mipmap creation algorithm for OpenGL textures?

非 Y 不嫁゛ 提交于 2019-12-03 11:29:54
问题 I was wondering if the quality of texture mipmaps would be better if I used my own algorithm for pre-generating them, instead of the built-in automatic one. I'd probably use a slow but pretty algorithm, like Lanczos resampling. Does it make sense? Will I get any quality gain on modern graphics cards? 回答1: There are good reasons to generate your own mipmaps. However, the quality of the downsampling is not one of them. Game and graphic programmers have experimented with all kinds of

Does it make sense to use own mipmap creation algorithm for OpenGL textures?

*爱你&永不变心* 提交于 2019-12-03 02:56:46
I was wondering if the quality of texture mipmaps would be better if I used my own algorithm for pre-generating them, instead of the built-in automatic one. I'd probably use a slow but pretty algorithm, like Lanczos resampling. Does it make sense? Will I get any quality gain on modern graphics cards? There are good reasons to generate your own mipmaps. However, the quality of the downsampling is not one of them. Game and graphic programmers have experimented with all kinds of downsampling algorithms in the past. In the end it turned out that the very simple "average four pixels"-method gives

In a GLSL fragment shader, how to access to texel at a specific mipmap level?

假装没事ソ 提交于 2019-12-01 05:14:28
I am using OpenGL to do some GPGPU computations through the combination of one vertex shader and one fragment shader. I need to do computations on a image at different scale. I would like to use mipmaps since their generation can be automatic and hardware accelerated. However I can't manage to get access to the mipmap textures in the fragment shader. I enabled automatic mipmap generation: glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); I tried using texture2DLod in the shader with no luck, it simply kept giving the normal texture. I also tried using glTextureParameteri(GL_BASE

libgdx texture filters and mipmap

荒凉一梦 提交于 2019-12-01 03:59:38
When I try to use mipmap filtering in LibGDX, none of the images appear. I'm new to LibGDX, and I have a simple 2d scene with three rotating, scaled circles. In order to anti-alias them, I wanted to use linear filtering. For advice, I looked to this article ,which said that, for heavily scaled images, a mipmap can be used to improve speed or quality. The first unexpected appearance was that, despite the fact that all of my images were scaled down, I would only see a linear filter if the magFilter was linear. In other words: This code will show a linear filter for minified images: parentTexture

How should we use the mipmap folders added with android 4.4?

只谈情不闲聊 提交于 2019-11-30 21:52:06
I recently installed one more Android SDK to Android Studio, the SDK version 4.4 (API level 19), and after using it with my project, it added a set of mipmap folders in the project's res folder ( res/mipmap ). I neither understand why, or how to use them. I read another question about it here on SO . The answer to it said that: The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before. According to this Google blogpost : It’s best practice to place your app icons in mipmap- folders (not the drawable-

OpenGL/DirectX: How does Mipmapping improve performance?

走远了吗. 提交于 2019-11-30 19:20:37
I understand mipmapping pretty well. What I do not understand (on a hardware/driver level) is how mipmapping improves the performance of an application (at least this is often claimed). The driver does not know until the fragment shader is executed which mipmap level is going to be accessed, so anyway all mipmap levels need to be present in the VRAM, or am I wrong? What exactly is causing the performance improvement? Andon M. Coleman You are no doubt aware that each texel in the lower LODs of the mip-chain covers a higher percentage of the total texture image area, correct? When you sample a

How does a GLSL sampler determine the minification, and thus the mipmap level, of a texture?

妖精的绣舞 提交于 2019-11-30 04:20:44
问题 I am working with OpenGL ES (via WebGL), but I think this question is applicable to the full OpenGL profile as well. Suppose I create an OpenGL texture with full mipmap levels, and I set its TEXTURE_MIN_FILTER to NEAREST_MIPMAP_NEAREST. Also suppose that I have a fragment shader that samples this texture. The mipmap level is chosen based on the degree of minification of the texture, but how is the degree of minification chosen? In my case, I am synthesizing (inside the shader) the texture

OpenGL/DirectX: How does Mipmapping improve performance?

混江龙づ霸主 提交于 2019-11-30 03:01:47
问题 I understand mipmapping pretty well. What I do not understand (on a hardware/driver level) is how mipmapping improves the performance of an application (at least this is often claimed). The driver does not know until the fragment shader is executed which mipmap level is going to be accessed, so anyway all mipmap levels need to be present in the VRAM, or am I wrong? What exactly is causing the performance improvement? 回答1: You are no doubt aware that each texel in the lower LODs of the mip