Author Topic: motion blur  (Read 1555 times)

/title it can work on miniamum to

This would be nice, and I think it can be done as an Add-On. If not, oh well.

would it be possible to have vigentte motion blur? if player is going x speed vigentte level is set x high for effect?


this would be cool, should not be hard (i assume) to make anyway, could even be a simple client add-on

this would be cool, should not be hard (i assume) to make anyway, could even be a simple client add-on

would it be able to detect how fast the camera is moving

would it be able to detect how fast the camera is moving
it would most likely be a server-sided check that tells the client what to do

Would motion blur be possible through shaders?

Would motion blur be possible through shaders?

Not yet.

would it be possible to have vigentte motion blur? if player is going x speed vigentte level is set x high for effect?

Easily.


heres code
Code: [Select]
uniform sampler2D tex;
uniform sampler2D tex2;
uniform mat4 PrevMatrix;
varying vec2 vTexCoord;
 
void main(void)
{
vec4 color = texture2D(tex, vTexCoord);
vec4 zOverW = texture2D(tex2, vTexCoord);
// H is the viewport position at this pixel in the range -1 to 1.
vec4 H = vec4(vTexCoord.x * 2 - 1, (1 - vTexCoord.y) * 2 - 1, zOverW.g, 1);
// Transform by the view-projection inverse.
vec4 D = gl_ModelViewProjectionMatrixInverse * H;
// Divide by w to get the world position.
vec4 worldPos = D / vec4(D.w);
 
// Current viewport position
vec4 currentPos = H;
// Use the world position, and transform by the previous view-projection matrix.
vec4 previousPos = PrevMatrix * worldpos;
// Convert to nonhomogeneous points [-1,1] by dividing by w.
previousPos = previousPos / vec4(previousPos.w);
// Use this frame's position and last frame's to compute the pixel velocity.
vec2 velocity = vec2(currentPos.xy - previousPos.xy)/2.0;
//velocity = (velocity + 1.0 ) / 2.0;
 
gl_FragColor = vec4(velocity.x, velocity.y, color.g, 1.0);
}

heres code
Code: [Select]
...

Nope, that doesn't compile in the scope that Blockland provides.