|
Re: Cheap, Faked Motion Blur (Pro Edition)
[Re: XNASorcerer]
#78715
07/03/06 13:31
07/03/06 13:31
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
Hmmm, guys I'm having a bit trouble figuring out how to properly set this up. I've added all the code and added the 'If' loop that evaluates the panel's alpha too. (inside the while loop of the camera). However it gives me a transparent blue on top of my screen, but no blur or not big enough to see. What do I do wrong?? The code is basically the same..  Cheers
|
|
|
Re: Cheap, Faked Motion Blur (Pro Edition)
[Re: PHeMoX]
#78716
07/03/06 15:10
07/03/06 15:10
|
Joined: Jun 2005
Posts: 656
Grafton
User
|
User
Joined: Jun 2005
Posts: 656
|
Could it be that the tga bitmap isnt the same size as the resolution you are using? Try including this blur script, an toggle it with the B key; Code:
//================================================== // motion_blur.wdl //================================================== // Create a blank black (rgb = 7,7,7) bitmap the same size as the screen resolution to render to: bmap bitmap_motion_blur="bitmap_motion_blur.tga"; // This is the panel that contains that bitmap: panel panel_motion_blur { bmap = bitmap_motion_blur; layer = -1; flags = transparent, filter; pos_x = 0; pos_y = 0; } var motion_blur; // This essentially sets the transparency (alpha value) of our view at 100fps. Call with values of 0..100: function set_motion_blur(newval) { motion_blur=newval;
if(newval==0) { // No blur; shut off the panel: while(panel_motion_blur.alpha < 100) { panel_motion_blur.alpha += 3*time_step; wait(1); } panel_motion_blur.visible=0; camera.bmap = 0; } else { // Blur is positive: panel_motion_blur.visible=1; camera.bmap = bitmap_motion_blur; } } starter mot_blur() { while(1) { if(motion_blur) { panel_motion_blur.alpha = 100 - pow( ((100-motion_blur)/100), (time/0.16) )*100 ; } wait(1); } } var blur_value; function toggle_blur { if( blur_value > 0){ blur_value = 0;} else{blur_value = 18;} set_motion_blur(blur_value);//higher = less blur } on_b = toggle_blur;
Not two, not one.
|
|
|
Re: Cheap, Faked Motion Blur (Pro Edition)
[Re: Ichiro]
#78718
07/03/06 16:08
07/03/06 16:08
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
Nope, that's not it eiher, my resolution is 1024x768 ... Could this be the effect of an update gone wrong somehow? The refraction shader of Oliver2, originally released in time of A6.31 and off course for A6pro only, works great here. Also a render-to-texture something, albeit with a shader. I'm not sure if this shader is supposed to still work with A6.40.5 pro, but it does work here. Do you guys use a skycube or something else as a background? It's remarkable that my background color is 0,0,0 (which shows as blue) and the color that panel looks like is also blue-ish. Take a look at this screenshot:  This time I've totally replaced the code with the one Josiah gave, Edit: Quote:
If the view doesn't move, but the blue overlay does, then that's the culprit.
I've added a line that changes the pos_x to -300, but it moved the entire view and on the right there's even more blue visible (fully opague that is :S ),
Edit2: When I try to render the panel none-transparent it doesn't show, so this must mean it doesn't get written at all, just like you thought Ichiro. :s I really wonder how on earth I could fix this though, 
Cheers
Last edited by PHeMoX; 07/03/06 16:24.
|
|
|
Re: Cheap, Faked Motion Blur (Pro Edition)
[Re: Ichiro]
#78720
07/03/06 16:58
07/03/06 16:58
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
It's getting weirder, because I've just managed to get your other code field depth vision to work.  I did changed the layers (from -1,-2 to 19 and 20), but it can't possible be that since it gave a blue layer on top. I've also changed the tga file a few times, even tried stuff with colored tgas, saved as 24bit. I also added a hollow cube around my level, but I guess I could take that one away again. Anyways, it must be something I did wrong at some point with this code, or render-to-texture started working properly again somehow, because I got depth field vision working now, I guess all I have to do is strip this code down to get the motion blur,  Cheers
Last edited by PHeMoX; 07/03/06 17:01.
|
|
|
Re: Cheap, Faked Motion Blur (Pro Edition)
[Re: EdMercer]
#78722
07/03/06 22:18
07/03/06 22:18
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
Yeah, I think I know what you're talking about, I'm not using any shaders yet in the screen I've posted to get the effect though, however in my code there are shader codes.
That might very well explain some of the odd behavior, even if they are not active. Did you mean this? The effect itself as shown on the screenshot doesn't use a shader atm. I'm planning to change that though and add a shader, we'll see what happens then.
I have to add to the incompatibility issue by the way, that sometimes my stencil shadows dissappeared too .. it must be something out there that's causing all this, I swear the upper screenshot has exactly the same code as Ichiro first posted, so it's definately not the code. It might have got to do something with render-to-texture, maybe this isn't as stable and consistent as we all expect it to be?
Cheers
|
|
|
|