Realtime Motion Blur

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Realtime Motion Blur // Roundtable

1  |  

Post by ivampretti // Jan 3, 2009, 2:21am

ivampretti
Total Posts: 151
pic
Hi folks, I was wondering if is there an way of do that a realtime render to file motion blur. I need that for a project but its not nescesary to see it play in realtime, just in the render to file motion blur, so if anyone know some technique how to do it, please let me know.


I was wondering to do that rendering to file with an enormous frame rate than later use some video editor to do the motion blur. But I dont know how to do it without do it frame by frame with an image editor. Somebody know a better way??

Post by nowherebrain // Jan 3, 2009, 6:39am

nowherebrain
Total Posts: 1062
pic
You can through a directX shader and render to texture, but I am not sure on the code...not much into shader programing...

I guess it could be accomplished by using a plane attached to the camera that renders the view to it's texture, apply an alpha blend to it and draw it late. Any shader guru's want to shed some light on this?

Post by parva // Jan 3, 2009, 8:34am

parva
Total Posts: 822
pic
motion blur is a postprocess effect so not possible yet in truespace.

I think also the best way is a video editing program.

Some of them have filters that add motion blur

or you do, like you said, render with less speed many more frames

and scale the speed later to a higher rate like 300% or alike.

Post by transient // Jan 3, 2009, 3:11pm

transient
Total Posts: 977
pic
Real-time dof would be very nice, too. I think you could do this in post by using Parva's Object Scene Depth shader on the objects in a separate pass.

Post by jamesmc // Jan 3, 2009, 5:19pm

jamesmc
Total Posts: 2566
Interesting article on motion blur in direct X 9.

http://msdn.microsoft.com/en-us/library/bb147206(VS.85).aspx

Post by ivampretti // Jan 3, 2009, 7:25pm

ivampretti
Total Posts: 151
pic
Well, after all the great comments, I think that a post process in a video editor would be the easy way. But I dont want to built an animated scene thinking in a frame rate like 90frames/s. I want to do a scene as usually at 24 - 30 frames/s and then stretch the all animation later. Then we could use an video editor to blur the extra frames and adjust the frame rate. Any Ideas for an stretch all animation with loads of clips and tracks?

Post by Asem // Jan 3, 2009, 8:48pm

Asem
Total Posts: 255
It would be possible if someone created a least a node that gave access to the framebuffer and MRT in which the sdk has to be used (if it was planned to be done through scripting) I think that it's the only thing missing that would give someone the ability to script it. Pretty much what caligari did by making a node that gave access to the render to texture.

Post by nowherebrain // Jan 4, 2009, 5:36pm

nowherebrain
Total Posts: 1062
pic
my way would work, but it would not include the first frame or so...and would slow the frame rate a bit.

Post by jamesmc // Jan 4, 2009, 6:40pm

jamesmc
Total Posts: 2566
This is not tS, but thought you or a developer may want to look how other software does it. (video)

http://www.facebook.com/video/video.php?v=1011438766906

Post by ivampretti // Jan 6, 2009, 2:55am

ivampretti
Total Posts: 151
pic
I was thinking and I have the algorithm for a postprocess motion blur, for using with the realtime render to file I would need to have access to control what frame It'll render, what I dont have any Idea of how to make it. But here is the algorithm:


number of passes: 4 for example

using half of frame to blur it!


> Render frame 1.00 with alpha set to 0.25;

> Render FRAME 1.17 same alpha 0.25 (0.5 / 3 = 0.17 half frame in 3 passes)

> Render Frame 1.33 again alpha 0.25

> Render Frame 1.5 alpha 0.25


Blend the four frames what will result in a no transparent frame


now we have the frame 1 with motion blur


the frame 2 is similar!


> Render frame 2.00 with alpha set to 0.25;

> Render FRAME 2.17 same alpha 0.25 (0.5 / 3 = 0.17 half frame in 3 passes)

> Render Frame 2.33 again alpha 0.25

