Jump to content
  • Advertisement
Sign in to follow this  
Bobby_D

GLSL enthusiast needs help

This topic is 4171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all: I could use a help with GLSL shaders I'm making for my school project I'm working on with five other guys. Here's some basics about my situation: Our project is a windows based application. I have some basic experience with Ogl, and knowledge of GLSL. I have the GLSL orange book, the third ed. of the super bible, and some power points on motion blur from the internet. I'm looking to make a few shaders for our project, one of which is a motion blur vert/frag shader for our game. There is a lot of information on-line, but it's mostly theory on how one way should be used over another, with no specific GLSL examples that help explain both the shader-side, as well as the setup needed on the app-side. I have no idea how to find the previous frames transform, and I am not sure how to save the video buffer to a texture, than send that texture to the the shader as a 2Dsampler. These may not even be the best ways of creating motion blur. I'm not looking for a handout here, just some explanations so I can become a better developer. Anyone that has knowledge on this topic, knows of any books on the subject, or can point me to a good website, please hit me back with your take on this. Thank you for your time. Peace. [Edited by - Bobby_D on July 11, 2007 8:24:08 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Bobby_D
I have no idea how to find the previous frames transform
You obviously don't have to figure this out. The previous frame, this information was known. Just track your MVP!
Quote:
Original post by Bobby_D
and I am not sure how to save the video buffer to a texture, than send that texture to the the shader as a 2Dsampler.
You must look at EXT_framebuffer_object. For cheap motion blur you don't even need that: it just takes to copy the previous buffer to a texture. Then, just bind it and here you are.
For really cutting edge motion blur you need geometry shaders... but I guess this is overkill.

Share this post


Link to post
Share on other sites
how would such geometrie shader look like? I mean theoretically, what would it do?

Would that be vertex shaders that actually deform something while taking a speed-uniform into account or something? I don´t really want to create such things now but i´d find it very interessting to know.

Share this post


Link to post
Share on other sites
Quote:
Original post by GreyHound
how would such geometrie shader look like? I mean theoretically, what would it do?
Pratically, there's a sample in the D3D10 SDK. ;)
Use the force!
Quote:
Original post by GreyHound
Would that be vertex shaders that actually deform something while taking a speed-uniform into account or something?
By tracking the state of this and previous frame the GS gets access to two meshes. Then, say there's a tri, it can extract the speed vector and extrude an edge. I don't know if the VS does something: if it does, it probably doesn't matter.
I guess it isn't much different from shadow volumes.

Share this post


Link to post
Share on other sites
Hey Krohm:
MVP = Modelview Matrix?

Would you mind going into a little more depth for your explanation? Thank you.

Share this post


Link to post
Share on other sites
For basic (but effective and pretty good-looking) motion blur, you don't need shaders. FBO's will do and you implement them with the extension mentioned earlier - EXT_framebuffer_object. Just create a circular list of FBO textures and each frame, overwrite the oldest one. Then render the buffers, in chronological order, over each other with increasing alpha channel.

If you want to get rid of the "edges" that the above method creates, blur the old buffers. I suppose the blurring could/should be implemented in a fragshader.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!