Hot answers tagged

18

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 ...


15

To get that authentic inky look, your best bet is probably to assemble a library of images of ink splats, streaks, and dribbles. Then you can randomly select some number of them to position & rotate randomly over one-half the image. (With a bias toward the seam edge so the middle of the Rorschach test is densest. You might be able to use a particle ...


8

You can try perlin noise (using a proper black/white gradient) , and then apply the right/left mirroring


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 ...


5

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 ...


5

Welcome to the tutorial to discooridnated chromatic effect. The above is an example of screen distortion. It is necessary to understand the first type of screen distortion in order to understand the final effect listed second. It is achieved by having screen coordinate texture then applying the altered screen coordinate when rendering the final scene. ...


4

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 ...


4

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

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 ...


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

Here is a lot of tutorials on Post Processing.


3

Coming from a graphic design background, one solution I usually use for making blurry images appear sharper is to overlay noise. Of course, adding random noise does not look good. The noise must be relevant to the underlying material. The classic case is making a material look weathered in Photoshop by using grunge textures and setting their layers to ...


3

This is a pixelation shader, it seems. What it does is, it divides the screen into tiny rectangles, the side of each rectangle is determined by the values dx and dy. The smaller the value of Pixels, the more pixelated the screan is, as that increases the size of dx and dy and thus the size of the rectangles. The shader, after deciding the dimensions of the ...


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

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 ...


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 ); } ...


2

Simple lens shader that uses object's normals to distort the background. Render texture without this object, use it as "ScreenMapSampler" and then render all scene including this object in final frame. Not best implementation, but it works. struct PS_OUTPUT{float4 Color : COLOR0;}; struct VS_Lens { float4 Position: POSITION; float4 ScreenMapSamplingPos:...


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

Two things others didn't mention: The ripples in the water surface are made by Bump-mapping, where you use a texture to add fake depth to your objects(a.k.a. Normal mapping). You could even animate this with noise, so you don't need a texture, just GLSL noise generation.(Quite simple and awesome effect) The very subtle "fog" around the planet might be a ...


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 (look ...


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

I used this solution to make a water distortion effect. You could use the sin waves vertically instead of horizontally to possibly achieve your effect. I draw what might get distorted onto a FrameBuffer. I make regions of the buffer texture that will be redrawn with a distortion shader applied. GdxGame.java void create(){ scaleX = Gdx.graphics....



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