Smudge Shader GLSL - glsl

So I was playing around with some shaders.
I have texture like this:
I was wondering if there is any way I can kinda "smudge" it something like this:
I tried with gaussian blur but the results were really bad. It only made black edges smoother, any ideas?

Related

How to apply displacement mapping with tessellation?

I'm feeling like I'm grasping at straws right now researching this!
My goal is to write a simple water shader. The plan is to use tessellation to implement dynamic LODs, and apply a height map based on fractal noise (ref this paper). Where I am stumbling is where we are supposed to apply the height map. It seems like it should be applied to the vertex shader, but the vertex shader precedes the tessellation shaders.
So I am looking to apply the displace vertices at the tessellation evaluation shader (OpenGL) using noise, is that the best way to go?
For the noise, I am planning on inputting the vertices positions to the noise function.
It is confusing to me because so far I have not found any examples on the web on the matter. I am seeing people people sampling in the tessellation shader, but I don't have a texture, only noise. I've also seen someone mention something about using a geometry shader to displace vertices. What's the widely accepted procedure here?
I'm wondering about the impacts of the performances and advice on whether I should think of generating noise texture and interpolating those instead.

openGL simple 2d light

I am making a simple pixel top-down game. And I want to add some simple lights there, but I don't know what the best way to do that. This image is an example of light what I want to realise.
http://imgur.com/a/PpYiR
When I googled that task, I saw only solutions for that kind of light.
https://www.youtube.com/watch?v=mVlYsGOkkyM
But I need to increase a brightness of the texture part when the light source is near. How can I do this if I am using textures with GL_QUADS without UV?
Ok, my response may not totally answer you question, but it will lead you down the right path.
It appears you are using immediate mode, this is now depreciated and changing to VBOs (vertex buffer objects) will make you life easier.
The lighting in the picture appears to be hand drawn. You cannot create that style of lighting exactly with even the best algorithm.
You really have two options to solve your problem, and both of them will require texture coordinates and shaders.
You could go with lightmaps, which use a pre generated texture multiplied over the texture of a quad. This is extremely fast, but requires some sort of tool to generate the lightmaps which might be a bit over your head at the moment.
Instead, learn shader based lighting. Many tutorials exist for 3d lighting but the principles remain the same for 2D.
Some Googling will get you the resources you need to implement shaders.
A basic distance based lighting algorithm will look like this:
GL_Color = texturecolor * 1.0/distance(light_position,world_position);
It multiplies the color of the texel by how far away the texel is from the light position. There are tutorials that go more into depth on this.
If you want to make the lighting look "retro" like in the first image,you can downsample the colors in a postprocesing step.

Creating Windows Vista Aurora screensaver like curtain effect in OpenGL

I am trying to create an interactive background animation using WebGL / Three.js
The animation would be generated from a two-color gradient
The animation would be controlled by external factors (intensity, speed, etc.)
The result should look something like this: https://www.youtube.com/watch?v=PdrkrCFRHWA
I am not sure how Vista managed to pull the effect and I am interested in possible techniques which would yield similar looking results. I am looking for pointers how to get started
Should I use alpha blended generated textures and dancing quads?
Should I use pixel shaders?
etc.
Any tips welcome.
I would use three.js and render a bunch of triangle strips and do the gradient effect itself on the fragment shader.
The effect looks rather simple enough to be wholly calculated inside the fragment shader directly, so a fullscreen quad would also work nicely. Depends really on the type of detail you are aiming for, I'd experiment with both.

Question on rendering grass using billboard texture

every one, i have been doing some work on rendering grass using billboard textures recent days, and i met some problems,
it looks not so bad when the camera'angle with xz plane is not big, but when the angle is bigger until the camera is on the top of the billboard, it looks very bad, a cross line just can be seen, and not like real grass.
so the problems are as follow:
1. could someone tell me how to fix this problem?(looks like cross)
2 what's more, i did not add light or other shader effect, so the result looks not real, and a more important factor is the texture i used is not good enough, could anyone provide some better texture? and teach me how to add light effect and shader effect?
Thanks a lot.
regards.
Use billboard grass in the distance, and real, or at least more detailed geometry up close.

GLSL object glowing

is it possible to create a GLSL shader to get any object to be surrounded by a glowing effect?
Let's say i have a 3d cube and if it's selected the cube should be surrounded by a blue glowing effect. Any hints?
Well there are several ways of doing this. If each object is also represented in a winged edge format then it is trivial to calculate the silhouette and then extrude it to generate a glow. This however is, very much, a CPU method.
For a GPU method you could try rendering to an offscreen buffer with the stencil set to increment. If you then perform a blur on the image (though only writing to pixels where the stencil is non zero) you will get a blur around the edge of the image which can then be drawn into the main scene with alpha blending. This is more a blur than a glow but it would be relatively easy to re-jig the brightness so that it renders a glow.
There are plenty of other methods too ... here are a couple of links for you to look through:
http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html
http://www.codeproject.com/KB/directx/stencilbufferglowspart1.aspx?display=Mobile
Have a hunt round on google because there is lots of information :)