Is There Any Realistic Motion Blur Shader Like In Crysis 2 Or Battle Field 3
I Know That Blender Already Have Motion Blur Filter 2D,But It Only Duplicate And Fade The Frame,It Just Look Unrealistic
Is There Any Realistic Motion Blur Shader Like In Crysis 2 Or Battle Field 3
I Know That Blender Already Have Motion Blur Filter 2D,But It Only Duplicate And Fade The Frame,It Just Look Unrealistic
The creating of the shader is quite doable, the actual name of the technique your looking for is per pixel motion blur (or per object motion blur) here is a page that describes how this technique works and provides code examples which could be ported to blender with some pre-requisite knowledge:
because my knowledge of glsl code is limited I can’t help you with porting the shader over to blender, but I hope you are able to use the info on getting it to work
Cool,But Even In Python Scripting My Klowledge Is Limited And I Always Forgot the code
Hmmmm…I Think I’ll Just Wait For Martinsh To Do it
Wow that is awesome, I wonder how this would look as a finished script! I will definitely take a more deeper look at this for my ongoing learning of python!
GLSL Shaders are not written in python, but are written in GLSL, which is a derivative of some other language (I think I heard C?)
I am confused, why does this page describe creating a glsl shader in python? http://en.wikibooks.org/wiki/GLSL_Programming/Blender/Minimal_Shader
The GLSL code is stored in Python Strings and executed through Python. It has to be done this way if you want to add custom shaders to objects and meshes.
Ok, thanks for clarifying. When I said “learning python” I was referring to everything done in the text editor useful for BGE.
Anyhow, back to topic.
======
Someone have an idea how thisor thiswould look as a python script in BGE? I am not sure if they are even possible, I will dig deeper, but it would be nice to see this translated to BGE, I would learn alot!
Those would probably be made as a 2D filter (post-processing filter), which normally would be pure GLSL code. This GLSL code is what the 2D filter actuator runs. Some 2D filters uses python scripts to gather data, as for instance a sunshafts filter could use python to get the suns position on screen. The sun position can be stored in the properties of the object with the 2D filter actuator, and accessed through uniform variables in the GLSL code.
Although, I tested out the default motion blur 2d filter, and I do not see how it works any different from the filter in the link. Objects that move blur, and objects that stand still are crisp clear. Would this glsl shader be any diffrent from the motion blur we already have?
You won’t be able to implement that filter without changes to the BGE itself. That filter relies on generating a texture that represents the velocity of each pixel between 2 frames. I’m not sure if the you can currently get the BGE to render a pass that will output that data.
To be clear, I don’t think you could implement this as a pure GLSL “2D filter” in the BGE. I think you would have to make some C++ changes to Blender itself to get the velocity data to the 2D filter.
1.) What about using the existing motion blur filter, but at least center the blur? At the moment the BGE motion blur is the left “bad” version. Since it is just superimposing transparent past frames. I call it the “drunk” blur filter. EDIT: And the bge filter does not actually blur the frames either, does it? only makes them transparent?
2.) And can´t we implement this screen space technique as a 2dfilter? Or do we have the same problem with the “blur vector” as the “velocity vector”?