textures

OpenGL Texture Sampling not working

心已入冬 提交于 2019-12-23 02:47:07
问题 I'm using VC++10 + OpenGL + the Assimp Library to consume and then render some 3D models. The code is rendering the positions correctly, but for some reason the textures are seriously bugged. My texcoords appear to be loading correctly as are the texture files themselves - however I can't help but feel that the issue must be located with the loaded textures themselves. www.flickr.com/photos/95269725@N02/8685913640/in/photostream { i seem to have a lack of rep to post inline images } * ** * **

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

笑着哭i 提交于 2019-12-23 01:28:20
问题 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,

CALayer OpenGL(-ES) texture memory usage

夙愿已清 提交于 2019-12-22 18:17:18
问题 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

Replicate OpenGL Blending in Metal

瘦欲@ 提交于 2019-12-22 12:22:56
问题 I have been working on porting an open source game written using a fixed function pipeline to Metal. I have been able to redo all the projection transformation and have things being drawn where they should be drawn with the correct texture and vertex information but I'm having lots of trouble getting the fragment shader to match the OpenGL blending, the textures look correct but the blending and brightness are off. Here is what I'm trying to match: here is how it is currently rendering: The

Yet Another CUDA Texture Memory Thread. (Why should texture memory be faster on Fermi?)

自作多情 提交于 2019-12-22 09:50:20
问题 There are quite a few stackoverflow threads asking why a kernel using textures is not faster than one using global memory access. The answers and comments seem always a little bit esoteric to me. The NVIDIA white paper on the Fermi architecture states black on white: The Fermi architecture addresses this challenge by implementing a single unified memory request path for loads and stores, with an L1 cache per SM multiprocessor and unified L2 cache that services all operations (load, store and

directx texture dimensions

余生颓废 提交于 2019-12-22 09:37:41
问题 so I've discovered that my graphics card automatically resizes textures to powers of 2, which isn't usually a problem but I need to render only a portion of my texture and in doing so, must have the dimensions it has been resized to... ex: I load a picture that is 370x300 pixels into my texture and try to draw it with a specific source rectangle RECT test; test.left = 0; test.top = 0; test.right = 370; test.bottom = 300; lpSpriteHandler->Draw( lpTexture, &test, // srcRect NULL, // center NULL

In openGL. How do you copy part of a texture to another texture

隐身守侯 提交于 2019-12-22 08:17:37
问题 I am trying to create a blank (white with no alpha) texture where I can load other textures and write part of them. I tried just having to get a portion of the texture, and using glTexSubImage2D to put it there it doesn't seem to work right. Anyone have any idea how to do this? What am i doing wrong? int sourceTextWidth; int sourceTextHeight; int sourceFormat; int formatOffset = 0; //bind the texture glBindTexture( GL_TEXTURE_2D, textureID ); //get its params glGetTexLevelParameteriv(GL

Bound CUDA texture reads zero

只谈情不闲聊 提交于 2019-12-22 06:40:53
问题 I try to read values from a texture and write them back to global memory. I am sure the writing part works, beause I can put constant values in the kernel and I can see them in the output: __global__ void bartureKernel( float* g_odata, int width, int height) { unsigned int x = blockIdx.x*blockDim.x + threadIdx.x; unsigned int y = blockIdx.y*blockDim.y + threadIdx.y; if(x < width && y < height) { unsigned int idx = (y*width + x); g_odata[idx] = tex2D(texGrad, (float)x, (float)y).x; } } The

iPhone 6+ simulator doesn't load @3x images from atlas

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 21:38:43
问题 What I've noticed when running project on iPhone 6+ simulator is that simulator don't pick up right images. Instead of @3x, @2x images are used. I tried reseting simulators content and settings, clean project and delete derived data from organizer and same thing still happens. When I look for the myatlas.atlasc folder inside the myapp.app (show package contents) at the path: /Users/username/Library/Developer/Xcode/DerivedData/appname-appspecificgeneratedstring/Build/Products/Debug

Loading Images (using their RGB(A) pixel data) in openGL textures

怎甘沉沦 提交于 2019-12-21 21:34:11
问题 In the main function: img = cvLoadImage("test.JPG"); //openCV functions to load and create matrix CvMat *mat = cvCreateMat(img->height,img->width,CV_8SC3 ); cvGetMat( img, mat,0,1); //creating the 3-dimensional array during runtime data = new float**[img->height]; for(int i=0;i<img->height;i++){ data[i] = new float*[img->width]; } for(int i=0;i<img->height;i++){ for(int j=0;j<img->width;j++) data[i][j] = new float[3]; } //setting RGB values for(int i=0;i<img->height;i++) { for(int j=0;j<img-