Tag Info

Hot answers tagged

17

I can't tell if that specific image you linked was painted that way originally or not, but the resulting effect looks similar to an edge detection filter. Edge detection post-processing is often done using a Sobel filter implementation. For example, as seen here (a CPU-side implementation). The effect can be achieved in shaders as well (here is an HLSL ...


7

This can be implemented as a post-processing kind of effect. (When using Unity/XNA/Dx/OGL/...) Geometry method Start by creating a mesh that resembles the distortion effect you are looking to achieve. (e.g. model a half cylinder (or cone, sphere, cube, ...), make sure to set the texture coordinates). Render your 2D game as usual, but render the final ...


7

To complete what Josh said, Convolution Matrix is what you want: Convolution in Gimp Another link What you probably are looking for: Convolution Kernels in OpenGL


7

It's a combination of full-screen effects. There are a few ways to render full-screen shader effects, the most common is to first render the scene (without effects) to texture. Then that texture and the effect shader is set and a fullscreen quad is rendered. The blurring in the corners could be done with a refraction effect. A refraction texture controls ...


5

Cel shading must be done at the pixel shader level to look proper, same as most other lighting. If you do it in the vertex shader, the cel shading edges will be along triangle edges rather than smoothed across the model's shape. Many existing games can likely be easily modded to use cel shading techniques, as you need to only replace some shaders and ...


5

Anti-aliasing in a deferred shader is a complex topic. WikiPedia lists a number of techniques for doing anti-aliasing in a deferred-compatible way. Typically you'll need to do it after lighting, otherwise you can end up with lighting artifacts. Most approaches I know of do another pass on the scene after the entire deferred pipeline is complete. If you ...


4

1) The planet is "cartoon" like because it doesn't use any textures and has a large detail size. 2) The misted effect I'd call atmospheric scattering. There's a GPU Gem about this: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html. Alternatively (or additionally), add a fresnel effect to your shader. Alternatively, I've seen people fake ...


3

There are a few broad approaches to generating a tesselated, spherical surface mesh. Here a couple of the more common ones... Construct a cube with densely-subdivided planes, then expand those planes outward into a spherical form: this is simple enough -- for each surface point, calculate a vector from the origin (centre of cube) to that point, normalize ...


3

It looks like TextureWidth is an integer. The line: float pixelWidth = 1/TextureWidth; will be calculated using integer arithmetic, and so long as TextureWidth > 1, the result will be zero. This means the line: blur.x = TextureCoordinate.x + Pixels[i] * pixelWidth; will be equivalent to: blur.x = TextureCoordinate.x; and you will end up ...


3

After doing some googling around, it appears that OpenGL ES 2 actually does support non-pow2 textures, but not (necessarily) with mipmaps or repeat wrap mode (source). Fortunately, for postprocessing you don't need mipmaps or repeat wrap mode, so you can size the textures to match the framebuffer exactly.


3

Here is a lot of tutorials on Post Processing.


2

In theory, you could use Shader Replacement to re-render your whole scene using shaders that offset the positions of everything slightly, and output with e.g. 25% alpha. So you'd render the scene normally, and then: Clear depth buffer Set shader replacement to offset everything 1px left and 25% alpha Render Clear depth buffer Set shader replacement to ...


2

A potential solution is to use a visualization technique involving the rendering of pathlines, streamlines and streaklines. You're interested in rendering pathlines. Unfortunately, I can't show you a picture of how to achieve this, but I'll explain it shortly: you need to keep track of the trajectory your sword or swinging object leaves behind. You ...


2

I'd say 2-3 passes is pretty normal. I suspect 4 is not uncommon. For vertex-lit games, 1-2. Usually just the albedo pass then some post effect or another. For pixel lit, 3+ is going to be the norm. 1st pass is g-buffer, z-buffer, surface normals and diffuse/albedo info as you describe it. Building blocks. 2nd pass we try to fit all other ops, but in ...


2

