PDA

View Full Version : Help with saber effects


Grey Raven
04-11-2006, 07:00 PM
Not long ago, I noticed a post in which the member requested that the saber fanning effect from MBII be implemented in OJP, and, unfortunately, Razorace declined due to time restrictions.

Ever since I first tried MBII and was completely awe-struck, I've been trying to emulate a similar effect for a mod I'm currently working on. Because of that post, I figured I might try my hand at cleaning up my own version of the effect and submitting it to Razorace for implementation in OJP, in grateful appreciation of the brilliant work he and the other members of the OJP team have done for the JKA community.

But I've run into a problem. So far, I have all the shaders and jpgs ready, and a working version of my code. There's only one snag: while the effect looks pretty good during gameplay, it completely disappears from the screen when the esc button is pressed, and promptly returns when the gameplay resumes.

This problem is mainly directed at Razorace. Razor, I can only conclude that the problem lies in the fact that I'm not accessing the vector position info for the previous frame. But I'm very confused, as I have made dozens of test runs with various variable access changes, but still no dice. What further frustrates me is that the trap_R_AddPrimitive() function maintains the image of the saber trail even when the game is "paused", and the current frame is static, yet when I use the fx info for the positions of the edge, cap and base, the result is the "hide-and-seek" fanning I've been getting.

Is there anyway I can access the old saber position data so that can render that g*dd*mn edge effect when the current frame is held static? Why does the primitive stay rendered, but the blade not be, even when their positions are based off of the same fx variable?

razorace
04-11-2006, 11:00 PM
Try looking at the saber trail code. It's gotta know the previous positions. Sorry I can't be more specific without the time to look over everything.

As for the code used in MB2, I think they used the AJL's SFX saber system. I have the source code for it if you're interested. The hard part is going to be intergrating it in with OJP's RGB saber system that already exists.

Grey Raven
04-12-2006, 08:19 PM
You needn't apologize; I'm in college too, and can sympathize.

I tried the saberTrail->base,tip stuff, but CG_AddSaberBlade always resets the vectors to their lerped positions before actually rendering the blade effect. I'll keep working on it when I can, and as soon as I get a clean version of the working code I'll send it to you for your opinion. I'm not tryin' to beat a dead horse or plagiarize your hard work, I just really can't stand that ugly "ribbon-trail" fanning from base JKA. It peeves me. :barf2:

Vruki Salet
04-12-2006, 10:45 PM
Do you have a screenshot of the effect you want to see? I'd like to see it.

Grey Raven
04-13-2006, 09:30 PM
I've been going crazy tryin' to find a way to do it, so the code is kinda hacked to pieces right now, and I have alot of school work to do over the weekend (ugh!), but I'll throw some code around and get you the screenies by Monday.

Vruki Salet
04-13-2006, 10:01 PM
OK thanks.

Grey Raven
04-17-2006, 07:29 PM
Do you have a screenshot of the effect you want to see? I'd like to see it.
How're these:

http://www.picfury.com/r/shot0002-3-th.jpg (http://www.picfury.com/r/shot0002-3.html)
http://www.picfury.com/galleries/ImageGallery-14565.html
http://www.picfury.com/galleries/ImageGallery-14569.html


BTW: Thanks for that code, Razor.:thmbup1:

Vruki Salet
04-17-2006, 09:16 PM
Sorry I don't get what I'm looking at. What's special about these sabers or trails?

Grey Raven
04-17-2006, 09:30 PM
The idea is to make them look more movie-like. With the old sabers, the trail looked like a flat ribbon, which, as far the render goes, it was. This effect basically renders a blade on all the edges of the trail, so that no matter from what angle you view it, it looks like a solid trail. It also renders the glow better.