textures

Texture not displaying properly - probably coordinates are wrong OpenGL, C++

筅森魡賤 提交于 2019-12-06 22:24:24
问题 I'll try to explain my problem with images. So this is a test texture I'm using for my OpenGL application: As you can see, there is a 2-pixels wide border around the image with different colors for me to be able to see if coordinates are properly set in my application. I'm using a 9-cell pattern so I'm drawing 9 quads with specific texture coordinates. At first sight everything works fine, but there is a small problem with displaying a texture: In the picture I marked where is first quad, and

When using THREE.ObjectLoader, if the model has more than one texture, how do I get them to load properly?

扶醉桌前 提交于 2019-12-06 15:11:31
I have exported a model as a Three.js scene. I load it using ObjectLoader. It seems to load fine, but the textures are not applied. When I look at the json file, there are materials listed. Here is the code I have tried. loader.load( "MyModel.json", function(obj){ var materialsFromFile = new THREE.MeshFaceMaterial(obj.materials); // create our mesh with the loaded geometry and materials mesh = new THREE.Mesh(obj.geometry, materialsFromFile); scene.add(mesh); }); UPDATE: I have a fix for this, perhaps someone knows a better way? What I do is: first I traverse the model after loading it obj

Alpha blending with multiple textures leaves colored border

半世苍凉 提交于 2019-12-06 14:27:38
问题 Following problem: I have two textures and I want to combine these two into a new texture. Thus, one texture is used as background, the other will be overlaid. The overlay texture is getting initialized with glClearColor(1.0, 1.0, 1.0, 0.0). Objects are draw onto the texture, these objects do have alpha values. Now blending between the two textures leaves a white border around the objects. The border comes from the fact that the background color in the second texture is white, isn't it? How

glGenerateMipmap - non-power-of-2

一笑奈何 提交于 2019-12-06 14:21:24
Environment Ubuntu 17.04, Chrome 60. Runs this example local without warnings/errors : https://github.com/mdn/webgl-examples/tree/gh-pages/tutorial/sample6 Then replace cubetexture.png with an non-power-of-2 image here : https://github.com/mdn/webgl-examples/blob/gh-pages/tutorial/sample6/webgl-demo.js#L220 Got as expected warnings/errors : [.Offscreen-For-WebGL-0x13d050ba2c00]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. [.Offscreen-For-WebGL-0x13d050ba2c00]GL ERROR :GL_INVALID_OPERATION : glGenerateMipmap:

Three.js Repeat texture fail

允我心安 提交于 2019-12-06 14:11:42
I'm trying to make a simple floor texture, but it seems that wrapS and wrapT don't works. Look at the result: http://hpics.li/321350c var texture = THREE.ImageUtils.loadTexture( "Game/Texture/drytext.png" ); texture.wrapS = THREE.RepeatWrapping; texture.wrapT = THREE.RepeatWrapping; texture.repeat.set( 4, 4 ); var floorMaterial = new THREE.MeshBasicMaterial( { map: texture, side: THREE.DoubleSide }); var floorGeometry = new THREE.PlaneGeometry(20, 20, 10, 10); var floor = new THREE.Mesh(floorGeometry, floorMaterial); floor.rotation.x = -Math.PI / 2; scene.add(floor); Thank you 来源: https:/

CALayer OpenGL(-ES) texture memory usage

青春壹個敷衍的年華 提交于 2019-12-06 13:49:32
I have an iPhone app that uses too much texture memory. I am trying to figure out which of the app's CALayers uses too much texture memory. Unfortunately, I cannot figure out how much texture memory a specific CALayer is using. Are there any good tricks I can use ? 来源: https://stackoverflow.com/questions/8214884/calayer-opengl-es-texture-memory-usage

Android layout background xml texture

陌路散爱 提交于 2019-12-06 13:47:10
问题 I searched a lot but didn't find anything. I want to make a background for a layout , but instead of filling it with a color or a gradient I want to fill it with a texture and repeat it . I tried this but it didn't work . Can you tell me a solution. card_texture.xml <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/paper_texture" android:tileMode="repeat" /> card_shape.xml <?xml version="1.0" encoding="utf-8"?>

GL_TEXTURE_RECTANGLE_ARB

空扰寡人 提交于 2019-12-06 13:08:04
问题 I try to use data raw texture using GL_TEXTURE_RECTANGLE_ARB: void Display::tex(){ GLubyte Texture[16] = { 0,0,0,0, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0,0,0,0 }; GLuint Nom; glLoadIdentity();//load identity matrix glTranslatef(0.0f,0.0f,-4.0f);//move forward 4 units glEnable(GL_DEPTH_TEST); //Active le depth test glDisable( GL_CULL_FACE ); glEnable (GL_TEXTURE_RECTANGLE_ARB); glPixelStorei(GL_UNPACK_ROW_LENGTH, 2); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &Nom);

OpenGl 16 bit display via Tao/C#

牧云@^-^@ 提交于 2019-12-06 12:49:03
I have some scientific image data that's coming out of a detector device in a 16 bit range which then gets rendered in an image. In order to display this data, I'm using OpenGL, because it should support ushorts as part of the library. I've managed to get this data into textures rendering on an OpenGL 1.4 platform, a limitation that is a requirement of this project. Unfortunately, the resulting textures look like they're being reduced to 8 bits, rather than 16 bits. I test this by generating a gradient image and displaying it; while the image itself has each pixel different from its neighbors,

Explain how OpenGL ES background images work

北慕城南 提交于 2019-12-06 12:31:01
Could someone please explain how you render background images on an OpenGL ES view? From the basics of setting up the OpenGL environment. I'm a newbie to OpenGL here. I'm seeing a few questions/ answers on stackoverflow about creating background images, but I'm trying to modify existing code at the moment (Apple's GLPaint in particular), and I'm not sure what is needed and what is not. Having tried the solutions, with no success, I thought I should take a step back and actually try and understand what is going on. Mindlessly hacking hasn't gotten me far =( Are there any simple apps that show