textures

Bitmap too large to be uploaded into a texture

孤人 提交于 2019-11-27 01:59:30
I've in drawable directory an image file with the 960x1440 size. When the app start, the image is not loaded as background and in the logcat I see: Bitmap too large to be uploaded into a texture (2880x4320, max=4096x4096) Why it says 2880x4320 if the image is 960x1440 ? The bitmap is loaded via xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable

Retrieve Vertices Data in THREE.js

筅森魡賤 提交于 2019-11-27 01:59:19
问题 I'm creating a mesh with a custom shader. Within the vertex shader I'm modifying the original position of the geometry vertices. Then I need to access to this new vertices position from outside the shader, how can I accomplish this? 回答1: In lieu of transform feedback (which WebGL 1.0 does not support), you will have to use a passthrough fragment shader and floating-point texture (this requires loading the extension OES_texture_float ). That is the only approach to generate a vertex buffer on

What is the maximum texture size available on the iPad?

左心房为你撑大大i 提交于 2019-11-27 01:58:04
问题 Anyone know the maximum texture size for the iPad? I'm having trouble finding numbers for this. 回答1: The iPad 2 supports OpenGL ES 2.0 and 2048 x 2048 textures. http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/AboutThePlatform/AboutThePlatform.html 回答2: As a supplement to the accepted answer: 2048 was the maximum for iPad2 as well, up until iOS5.1, when it became 4096. 4096 is the maximum for iPad3, as pointed out by @badweasel in the comments.

Limitation on texture size? Android Open GL ES 2.0

ぃ、小莉子 提交于 2019-11-27 01:47:02
I would like to know if there is any kind of limitation on the texture size that can be used in any Android Opengl Es 2.0 projects. I understand that having a huge texture of size 4096x4096 is a bit meaning less as it is rendered on a small screen. But What if the requirement is to switch between many textures at run time? And If I want to have a texture atlas to do a quick single upload instead of multiple smaller texture upload. Please let me know your ideas in this regards. Also I am sure there has to be a limitation on the size of image that can be processed by a device, as the memory on

How to apply texture to glutSolidCube

风格不统一 提交于 2019-11-27 01:38:02
问题 I can find tutorials about mapping textures to polygons specifying vertices etc. but nothing regarding how to apply a texture to a cube (or other stuff) drawn with glut (glutSolidCube). I am doing something like: glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, decal); glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, repeat); glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, repeat); glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, nearest); glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE

Is it possible using video as texture for GL in iOS?

假如想象 提交于 2019-11-27 01:25:21
问题 Is it possible using video (pre-rendered, compressed with H.264) as texture for GL in iOS? If possible, how to do it? And any playback quality/frame-rate or limitations? 回答1: As of iOS 4.0, you can use AVCaptureDeviceInput to get the camera as a device input and connect it to a AVCaptureVideoDataOutput with any object you like set as the delegate. By setting a 32bpp BGRA format for the camera, the delegate object will receive each frame from the camera in a format just perfect for handing

Differences and relationship between glActiveTexture and glBindTexture

久未见 提交于 2019-11-26 23:44:48
问题 From what I gather, glActiveTexture sets the active "texture unit". Each texture unit can have multiple texture targets (usually GL_TEXTURE_1D, 2D, 3D or CUBE_MAP). If I understand correctly, you have to call glActiveTexture to set the texture unit first (initialized to GL_TEXTURE0 ), and then you bind (one or more) "texture targets" to that texture unit? The number of texture units available is system dependent. I see enums for up to 32 in my library. I guess this essentially means I can

Cluster texture based on features extracted from Gabor

点点圈 提交于 2019-11-26 23:10:32
问题 I'm trying to cluster textures based on the features extracted from Gabor bank that I've created, but the result is far from what is typically expected so here is what I'm doing >> 1-generate a filter bank (based on the Miki's answer here I'm getting both real and imaginary part so that I can later extract Magnitude feature) void Gabor::generateFilterbank(int bankRows,int bankCols) { bankCol=bankCols; bankRow=bankRows; setBankSize(); int thetaStep=pos_th_max/bankCols; int lambadaStep=(pos_lm

Multiple textures in GLSL - only one works

情到浓时终转凉″ 提交于 2019-11-26 22:53:33
问题 My problem is getting more than one texture accessible in a GLSL shader. Here's what I'm doing: Shader: uniform sampler2D sampler0; uniform sampler2D sampler1; uniform float blend; void main( void ) { vec2 coords = gl_TexCoord[0]; vec4 col = texture2D(sampler0, coords); vec4 col2 = texture2D(sampler1, coords); if (blend > 0.5){ gl_FragColor = col; } else { gl_FragColor = col2; } }; So, I simply choose between the two color values based on a uniform variable. Simple enough (this is a test),

Stretch background image for UIButton

二次信任 提交于 2019-11-26 22:33:48
问题 I got texture, which really shorter, than my UIButton. I got this texture: And i should create this button: How should i stretch (not tile), this texture? Stretching in horizontal direction Thnx 回答1: From the example images you provided I'm pretty sure you're looking for UIImage 's resizableImageWithCapInsets: UIImage *originalImage = [UIImage imageNamed:@"myImage.png"]; UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right); UIImage *stretchableImage = [originalImage