WebGL FrameBuffer gets chopped to size of canvas - html5-canvas

I have recently tried to learn WebGL so im trying to make 2d game with tiled map,
most of code that renders sprites are pasted from a guide that I used to learn some basics.
Problem:
It only renders part of map that fits into canvas size, even if I apply some transformations to move map, here is my code https://github.com/LewisSaber/RPG_REBORN
I tried playing with gl.viewport function but I only got some parts of screen cut, thanks in advance

Related

Three.js sprite sheet offsets in THREE.Points

I'm trying to get a sprite sheet texture in THREE.PointsMaterial to use offsets, so point particles can have different visuals.
Apparently this should be possible using THREE.ShaderMaterial, instead of PointsMaterial.
This answer seems to get so close to my solution, but the fiddle is broken and I'm having a hard time reconstructing it.
Shaders are new to me and I could use some help achieving the goal: get point particles to use different sections of a sprite sheet.
With a single image texture it's easy, like this, but trying to use a sprite sheet with offsets is killing me ;)

Perspective transform in THREE JS

I found few incomplete threads regarding Perspective Transform using Three JS.
I was looking to have a rectangle with video texture on it, and each corner one after another will animate to fullscreen or in reverse. As each corner animates the texture should stretch. Something like this demo but in Three JS.
It will be great help if someone can point to an example, docs or resources to get this effect.

Unity script: scene to 3D led cube

I am a total beginner to Unity, but I'm getting familiar with the interface and the way scripts work with Game Objects. Some days ago, I came across with an article regarding a 3D LED Matrix controlled by Unity and since then I've been trying to make it work with my project.
Original article: http://philippseifried.com/blog/2014/10/29/3d-led-matrix-with-unity/
Basically, once the script is attached to an Orthographic camera (or at least that's what I understood from the article), the camera layers and "slices" the scene, transforms it into a pixel matrix and paints the result into some preview layers dynamically generated.
I have accomplished to attach the camera and get the preview layers to show up. However, I'm unable to get the final result the article shows, as preview layers show absolutely nothing. I think it has to do with the fact that the author is using some kind of transparent planes I have been unable to replicate.
It would be great if someone could guide me a bit to get the exact same result of the article by reading it and watching the last Vine, as it shows his Unity screen with the transparent layers working up and running.
The script was looking at the background color to decided wether a pixel had to be painted or not.
Changing the camera background to transparent (RGBA) was enough to see the final result.

LibGDX - Sprites to texture using FBO

I am working on a simple painting app using LibGDX, and I am having trouble getting it to "paint" properly with the setup I am using. The way I am trying to do this is to draw with sprites, and add these individual sprites into a background texture, using LibGDX's FBO commands, when it is appropriate.
The problem I am having is something relating to blending, in that when the sprites are added to this texture that I am building, any transparent pixels of the sprite that are on top of pixels that have been drawn to previous will be brightened up substantially, which obviously doesn't look very good. The following is what the result looks like, using a circle with a green>red gradient as the "brush". The top row is part of the background texture now, while the bottom one is still in its purely sprite drawn form.
http://i238.photobucket.com/albums/ff307/Muriako/hmm.png
Basically, the transparent areas of each sprite are brightening anything below them, and I need to make them completely transparent. I have messed around with many different blending mode combinations and couldn't find one that was any better. GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA for example did not have this problem, but instead the transparent pixels of each sprite seem to be lowered in alpha and even take on some of the color from the layer below, which seemed even more annoying.
I will be happy to post any code snippets on request, but my code has become a bit of mess since I started trying to fix these problems, so I would rather only put up the necessary bits as necessary.
What order are you drawing the sprites in? Alpha blending only works with respect to pixels already in the target, so you have to draw all alpha-containing things (and everything "behind" them) in Z order to get the right result. I'm using .glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

LibGDX - Sprite to Pixmap

I am using LibGDX for a small app project, and I need to somehow take a series of sprites and place them (or their pixels rather) into a Pixmap. The basic idea is to take random sprites that are generated through various means while the app is running, and, only at specific times, merge some of them onto a single background sprite.
I believe that most of this can be done easily, but the step of getting the sprite images into the Pixmap isn't quite so obvious to me. The sprites also have various transparent and semi-transparent pixels, so simply grabbing the color at each pixel while it is all on the same screen isn't really applicable either, as it obviously shouldn't take the background colors with it.
If there is a suitable alternative to this that would accomplish what I am looking for I would also love to hear it. Any help is highly appreciated.
I think you want to render your sprites to an off-screen buffer (called an "FBO" or FrameBuffer in libgdx) (blending them as they're added), and then render that offscreen buffer to the screen as a single draw call? If so, this question should help: libgdx SpriteBatch render to texture
This requires OpenGL ES 2.0, which will eliminate support for some older devices.

Resources