textures

libgdx distorted texture when using camera.setToOrtho(false, GAME_WIDTH, GAME_HEIGHT);

谁都会走 提交于 2019-12-12 02:06:05
问题 I'am trying to make libgdx game, adn i've got 2 problems now: 1. When im using camera.setToOrtho(false, GAME_WIDTH, GAME_HEIGHT); my textrure of player is distored, one eye is bigger than another. 2. Im using this camera and viweport: camera= new OrthographicCamera(GAME_WIDTH,GAME_HEIGHT); camera.setToOrtho(false, GAME_WIDTH, GAME_HEIGHT); viewport = new StretchViewport(GAME_WIDTH,GAME_HEIGHT,camera); and when i do : touchPos.set(Gdx.input.getX(1),Gdx.input.getY(1),0); game.camera.unproject

Cocos2d - removeSpriteFrames and removeAllTextures do not work straight away

て烟熏妆下的殇ゞ 提交于 2019-12-11 22:37:53
问题 EDIT: I added the following code in both the dealloc and cleanup method of the previous scene (the one from which I call replaceScene but it does not have any effect. Even after 1/2/5 seconds from when InstructionScene has being created the memory does still contain the assets from the previous scene. The only way to force the removal of those is to remove them from the new scene 0.1f seconds after the scene is being created (via a Callback). This is kind of weird. Here is the code of the

OES_texture_float extension use

你说的曾经没有我的故事 提交于 2019-12-11 21:15:34
问题 How to use the OES_texture_float extension? I do not understand that it is necessary to specify the arguments the function texImage2D. var fb=gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, fb); var rb=gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, rb); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16,size[0],size[1]); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER, rb); var texture=gl.createTexture(); gl.bindTexture(gl

Java fillRect() with TexturePaint is slow

人走茶凉 提交于 2019-12-11 19:48:55
问题 TexturePaint Problems I am currently making a 2D game using texturepaints. One significant problem I encountered was the fact that filling rectangles with the graphics2D setPaint method set to a texture paint is extremely slower than filling a rectangle with a base color. Is there possibly any other way to speed up painting by creating a custom class similar to Texturepaint that paints much faster? At this point I really don't know what to do because my fps is stuck at around 18-23fps. EDIT :

SFML Displaying Sprite Error 0xC0000005: Access violation reading location 0x00D54000

血红的双手。 提交于 2019-12-11 19:32:30
问题 I wrote this code while following the tutorial for SFML in C++: #include <SFML/Graphics.hpp> int main() { sf::RenderWindow window(sf::VideoMode(600, 400), "Sandstorm"); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(sf::Color::Black); sf::Texture back; if (!back.loadFromFile("greenBack.png")) return 1; sf::Sprite sprite; sprite.setTexture(back); window.draw(sprite); window.display(); } return 0;

Cocos2d 2.0 and CCSpriteBatchNode: CCAnimation crashes APP when CCRepeatForever starts second animation cycle

对着背影说爱祢 提交于 2019-12-11 19:07:53
问题 EDIT 4: I added a breakpoint to CCSpriteFrameCache spriteFrameByName method and cannot step over the following step (its clear to me that somehow the spriteFrames gets deleted from the CCSpriteFrameCache): EDIT 3: Before voting to close the question actually PLEASE TRY the code below (EDIT2) using Cocos2d 2.0 and the file and plist file attached. EDIT 2: I created a brand new GameScene test class so you can all try out the issue. It crashes as soon as the animation starts to repeat. I update

Can't map textures with OpenGL ES on real devices

两盒软妹~` 提交于 2019-12-11 17:31:59
问题 I've tried a simple program that dynamically generates a texture and map it to a quad using NDK. Everything is fine on an emulator but failed on real devices. Here is my code: private static class Renderer implements GLSurfaceView.Renderer { @Override public void onDrawFrame(GL10 gl) { nativeDrawFrame(); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { nativeInit(width, height); } @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { // do nothing... }

Missing texture in .OBJ model on min3d framwork android

ⅰ亾dé卋堺 提交于 2019-12-11 17:07:28
问题 I am following this tuttorial: http://www.mat-d.com/site/tutorial-load-a-3d-obj-model-with-min3d-for-android/ this is my mtl file: newmtl Texture0 Ns 20 d 1 illum 2 map_Kd face_eyel_hi.jpg Kd 0.7 0.7 0.7 Ks 0 0 0 Ka 0 0 0 newmtl Texture1 Ns 20 d 1 illum 2 map_Kd face_eyer_hi.jpg Kd 0.7 0.7 0.7 Ks 0 0 0 Ka 0 0 0 newmtl Texture2 Ns 20 d 1 illum 2 map_Kd face_skin_hi.jpg Kd 0.7 0.7 0.7 Ks 0 0 0 Ka 0 0 0 newmtl Texture3 Ns 20 d 1 illum 2 map_Kd face_sock.jpg Kd 0.7 0.7 0.7 Ks 0 0 0 Ka 0 0 0 the

textures with transparent background by using alpha blending opengl

百般思念 提交于 2019-12-11 16:48:05
问题 I have scar textures and I want to get rid of the background skin colour by using alpha blending. However, I have problems with changing the opacity of individual pixels of specific textures. What is the easiest way to have textures with transparent background? I am using C++ and openGL. I am using a BMP picture format and I am trying to map that scar texture onto the face but background colour of scar texture seems ugly on the face, so I want to remove that part and have only scar texture

Opengl Selection with Alpha Test

依然范特西╮ 提交于 2019-12-11 15:57:42
问题 From what I've been seeing around the internet, this problem can't really be solved with my approach. I am currently writing a program that uses a selection buffer pass over all the objects in the scene. However, one of the objects is a texture in which a large part of it has alpha 0. It works fine when rendering, the alpha values are not displayed, but when in selection mode, the alpha test is skipped, and hovering the mouse over the transparent areas selects the object instead of whatever