textures

JOGL mipmaps and texture shimmering

非 Y 不嫁゛ 提交于 2019-12-13 05:42:28
问题 I've a wall and a brick texture in my OpenGL 2 scene that keeps shimmering and flashing no matter what I set. When I'm zoomed in close (and can see clearly the texture), then the flashing and shimmering stops. But when I'm zoomed out and moving around the scene, the flashing and shimmering is very pronounced. This is the texture code for the brick wall: brickwall.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_S, GL2.GL_REPEAT); brickwall.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_T, GL2.GL_REPEAT);

Resizing and position a SharpDX sprite

两盒软妹~` 提交于 2019-12-13 05:19:40
问题 I'm trying to resize a DirectX Texture and place it in the top right corner of the window. I am drawing the texture using a sprite, here's is my code (I am using SharpDX): albumArtSprite.Begin(); NativeMethods.RECT rect; NativeMethods.GetClientRect(device.CreationParameters.HFocusWindow, out rect); float targetDimensions = 150f; var matrix = Matrix.Scaling(targetDimensions / albumArtInformation.Width, targetDimensions / albumArtInformation.Height, 0f) * Matrix.Translation(rect.Width -

3D sphere with texture in Canvas (HTML5)

妖精的绣舞 提交于 2019-12-13 05:16:36
问题 Can we bind texture with Canvas (HTML5) 3D Sphere ? I am referring to this example - http://www.bitstorm.it/blog/en/2011/05/3d-sphere-html5-canvas/ Thanks, EDIT : alternate link - http://sebleedelisle.com/2011/02/html5-canvas-3d-particles-uniform-distribution/ 回答1: Yes it is possible just like http://www.nihilogic.dk/labs/canvas3dtexture_0.2/ . But if you actually looking for 3d texture you must use WEBGL texture A nice introduction can be found in Learning WebGL 来源: https://stackoverflow.com

Program cannot find image directory when run from IDE, but CAN when run from folder?

旧城冷巷雨未停 提交于 2019-12-13 05:15:38
问题 When I build, it succeeds with no errors. However, when I run from the IDE, I get an error (my image fails to load because it cannot find the directory). However, if I go into the folder and run the program(.exe) it finds the image directory perfectly. mTextures.Load(Textures::Background, "../GFX/Background.png"); ^the line of code giving the directory. I assume this is a problem with a setting I didn't enter correctly in my compiler? I am using Code::Blocks on Windows. 回答1: Your debugger's

Render buffer to texture2D object in XNA

亡梦爱人 提交于 2019-12-13 03:45:41
问题 In XNA is there a way to render the contents of a spriteBatch after drawing to a texture object before rendering to the screen? 回答1: You'll need to switch your render target for the spritebatch and then grab the texture out of it. This MSDN article explains it pretty well. http://msdn.microsoft.com/en-us/library/bb976073.aspx 回答2: As Hexxagonal already answered, yes you can. But you might get into trouble, if you are using sprites with translucency. The reason is, that two overlapping sprites

Access violation on wglBindTexImageARB ; due to WGL_FRONT_LEFT_ARB not defined allthoug wglext.h included?

二次信任 提交于 2019-12-13 03:42:32
问题 I have an Access violation on this line : if (RTT.wgl.wglBindTexImageARB(RTT.wgl.hBuffer, WGL_FRONT_LEFT_ARB) == FALSE) ShowMessage(AnsiString().sprintf("wglBindTexImageARB returned %i", GetLastError())); The exception is thrown before the getlasterror() call : so getlasterror can't tell anything. When I try to evaluate the expression with Borland Builder's debugger, it says impossible to evaluate : due to WGL_FRONT_LEFT_ARB not defined. So I added wglext.h in the includes : no success, same

Repitition of texture on pan gesture in Metal Shading Language

若如初见. 提交于 2019-12-13 03:41:31
问题 I am new to metal shading language.So your kind guidance would be so helpful. I just repeated texture using metal as shown on below image (Image sequence). But it seems not smoothy.How can I make it to be appeared as smoothy line as done in following link for metal points.(overlapping Metal Point primitives and blending) At the moment what I do is allocating memory for vertex buffer (MTLBuffer) at each touch point in my gesture. code: func allocateMemoryForVetexBuffer(vertices: Array<Vertex>)

How to draw transparent textures in LWJGL?

徘徊边缘 提交于 2019-12-13 03:31:06
问题 I have been trying to draw a transparent texture in LWJGL. However, the code I have doesn't seem to work. Whenever I run the code, the transparent image appears but the background is completely black. Here's what I mean by completely black, but the image is fine: I have been able to draw non-transparent textures, but so far I've had no luck with drawing this one correctly. I would like to know what is missing/incorrect in this code. Code for drawing texture: //draw transparent texture GL11

GLKTextureLoader textureWithContentsOfFile: fails for the first time

断了今生、忘了曾经 提交于 2019-12-13 02:54:15
问题 I am using GLKTextureLoader to load image textures into a sprite. When I run the following code and load two sprites... NSString *pathToImage = [NSString stringWithFormat:@"%@/defaultProject/images/%@", [Util applicationDocumentsDirectory], fileName]; NSLog(@"path: %@", pathToImage); self.textureInfo = [GLKTextureLoader textureWithContentsOfFile:pathToImage options:options error:&error]; if (self.textureInfo == nil) { NSLog(@"Error loading file: %@", [error localizedDescription]); return; } .

CUDA extern texture declaration

丶灬走出姿态 提交于 2019-12-13 01:27:34
问题 I want to declare my texture once and use it in all my kernels and files. Therefore, I declare it as extern in a header and include the header on all other files (following the SO How do I use extern to share variables between source files?) I have a header cudaHeader.cuh file containing my texture: extern texture<uchar4, 2, cudaReadModeElementType> texImage; In my file1.cu , I allocate my CUDA array and bind it to the texture: cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc< uchar4