Tagged Questions

A very generic term referring to visual part of a game. Try to avoid unrelevant usage and instead tag for specific graphics type (2D, 3D), API, framework or a library you are using, if possible.

learn more… | top users | synonyms

2
votes
2answers
1k views

How can I play an RTSP video stream in Unity3D?

I want to play an RTSP video stream on a Texture2D. The stream is coming from an IP camera and is encoded with H.264, MJPEG or MPEG4. I know about VLC's libraries, ffmpeg, direct show, media ...
0
votes
0answers
146 views

Calculate parameters for orthographic matrix for directional shadow mapping

I am struggling with how I can fit my scene in an orthographic projection, based on what is visible by the camera. All tutorials so far explain almost everything in perfect detail, and then for the ...
0
votes
0answers
113 views

Shadow Mapping: How to calculate Axis Aligned Bounding Box?

I am trying to implement Shadow Mapping, which is actually working with an AABB that always covers my entire scene, but (obviously) it gives very blocky graphics. So I figured I need to calculate a ...
0
votes
1answer
53 views

How can I load a picture with alpha channel in JME?

This code loads a picture into the game: Picture mypic= new Picture("mypic"); Texture2D tex = (Texture2D) assetManager.loadTexture("Textures/mypic.png"); ...
4
votes
2answers
1k views

How can I create animated card graphics like in Hearthstone?

In the game Hearthstone, there are cards with animated images on them. A few examples: http://www.hearthhead.com/card=281/argent-commander http://www.hearthhead.com/card=469/blood-imp The ...
2
votes
1answer
259 views

Surface shader with VertexLit causes black object

I wrote the simplest possible surface shader: Shader "SimpleSurf" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Tags {"RenderType"="Opaque" } ...
0
votes
1answer
164 views

What image format supports transparency in Android?

I want to show an apple on screen but the image has a white background and it doesn't blend with the background of a tree. Is there any image format in which only the red apple is displayed?
-1
votes
1answer
64 views

How do I detect how much of an object has been “cleaned” by the player?

I want to let the player wipe some dust off of a book, then start a short animation. Here's what it looks like: I'm using a clipping region on the "dusty" book bitmap image to progressively hide ...
1
vote
1answer
49 views

Vertexquads are not being drawn in 2D space

I started teaching myself DirectX a short time ago and have come across a problem which I can't figure out by myself unfortunately. I'm trying to build my own font system, so I can draw strings in 2D ...
3
votes
2answers
391 views

What is the difference between “offline” and “real time” rendering?

I have a rough idea: real-time is approximated with little or no global illumination. But how would you otherwise explain why offline rending takes so much longer? You hear things like "number of ...
0
votes
0answers
59 views

“Blinking” graphical bug when rotating shadow matrix

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
0
votes
1answer
51 views

Proper Order to Process Each Frame

I'm writing a rudimentary 2D engine and am wondering what the proper or generally accepted order is for handling graphics, user input, sounds, and then other systems like physics. If you have written ...
3
votes
1answer
178 views

How are Volumetric Effects made within games? (e.g. Smoke/Fire)

For computer generated volumetric elements such as clouds, fire, and whitewater. How are they made? Is it just a simple collection of particles [put to pixels] taken from Physics equations or are the ...
1
vote
2answers
197 views

XNA blurring moving images

Why does XNA blurs the images which moves less than 1px in between two draws? It is quite annoying, because everything looks really blurry. Is there a way to disable it? I have tried to set the ...
0
votes
1answer
197 views

Creating a gradient for a texture - Why is the color becoming dark on one side?

Updated While debugging I looked at the lerp and it was calculating into a negative number at the start. So I added in checks for to low or high a value, and that seems to have fixed it. I'll answer ...
0
votes
1answer
186 views

How do you calculate a gradient value within multiple colors (gradient stops)

In WPF/Silverlight XAML you can have a brush with multiple gradient stops at different points along the color line. I was able to replicate this behavior with two colors, a single color lerp, from ...
5
votes
1answer
5k views

Multiple resolutions for Unity 2D Android game