Usually each post processing effect has it own pass unless the effects are "organically" coupled and/or are simple. For example, to simulate an old film camera, you could put the grayscale, sepia, noise, scratch and vignetting effects all inside the same shader, since each effect is a simple part of the goal effect. On the other hand, some other effects have ...


2

Basicly, postprocessing might be a bad way of doing "night time". "Night time" consist of alot of diffrent aspects floating into one bigger picture. To get similar results to what happens in the image here is not a simple task. The light and shadows play a big part of this, aswell as the moonlight that they have. What you could achive with post processing ...


2

Yes it seems you do want a post processing effect. First Render your scene normally. Then sample this texture in your next Render technique but use a set alpha. something along the lines of: in vec2 Texcoord; out vec4 outColour; uniform sampler2D tex; void main() { outColour = texture( tex, Texcoord ); outColour += vec4( outcolour.rgb, 0.5f ); } ...


1

So after experimenting a little more with Intel GPA following Sean Middleditch's comment, I noticed that messing around with state changes, including sampler states, seemed to give me no improvement whatsoever. But sampler states got me thinking about texture formats, so I had another look at the DirectX documentation for a texture format that might be ...


1

You are missing a glDrawBuffers (...) call. You need to establish that color attachment 0 is the first buffer your fragment shader is going to output. This should fix your problem: glBindFramebuffer(GL_FRAMEBUFFER, _fbo); const GLenum draw_buffer = GL_COLOR_ATTACHMENT0; glDrawBuffers (1, &draw_buffer); //Draw Scene glBindFramebuffer(GL_FRAMEBUFFER, ...


1

My suggestion would be to use surfarrays in conjunction with NumPy. Assuming you already have an algorithm for the post-processing effects you want, all you'll have to do is port it into NumPy syntax, which will probably just take some tinkering. Examples of usage can be found here, here, here, and here. After manipulating the surface, you just have to ...


1

We had a chat conversation about it because it turned out out that there was a bigger problem than just an issue with the shader. Heres my summary: Multipass rendering using a single technique is very limited and it´s impossible to access the result of the first pass in the second. Inorder to get the first passes results you have to: render the first ...


1

Techniques like FXAA, MLAA etc. are normally applied almost at the very end of the graphics frame - after all lighting, postprocessing, color correction etc. is complete, but before rendering UI and text (because those normally already have sufficient antialiasing built in to their textures and don't need any more).


1

One idea I came up with but which isn't very satisfying is to have two image textures and automatically use them alternating. Also keeping track of which is the newer one to finally display it on the screen. This is actually the way it's commonly done, and the technique even has a name: "ping-ponging". There's some discussion on the technique here ...


1

You need at least two passes for deferred shading, the first to fill the G-Buffer and the second for the lights. After that you need at least another pass for effects, you would probably render the light result to another framebuffer and then render the effects on this framebuffer. You can use this third pass for all the effects, if you write a single shader ...


1

If you dont mind having little bit more expensive shader (but it has same number of texture fetches as sobel filter), you can implement frei-chen edge detector. It provides smoother image than sobel filter. Great article with example implementation: http://rastergrid.com/blog/2011/01/frei-chen-edge-detector/


1

You should only render to the area needed as in your example. To speed up rendering, look at using a scissor rectangle.


1

You are using the old, deprecated immediate mode for drawing your polygons (glBegin/glVertex/glEnd calls). This causes a huge performance impact because you fill up the draw call budget pretty quickly, and multiple synchronous flush commands must be sent to the GPU to draw the triangles. Just use vertex buffer objects for drawing your models and you will ...


1

The question is a bit ambiguous. Will it work? Sure it will. You can probably squeeze it down to one pass that traces against all lights, even though you use one pass per light. Can you add your lights to a list and do a post process batch where your lights are in a list? Will it look good? That's the problem. It's not really easy to answer and depend a lot ...



Only top voted, non community-wiki answers of a minimum length are eligible