I have a tiled map in cocos2d-iphone. It uses .png images.
Sometimes, when you look closely enough, you will notice some parts "pixelated". Of bad quality. But then, if you move your character (and the map scrolls), suddenly it fixes and looks normal. If you keep on moving randomly, you might see it gets wrong again etc...
This never happened before until recently. But it is weird because I never touched the tiled maps ever again.
What could be causing this? iPhone 4, retina enabled.
The sprite is probably positioned on a sub-pixel, such as 16.5f, which could cause distortion.
Related
I am developing a application with OpenGL+GLFW and Linux as a target platform.
The default rasterizing has VERY strong aliasing. I have implemented FXAA on top of my pipeline and I still got pretty strong aliasing. Especially when there's some kind of animation or movement, the edges of meshes are flickering. This literally renders the whole project useless.
So, I thought I would also add a supersampling and I have been trying to implement it for two weeks already and still can't make it work. I start to think it's not possible with the combination PyOpenGL+GLFW+Ubuntu18.04.
So, the question is, can I do a supersampling by hand (without OpenGL extentions)? At the end of my (deferred) rendering pipeline I save all the data from different passes to the hard drive, so I thought I would do something like this:
Render the image with 2x/3x resolution to the texture.
Save the texturebuffer to the array.
Get the average pixel's value from each 2x2/3x3/4x4 block
of this array.
Save it to the hard drive.
Obviously, it's gonna be slower than mulstisampling with OpenGL extention and require more memory, but I don't need high fps and I have a pretty small resolution (like 480x640 or similar) so it might work out.
Do you guys have any thoughts about it? I would be glad to any advice.
I'm making kind of a graphic engine using OpenGL, but I am having a bit of a problem, the texture is not loading properly, it loads like this:
While it should load the picture of the "heart" square fully as a square, but some of it is gone, and it kinda vibrates whenever the frames change, I realized if I remove the frames (on screen), it wouldn't get that problem.
Like, what is wrong with that thing?
EDIT: it appears that the problem is caused by shaders on AMD GPUs, I dunnu why and if someone knows what could be causing the problem by that please tell me, also I have a long code don't really know which is causing the problem...
and I tried a different method: I rendered the label on a different layer and it worked :/
I'm developing a very basic came In C++ with openGL and GLUT where you move the "camera" around as the player.
In short:
My camera slows down when I look at a snowman
Full explanation:
Everything was fine until I decided to finally add in an object (a giant snowman in fact), but now I've added it, I'm experiencing very odd behaviour.
If I look at the snowman object and attempt to move forward, It feels like I'm moving against a force, as if I was walking through mud.
Now If I face opposite the snowman, and "walk" backwards with the camera, It moves completely fine, but when I look at it... I slow down. I've tried different scales of the snowman, and the larger the snowman is, the further I can feel the effect.
Note though, It doesn't appear to cause me to lag, only slow down.
Any insights would be greatly appreciated, and I will post code if needed, but currently.. I have no idea what code would be relevant!
When you say it slows down, you mean your frame rate drops? Sounds like your snowman is very polygon heavy, when it's being rendered it causes a drop in frame rate slowing things down.
When you're facing away from the snowman it's being clipped, it's not in view so the polygons comprising the model aren't being sent all the way through the 3D pipeline.
If you don't have back face culling turned on, you'll probably want to do that — otherwise you probably need to simplify the model somewhat. What happens if you render a cube there instead?
Depending on what hardware you're using, even a low poly model could cause problems if you don't have a huge fill rate (the speed of the hardware to fill pixels in the render buffer), but given that it's one model and that the hardware should be more than capable of filling the screen once, I'd say this is an unlikely scenario.
I'm making slow but steady progress with a Cocos2d game, but I'm stuck creating moving platforms.
The main character needs physics and collision detection, and is therefore a chipmunk shape/body. I wrote a class to iterate over the TMXTiledMap in order to cut back on the amount of bodies in the chipmunk space. So with a map like this
----------
--------x-
-xxx----x-
----------
instead of having 5 individual bodies (rects), there are two bodies, One is three tiles wide, the other is two tiles tall.
I've managed to get the code working to identify which tiles are part of a moving platform and to move the tiles as needed.
However, the bodies need to move with the tiles in order for this to work properly. And this is where I'm stuck. The bodies are of a static mass so...
platformShape->body->p = cpv(x,y);
Doesn't do anything (I'm guessing that this is the expected behavior).
But if I set their mass to anything other than static, all the physics comes into play and the bodies do not behave as expected, or they behave perfectly depending on you how you look at it. They move erratically and the rotate when they hit another body (eg: the main character). What I'm after is the typical type of moving platform you would expect to find in a typical platform game that moves smoothly in any given direction.
My question is; Has anyone implemented something like this before and what was your technique? Or, if you were to implement something like this, how would you do it?
The relevant code is here. I put it in a pastebin since I figure it's more of a conceptual misunderstanding than anything else.
It turns out you need to call
cpRehashStaticShapes
Obvious really, but easy to miss in my opinion.
So I've got this class where I have to make a simple game in OpenGL.
I want to make space invanders (basically).
So how in the world should I make anything appear on my screen that looks decent at all? :(
I found some code, finally, that let me import a 3DS object. It was sweet I thought and went and put it in a class to make it a little more modular and usable (http://www.spacesimulator.net/tut4_3dsloader.html).
However, either the program I use (Cheetah3d) is exporting the uv map incorrectly and/or the code for reading in a .bmp that ISN'T the one that came with the demo. The image is all weird. Very hard to explain.
So I arrive at my question. What solution should I use to draw objects? Should I honestly expect to spend hours guessing at vertices to make a space invader ship? Then also try to map a decent texture to this object as well? The code I am using draws the untextured object just fine but I can't begin to go mapping the texture to it because I don't know what vertices correspond to what polygons etc.
Thanks SO for any suggestions on what I should do. :D
You could draw textured quads, provided you have a texture loader.
I really wouldn't worry too much about your "uv map" - if you can get your vertices right then you can generally cludge something anyway. That's what I'd do.