> Render Frame 2.5 alpha 0.25


This is not possible even by hand because the render to file dont allow us to render a fractionary frame :(


If somebody help I could implement this, but I dont know how to do it, I dont have acess of what frame the realtime render to file will render!

Post by ivampretti // Jan 7, 2009, 6:06am

ivampretti
Total Posts: 151
pic
Im almost there, I just need to figure out how to export a bitmap from a Jscript Command! If you get the bimap atributte, there is a command save to file that I don know what variable it is asking for.


Bitmap.savetofile(var,str);


Thats the command, str I guess is the string of the location in the HD like "C:\MyDocuments". But this evil var :mad: I dont know what it is asking for, does anybody know that?

Post by prodigy // Jan 7, 2009, 6:11am

prodigy
Total Posts: 3029
pic
D3DView.RenderToFile('', '') ??

Post by ivampretti // Jan 7, 2009, 6:37am

ivampretti
Total Posts: 151
pic
I dont know this D3DView.RenderToFile('', '') Prodigy, but seems nice. What are the arguments?

Post by prodigy // Jan 7, 2009, 7:24am

prodigy
Total Posts: 3029
pic
don't know either :p

I do some experiments with but without success... :confused:

Post by Délé // Jan 7, 2009, 9:13am

Délé
Total Posts: 1374
pic
Try this:

D3DView.RenderToFile('','auto');


I got that from Johny's cloth render script. Might want to check it out. I don't know how Johny figures all this stuff out, but I'm glad he does. :)


http://forums1.caligari.com/truespace/showthread.php?t=6043

Post by frootee // Jan 7, 2009, 9:21am

frootee
Total Posts: 2667
pic
This is described in the SDK documentation.


The first parameter is the WinID for which the rendering is performed. Leave it blank, and the current selected window is rendered. That's the simplest approach anyway. :D


HRESULT IRiView3D::RenderToFile ( [in] VARIANT bsWinID,

[in] VARIANT bsMode

)


Render given D3D view to file.


Parameters:

bsWinID specifies the WinID for which the rendering is performed.

bsMode specifies the mode of the rendering ('auto' for immediate screen-shot using latest settings, empty string for settings dialog)

Post by prodigy // Jan 7, 2009, 9:28am

prodigy
Total Posts: 3029
pic
And here another way for Vray..

//Render what you see
function Execute(params)
{
OfflineRender.OpenView('',0,0);OfflineRender.Rende rScene('')
}

//Render Animation
OfflineRender.OpenView('',0,0);OfflineRender.Rende rAnimation('')

//Render Object
OfflineRender.OpenView('',0,0);OfflineRender.Rende rObject('')

Post by ivampretti // Jan 7, 2009, 4:11pm

ivampretti
Total Posts: 151
pic
Thanks folks, I had to go to some where but now Im back! I'll try this and post the result or another question :D

Post by ivampretti // Jan 7, 2009, 6:03pm

ivampretti
Total Posts: 151
pic
Ok here it comes. I tried the D3DView thing and there is a enormous problem to make the motion blur thing. D3DView.RenderToFile('','auto') just uses the render to file engine, is just like you press the button set the settings and press render button. Then we dont have access to render an fractionary frame to build the motion blur.


So I have an Idea to use the Render to Texture Scene. I just have to know how the "Maldito Infeliz Miseravel" SaveToFile(var, Str) of the "Common Data Package\Bitmap Data". Becase then we could use the especial camera to render it and save the texture (View) as a bitmap file to play with it!

But no, the evil SaveToFile command have to ask for a var that is not specified in the SDk docs :mad::mad::mad: Anybody??

Post by ivampretti // Jan 8, 2009, 2:04pm

ivampretti
Total Posts: 151
pic
you got scared because of my moments of frustration? sorry, I was talking to the TS documentation, didnt want to be rude. Come Back Please I need you guys :D That question is killing me!:rolleyes:


I wont bite you, promess! :D:D
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn