texture

Getting gaps between tiled textures with libgdx

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So im using libgdx, making a platformer. Im using square tiles for the platforms but when they are drawn some of them have gaps between them. When I zoom in/out or move the camera around the gaps move position. Has anyone had the same problem or know how it fix it? A little more detail. tiles are size 32 and have tried textures of both 32 and 64. tiles are lined up 32 apart eg. first tile would be x =0 y=0 second x=32 y=0 and so on in both x and y directions. The gaps are not texture artefacts as I have checked this many a time. Using the

Getting smooth, big points in OpenGL

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I started playing around with OpenGL and GLUT. I would like to draw some points, but the problem is that they turn out to be squares, and I would like them to be round dots (filled circles). This is what I do: void onInitialization ( ) { glEnable ( GL_POINT_SMOOTH ); glEnable ( GL_BLEND ); glBlendFunc ( GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA ); glPointSize ( 6.0 ); } void onDisplay () { glClearColor ( 1.0f , 1.0f , 1.0f , 1.0f ); glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glBegin ( GL_POINTS ); glColor3f ( 0.95f , 0.207

DirectX Lighting

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Hi. I've got a small game using directX10 and C++. However, I started making it using the meshloaderfromOBJ10 direct X sample and I have just been building on it. However, my objects are all looking just plain black althought they have colour. I know this is because of the light, but seemingly changing any of the code to do with the light does nothing from this sample. I was wondering if anyone knows a simple(ish) method to just light everything, as in make it bright everywhere. I don't care about shadows or reflection or anything

glFramebufferTexture2D fails on iPhone for certain texture sizes

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I try to attach a texture to a framebuffer, glCheckFramebufferStatus reports GL_FRAMEBUFFER_UNSUPPORTED for certain texture sizes. I've tested on both a 2nd and 4th generation iPod Touch. The sizes of texture that fail are not identical between the two models. Here are some interesting results: 2nd generation - 8x8 failed, 16x8 failed, but 8x16 succeeded! 4th generation - 8x8 succeeded, 8x16 succeeded, but 16x8 failed! Here's some code I used to test attaching textures of different sizes: void TestFBOTextureSize(int width, int height) {

Texture issue while using THREE.TextureLoader over deprecated THREE.ImageUtils.loadTexture

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was using this function to add Texture on a Cylinder. function createElementMaterial() { THREE.ImageUtils.crossOrigin = ''; var t = THREE.ImageUtils.loadTexture( IMG_MACHINE ); t.wrapS = THREE.RepeatWrapping; t.wrapT = THREE.RepeatWrapping; t.offset.x = 90/(2*Math.PI); var m = new THREE.MeshBasicMaterial(); m.map = t; return m; } which is working and adds Texture, but in console it sets a warning message. THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead. Then following this documentation from threejs.org

Can you look sample a texture in a vertex shader?

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In shader model 3.0, I'm pretty sure this was a no but I want to ask this anyway, In shader model 5.0, can you sample a texture in a vertex shader? If I want to make large amounts of supplementary information available per-vertex, what are my options? Edit: Apparently it is possible to do a Vertex Texture Fetch, as done here , but when I try it in my hlsl shader model 5 program, I get the error error X4532: cannot map expression to vs_5_0 instruction set 回答1: Yes, sampling a texture from a vertex shader is very easily done in Shader Model 5

Please help with an OpenGL ES (iPhone) multi-texturing (2D) code!

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a texture from this PNG: alt text http://gotoandplay.freeblog.hu/files/tan0_Diffuse_1.png And another from this PNG: alt text http://gotoandplay.freeblog.hu/files/tan0_Specular_1.png They both have the same blend function: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); I want to see them on one single polygon first. I just couldn't find a simple example of this. Draw them to different polygons works perfect, but I just cannot "merge" them into one texture. Any working sample codelines would be appriciated well. Second problem is to make

How to repeat the texture map like GL_REPEAT?

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a house model in my game, and I have some materials for the house geometry. There is a material for the wall of the house, and I have a texture-map-image to show the bricks. var mat = new THREE.MeshPhongMaterial( { ambient: 0x969696, map: THREE.ImageUtils.loadTexture( 'textures/G/G0.jpg' ), overdraw: true,combine: THREE.MultiplyOperation } ); In this way above, the texture map appears like GL_CLAMP I want it to show like GL_REPEAT . What should I do? If you can not see the images check this . 回答1: I have posted a full working example

Display a numpy array in Kivy

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: first of all, I'm totally new to kivy, so I'm struggling a bit. I'm trying to display a numpy array in a kivy window. So far i figured out that this should work using the Texture Class ( http://kivy.org/docs/api-kivy.graphics.texture.html ). As my numpy array changes from time to time, I'm trying to adjust the following code to my application. # create a 64x64 texture, defaults to rgb / ubyte texture = Texture.create(size=(64, 64)) # create 64x64 rgb tab, and fill with values from 0 to 255 # we'll have a gradient from black to white size =

Dynamic typing and return values in Objective-C

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have run into a very strange behaviour I can’t make sense of. I have a Texture class with contentWidth property of type int . This class is wrapped in a Image class that has a width property of type int . The width of an Image is computed simply as the contentWidth of the underlying texture: - (int) width { return texture.contentWidth; } Now the Image is used by a Button class (by composition, not inheritance) that wants to read the image size: // image is of type ‘id’ int width = [image width]; int height = [image height]; The problem is