I'm trying to target as many devices as possible by providing a consistent experience. So I'm trying to make sure the aspect ratio fits each device it's played on. After reading some forums and ...
0
votes
0answers
30 views

Rotating an object towards a point in OpenGL C++ [duplicate]

I calculate the matrix like this: modelMatrix = glm::translate<float>(position) * glm::rotate<float>(orientation.x, glm::vec3(1, 0, 0)) * glm::rotate<float>(orientation.y, ...
0
votes
0answers
43 views

Checking if two lines are crossing [duplicate]

How can I check if two lines (created with function love.graphics.line) are crossing themselves? I may use this ability to create procedural maps via graphs.
3
votes
1answer
551 views

Day and Night Cycles and Skybox Blending

I've been working on adding day/night cycles and random weather to my project using the Neoaxis engine. The day/night cycles itself is pretty simple, just rotating the "sun" light around the Y axis. ...
2
votes
2answers
153 views

Isometric objects are mapped incorrect angle, but the map is fine. What am I missing?

I laid out my iso map and it's fine, but when I add my sprite actors they get located in the correct location but they are laying down not standing up. I tried rotating them on the z by 45 but then ...
3
votes
1answer
342 views

Planet sized quadtree terrain precision

I've been working on a planet sized and shaped terrain lib for a while (In webgl and Unity) and have a couple of working implementations [Quadtree cubesphere and circular clipmaps]. But both of them ...
6
votes
2answers
202 views

Reducing Spherical Harmonic Ringing

I've generated some 2nd order SH light-probes from cube-maps in my scene and I was surprised how strong artifacts are around the back of the dominant lights. I switched to a Lambert source plus ...
0
votes
1answer
294 views

How can I draw a single line using JMonkeyEngine?

I need draw a line between two boxes using their respective positions. I've created the Line object but I don't know how to show it in the scene. Line ray = new Line(box1.getLocalTranslation(), ...
18
votes
4answers
3k views

How can I draw outlines around 3D models?

How can I draw outlines around 3D models? I'm referring to something like the effects in a recent Pokemon game, which appear to have a single-pixel outline around them:
0
votes
1answer
215 views

Apply a texture on a Box - jMonkeyEngine

How can i wrap a texture (for ex a 4x4 pixels) on a box (1x1x1) in such a way that the texture is repeated and not enlarged to cover all the surface. Geometry box = new Geometry("Box", new ...
1
vote
1answer
161 views

How to enable geometry shader in OpenGL 4.2?

I'm porting my Direct3D-based engine to OpenGL and I'm using geometry shaders for rendering text characters (basically, textured billboards). D3D version works fine, but in OpenGL mode it gives only ...
0
votes
1answer
184 views

Ground contact point for animated character sprites in an isometric game?

I'm working on an isometric game. I have the 3D pre-rendered sprites for directions per state (walking/running, etc.) per frame. Now I need to know where a particular character stands on the ground to ...
1
vote
1answer
51 views

Art asset creation workflow question: are there any neat ways to save your work and automatically export it to desired format?

To be specific: I have used GraphicsGale for pixel art sprites. The program saves its files in its own format (.gal, I believe), but the images in my game have to be .png. Saving it to .png loses ...
0
votes
1answer
250 views

Scaling background without scaling foreground in platformer?

I'm currently developing a platform game and I've run into a problem with scaling resolutions. I want a different resolution of the game to still display the foreground unscaled (characters, tiles, ...
1
vote
0answers
209 views

Xna GraphicsDevice.IsFullScreen causes strange resolution stretching artifacts

Sorry for the non-descriptive title. So I've been trying to implement fullscreen mode into my xna-game, and I've hit a couple of roadblocks. My basic code setup for this functionality is the ...
5
votes
1answer
240 views

Are there multiple valid definitions for what translate, rotate and scale do?

Are there multiple valid definitions for what translate, rotate and scale do to the 4x4 matrix? I bring up this question, because I have a simple webgl program that draws a square and does a few ...
2
votes
2answers
75 views

Would seam carving/liquid rescale make changing aspect ratios easier?

Seam carving is an algorithm which allows for resizing images without major distortions. I think it might help to make games which would adapt to different aspect ratios/resolutions much easier. But ...
1
vote
3answers
442 views

How do I efficiently use 16 bit texture coordinates?

While loading a model I get a big array of 32 bit floating point texture coordinates. I just upload that to a single vertex buffer (along with other data, such as vertices, normals, etc.) and use it ...
7
votes
2answers
381 views

How many rendering passes is “normal”?

I've been implementing John Chapman's method for SSAO (an excellent tutorial by the way), and I've completed it all minus the final part: blurring it. I believe this is what the entire process should ...
0
votes
1answer
122 views

Effectively drawing dynamic primitives

Okay, so this is where I am now. My game largely consists of textures drawn through spritebatch. Now I have to draw a dynamic number of triangles. I cannot say in advance where or how many I have to ...
3
votes
1answer
308 views

Solving banding with additive blended particles

I needed to implement particles for my 2D game, written in C++ with OpenGL for graphics, so I went ahead and created a nice geometry container to batch particles together and then implemented the ...
0
votes
1answer
34 views

Versions of GL and its device that don't display or required powers of 2 for the sprites

From this question aside from identifying possibilities of displaying images that don't needed to require powers of 2, what are the versions of GL that can actually display images even if don't needed ...
1
vote
1answer
104 views

Maya: Mystery Grey Wireframe?

I am starting out with Maya and just moved my object up to reveal a mystery grey wireframe which I can't work out what it is at all. It appears I can't select or interact with it at all. I have been ...
0
votes
1answer
152 views

HLSL postprocessing for day to night (DTN)

I am trying to implement a "day-to-night"-filter (as commonly used in cinema) for a 2D game (XNA) by using a full screen HLSL pixel shader. The aim is to transform any bright and colorful image into a ...
3
votes
2answers
457 views

When is the Z coordinate normalized in GLSL?

I thought that whenever you transform an object to world space, then view space and finally screen space, the last matrix you apply(the projection matrix) normalizes the z values between 0 and 1. ...
1
vote
2answers
395 views

What is the depth that a pixel shader may output? Is it necessary to write Depth?

In DirectX11, what does the depth that a Pixel Shader can output mean? Does a pixel shader need to output a depth so that we "write" the depth? If not, why would we output it? For any doubts, I'm ...
2
votes
1answer
101 views

How do I quantize an image into an arbitrary bitdepth with dithering?

In the games I make, sometimes I need to balance the quality of the images I show with the amount of memory they consume. This is especially true for smartphones and other devices with very tight ...
2
votes
1answer
310 views

How does the fragment shader get data from the vertex shader?

How can any interactions between these two shaders work? I mean the vertex shader sends a vertex's color to the fragment shader, but that's only one fragment, what about all the other ones between the ...
1
vote
1answer
381 views

What is the difference between shader uniforms and attributes in OpenGL?

I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes. Can uniforms change for each vertex? I mean to calculate the vertex's ...
2
votes
1answer
192 views

Are ambient, diffuse and specular light or material properties?

Are ambient, diffuse and specular properties of light or material? I am doing ray casting in OpenGL, I've managed to create lit sphere using formula I = L Ka + L Kd (n . l) + L Ks (r . v)^n but I ...
14
votes
1answer
655 views

Rendering oily/polluted water?

Any shader wizards out there have an idea of how to achieve an oily/polluted water effect, similar to this: Ideally, the water would not be uniformly oily, but instead the oil could be generated ...
5
votes
1answer
543 views

How can I create a 3D model in Java without using modeling software? [closed]

I am a lightly experienced game developer and this is my first time trying 3D objects in Java for the first time. I have been recently creating and updating games using AWT, Swing, and Graphics, but I ...
2
votes
2answers
195 views

Glitch-free cross-fades in HTML5

In my HTML5 canvas game, I need to cross-fade two sprites which have some glow around them. (Glow is backed into sprites.) Initially, the first sprite is visible. During the cross-fade the first ...
1
vote
1answer
113 views

What is w componet [duplicate]

What is the W component on graphics programming. I read a blog about opengl that says that w must be equal to either 0 or 1 here. But the book I am currently reading has put w component to more than 1 ...