textures

How to update texture in ThreeJS with loaded image data?

爱⌒轻易说出口 提交于 2019-12-11 04:55:44
问题 I'm looking for the best way to update a texture in threejs with data loaded from an image ? loadTextture will create a new texture every time and i can't find a way to pass on an image object. I've created the amount of textures needed with loadTexture, now every time i need to load a new image i just want to update my current textures with their data Appreciate any help 回答1: This code should be of some help? var image = document.createElement( 'img' ); var texture = new THREE.Texture( image

QML apply a texture to a Mesh

筅森魡賤 提交于 2019-12-11 04:42:08
问题 I am trying to apply an image texture to a Mesh in QML (Qt 5.6.2). I started from the sample "Shadow Map QML" and I want to texture the GroundPlane. Material and Effect qml classes are applied to that GroundPlane mesh but I can't see how to apply an image texture. In QML, there is TextureImage, ShaderEffect but nothing about how they can be applied to a Mesh. Any ideas? EDIT: Qt 5.6.2 is not the good version to work with to use Qt3D as the first "fully supported release of a stable Qt 3D

On Android 2.3, how can I ensure not to compromise the definition of its texture while enlarging a 3D object?

谁说胖子不能爱 提交于 2019-12-11 04:41:56
问题 Now I'm developing an Android-based 3D app with opengl-es 2.0, I made use of an OBJ file which consists of a 3D model and a texture image (like below): Currently, the apple can rotate freely on my Samsung Galaxy II with no problem. Next, I want to enlarge the apple while keeping the definition of its texture, but I didn't make it (see below). I need help to achieve that. Any suggestion or pointing would be highly appreciated. Thanks in advance. 来源: https://stackoverflow.com/questions/13006227

libgdx/Android: graphics disappearing after the app is destroyed/paused

蓝咒 提交于 2019-12-11 03:57:15
问题 I was doing some tests and I realized that on my Nexus 5, when I hit the back key (or the home) - that is, when there's a change of context - and I go back to my game, the openGL context is lost. There are no textures anymore (they show as black) or skins for the UI (the buttons are white). I thought it was automanaged by libgdx automatically, right? So why is this happening? The way I'm creating the textures is via TextureAtlas , like TextureAtlas atlas; TextureRegion bg; atlas = new

How does XNAs Content.Load<Texture2D> operate?

Deadly 提交于 2019-12-11 03:43:47
问题 I'm just curious if it actually loads the asset into memory every time it's called or if it looks it up, finds if it's loaded and if it isn't loaded it loads it once and just keeps references so the second time it's called it just grabs a reference to it? 回答1: It keeps track of what has already been loaded, and simply returns a reference to the same object if it has been loaded before (this is per-ContentManager). This applies to all content, not just textures. The upshot is that you can just

OpenGL ES 2.0 Vertex Shader Texture Reads not possible from FBO?

為{幸葍}努か 提交于 2019-12-11 02:59:51
问题 I'm currently working on a GPGPU project that uses OpenGL ES 2.0. I have a rendering pipeline that uses framebuffer objects (FBOs) as targets, i.e. the result of each rendering pass is saved in a texture which is attached to an FBO. So far, this works when using fragment shaders. For example I have to following rendering pipeline: Preprocessing (downscaling, grayscale conversion) -> Adaptive Thresholding Pass 1 -> Adapt. Thresh. Pass 2 -> Copy back to CPU However, I wanted to extend this

Texture has only blue hue when using glTexImage2D

ε祈祈猫儿з 提交于 2019-12-11 02:44:19
问题 I'm trying to show image using glTexImage2D, I work with MFC, Visual C 6.0. Here the code: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); /* enable 2D texture mapping */ glEnable( GL_TEXTURE_2D ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, BitmapBits);

How can I remove the texture from an image using matlab?

南楼画角 提交于 2019-12-11 02:43:02
问题 How can I use the fourier transform to find out the frequency components which are responsible for the texture on the surface? Then I have to remove them to have a smooth surface without texture. This is the image. Thanks 回答1: If you use Fourier Transform and analyze frequency components, then removing high frequency components of the image gives a close effect of low pass filter. However, it does not seem natural since you also manipulate the phase of the image. As people suggest, I also

3D texture size affecting program output without error being thrown

别来无恙 提交于 2019-12-11 02:34:27
问题 First, I am using the glDebugMessage() instead of glGetError() to determine errors. Second, I am allocating a 3D texture storage as follows: glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F, 512, 512, 303, 0, GL_RGBA, GL_FLOAT, NULL); When the depth coponent is 303 or less, my program works exactly as expected (I allocate a color in the texture and I see that color as output), when that parameter is 304 or higher, the program doesn't work (the screen is black). I have tested the same program in

regarding glTexImage3D

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:32:11
问题 In case of 3D textures, For three-dimensional textures, the z index refers to the third dimension. What does this exactly mean? For two-dimensional array textures, the z index refers to the slice index. is it like if we have 4 layers of 2D textures, then if z=2, it will refer to 2nd 2D texture slice.? So what is difference when we have targets GL_TEXTURE_3D and GL_TEXTURE_2D_ARRAY except diff between texture cordinates? 回答1: For three-dimensional textures, the z index refers to the third