Questions tagged [viewport]

An area (typically rectangular) expressed in rendering-device-specific coordinates, e.g. pixels for screen coordinates, in which the objects of interest are going to be rendered

21 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
678 views

Why doesn't the Camera.pixel(Height/Width) match the Canvas size?

I am making an app that has a custom viewport Rect like so: When I check the sizes of this viewport rectangle in pixels with Camera.pixelHeight; Camera.pixelWidth,...
1
vote
1answer
232 views

How to do in Godot 2D: game screen in one viewport and minimap in another. Different sprites on each

The second day I google the tutorials, but nothing comes of it. All tutorials link to splitscreen demo, but it is made under the second Godot and does not work in the third. The problem is this: I ...
1
vote
0answers
160 views

Performance problems with scrolling html5 canvas for large tile-based game

I try programming a splix.io clone as an electron app and do the visualization via the html5 canvas. The movement across the tiles should look fluent like the original, so I target 60 frames a second. ...
1
vote
2answers
276 views

libgdx Camera and World Size Question

I'm new to libgdx and especially to using OrthographicCameras. I'm trying to understand how useful they are. The question is, suppose I have a game map 500 units wide. I have an OrtographicCamera ...
1
vote
0answers
484 views

get position of GameObject on rendertexture from camera

I'm rendering the camera output to an rendertexture on a plane. This works fine. But I want to put GameObjects on the rendertexture on positions of world objects that are visible on the camera. <...
1
vote
0answers
56 views

Implementing navigatable achievement menu in javascript

I am in the process of learning javascript for game design, and wanted to make a separate achievement page that the user can navigate to that will allow them to check their achievements on various ...
1
vote
0answers
300 views

Libgdx handle screen resolutions

I know there are some questions to this topic, but i didnt find a satisfying answer for my problem yet. I'm learning to use libgdx right now, and I'm not sure about handling different screen ...
1
vote
0answers
361 views

Create multiple viewports in minecraft?

Im new to minecraft modding, but Im curious about the possibility of creating a mod such that players could set up a 'security camera' with its own viewport so that the player could 'see what the ...
1
vote
1answer
432 views

glViewport and single-pass cubemap rendering

This question is related to another question of mine on StackOverflow. The problem I'm facing is that while I'm rendering to a cubemap in a single pass using a geometry shader (like I show in my ...
1
vote
1answer
254 views

Scene2D viewport affects all other cameras despite having a separate one

I have two cameras initialized as such: ...
0
votes
0answers
20 views

DIY hologram experiments split screen

I am currently experimenting with the DIY holograms. Does anyone know to split my windows into 4 perpendicular identical displays like this but for Windows? I am using Unreal Engine & I want it to ...
0
votes
0answers
13 views

Libgdx FillViewport vs FillCamera unproject issue

I have no idea why this happens. But I have the following scenario: Rendering a tiled map works fine. Rendering the sprites texture region works fine. Rendering the shapes of the sprites using a ...
0
votes
0answers
20 views

How to check what part of an gameobject is seen by a camera?

Could anyone please give me a hint on how to determine how much of an object is seen by a camera. There have to be a threshold value (e.g. 30% of an object is seen). If value is below the threshold ...
0
votes
0answers
45 views

Does Unity provide access to a camera's Viewport Rect in a shader?

If I, for example, set a camera's Viewport Rect to W:0.5 H:0.5, is there some way to access that in a shader? Is there some way to extract it from unity_CameraProjection? I thought about comparing ...
0
votes
0answers
26 views

How can I instantiate enemies in a 2D game at a set Viewport Position before my camera enters the room? (Or alternative solution!)

I'm currently working on a 2D game where I'm trying to pre-populate my level with encounters, I want the enemies already in the room when the player enters. Right now the encounter is triggered upon ...
0
votes
0answers
24 views

How to fix “stretched” textures in LibGDX?

I'm drawing textures using SpriteBatch and all textures are stretched. Previously I was using Stage and StretchViewport and back then everything was fine. My code: ...
0
votes
0answers
125 views

OpenGL viewport is stretched

For this project I am using GLFW, glad and glm. My window looks like this: The dimensions of the window are correct, but the viewport is stretched, making my square into a rectangle. How do I use a ...
0
votes
0answers
39 views

Confused on graphics rendering

Implementing a viewport is just a rectangular space on the back buffer usually a 2d texture set to the size of the client window that we render to. However in direct3d when we describe the viewport ...
0
votes
0answers
51 views

Keep player within screen bounds, top down shooter

I am using x and z axis to go left/right ; up/down respectively. The Camera is on the y-axis. I have the following code so far - private float playerWidth; private float playerDepth; ...
0
votes
1answer
391 views

Transforming 2D viewport coordinates after scaling the viewport (zoom in/out)

I've been getting started with personal experimentation and have been working on a project for a few days now using SDL2. It is a 2D game, and at this stage I have it rendering game objects in a fixed-...
0
votes
0answers
761 views

Scaling issues with Open GL viewport / scissor box (Trying to draw outside of viewport)

In my game I am currently scaling the viewport so it retains the ratio of my development device like so: ...