18th March 2003 12:22 UTC
my first raytrace preset :)
I posted this yesterday but it seems I didnt put it in the right place ;). So I post it here again. I changed the name of the preset, everithing else is he same.
Archive: my first raytrace preset :)
fsk
18th March 2003 12:22 UTC
my first raytrace preset :)
I posted this yesterday but it seems I didnt put it in the right place ;). So I post it here again. I changed the name of the preset, everithing else is he same.
UnConeD
18th March 2003 13:54 UTC
Haha this effect rules!
Though I would remove the front wall and let the ceiling/floor continue because it looks a bit weird when the light shines at the wall in front of the camera. If I were you I'd add some more patterns to the light (like non-square ones by blacking out some rays) and add a few more spheres floating around. The first time it crossed the beams I thought it was a bug. Or make the sphere larger.
It looks pretty awesome when you add alternating high radius/low radius blurs w/ convolution to equalize the dots (see here)
By the way, is there any reason why the camera is not moving? If you're raytracing, what is keeping you from having the camera move around?
Some optimization tricks... replace:
Det=-sqr(vb)+4*va*vc;
k51=(-vb+sqrt(Det))/(2*va);
k52=(-vb-sqrt(Det))/(2*va);
...
....if(below(Det,0), ...
with:
Det=-sqr(vb)+4*va*vc;
alpha=below(Det,0);Det=sqrt(Det);
va=.5/va;
k51=(-vb+Det)*va;
k52=(-vb-Det)*va;
...
...if(alpha,
(sqrt is a slow operation)
Oh and 'sqr(.5)' can be replaced by a constant too :). I'm not sure why dz=1.3/15 would be faster, but I think it's because of random fluctuations. Remember that depending on the position of the camera, AVS has to draw more and longer lines, so the speed can vary a lot during the preset. I think you got the wrong impression because of this.
Also, I think it wouldn't be very noticable if you didn't raytrace the sphere in the volumetric beams scope, and it would be slightly faster. Oh and you need to make it so it is already moving at the beginning... a common mistake which makes the preset weirder on slow songs :).
Now of course for the ultimate effect, you need to add a discoball on the ceiling that reflects the rays correctly... :rolleyes: just kidding (though reflections aren't *that* difficult actually), this is an awesome effect!
Jaak
18th March 2003 13:58 UTC
Really neato effecto... this is really good.
Raz
18th March 2003 15:58 UTC
wow, sweet effect, now that is nice. love that realistic shine when the projector thing points towards you. really nice job :up:
UnConeD
18th March 2003 17:32 UTC
By the way, any reason you're using:
k5=if(below(min(k51,k52),0),max(k51,k52),min(k51,k52));;
and not
k5 = k52
and thus
k5 = (-vb-sqrt(Det))/(2*va) ?
Because of the way you calculate the quadratic equation (va always positive), -vb-sqrt(Det) will always be the positive intersection closest to the camera as far as I know, so you don't need to check for that explicitly.
UnConeD
18th March 2003 17:44 UTC
And finally, if you replace:
dx1=(3+ox)/(dx3);
dx1=if(below(dx1,0),-dx1,(3-ox)/(dx3));
with
dx1=(3/pp+ox)/(dx3);
dx1=if(below(dx1,0),-dx1,(3/pp-ox)/(dx3));
Then your box won't have black edges on the sides, but the rotation will not look squashed :).
You seem to have missed a lot of common optimizations though. Don't divide by a constant, always multiply by its inverse (instead of x/2, use x*.5).
Also instead of:
x=dx/(1+(dz+8)/3)*pp;
y=dy/(1+(dz+8)/3);
use:
dz=1/(3.6666+dz*.3333);
x=dx*pp*dz;y=dy*dz;
Multiplications are a lot faster than divisions, and doing a calculation once instead of twice is faster too.
fsk
18th March 2003 18:24 UTC
There two reasons for me not using all the improvements that you pointed out. The first is me not knowing enough about programing and math:),and the second one is the preset is not realy finnshed yet,I usualy edit the presets before the finnal publish in a pack and thats when I get rid of the devideing by the constants thing). I said this before and I'll say it again, I really had no programing experience before AVS, I got my comuter 3 years ago and started playing with avs about two years ago. At the time I couldnt even understand the examples in the SSC:D. I'm slowly geting there and Im loveing it. Thanks for pointing them out I REALLY apreciate it, I'll aplly all of them before the finnal realease and when codeing in the future:).
dirkdeftly
18th March 2003 20:16 UTC
Wow...wow. The camera should move (the central one as well as the user's), and there should be more balls...and the balls should be translucent, as well as the walls.....
...but dayamn...
anubis2003
18th March 2003 20:45 UTC
That is a nice preset. I agree that it does need more balls.
dirkdeftly
18th March 2003 22:14 UTC
haha...your preset doesn't have enough balls
...nevermind
Phaze1987
18th March 2003 22:54 UTC
damn you are sick...fsk good preset,a bit too dynamic but nice :)
hungryskull
18th March 2003 23:36 UTC
Nice preset!
:up:
Shock Value
18th March 2003 23:54 UTC
Wow, that's an awesome effect, especially considering it's your first experience with raytracing. I'm gonna have to learn that stuff one of these days.
Nic01
19th March 2003 00:46 UTC
Wowowowowow
The balls look like little lumps caused by coding mistakes to me though o_O
dirkdeftly
19th March 2003 01:59 UTC
btw...those balls should bounce off the walls, and you shouldn't be able to see through them - esp. when the light shines on them from behind.
shreyas_potnis
19th March 2003 05:43 UTC
what i want to say is already said.....by so many people.
*sigh (why cant I be on the net at the right time ) *
Tuggummi
19th March 2003 07:16 UTC
When i heard the word "raytracing" i was in the impression that it was a dm :(
Oh well, nice work. Tech freaks are in heaven i assume, but i didn't get that much out of it...
Warrior of the Light
19th March 2003 20:57 UTC
[just what shreyas_potnis said]
Dude, this is really original...
fsk
20th March 2003 12:37 UTC
Thats funny Atero:D.
Tugg This is not really far away from a dm, actually its the same code just squezzed between a SSC grid and another projection, its like looking at a 3dDM from outside and at the end where the mapping usualy comes you calculate color valeues. You could easyly simulate a lamp and use the rays coordinates to calculate the texture(that would be static on the walls).I tried different stuff but this one had the best idea behind it :). You can make cool objects this way to.
More balls and cool stuf = les FPS:P
anubis2003
20th March 2003 12:38 UTC
That's fine. The FPS can still drop a little. Add 2 more balls or something.
Pixelcraft
28th March 2003 14:44 UTC
Cool
Raytracing has to be one of the hardest things to do with AVS, but you pulled it off! :up:
BTW: your avatar rules:)
moltarx
28th March 2003 21:02 UTC
that is so awesome :)
at first, i couldnt tell what the hell it was doing, but after i watched it for a little... it was so incredible :)
very very excellent job ^_^
AVS Axer
30th March 2003 08:46 UTC
wowzaaz..
this is about as cool a ssc as i have ever seen.
even the pattern on the dot grid is insane..
fsk-the ideas man..
AVS Axer
31st March 2003 06:13 UTC
sorry for double posting, but its to late to edit..
Youre code is very nice fsk. Very user friendly.. i cant find anything wrong with it that ucd hasnt pointed out..
though there are lots of optimisation thingys..
there is no reason why the volumetric beams should be that complex..
i tryed to add more spheres, but i hit the var limit.
heres a version with a solid sphere..
its not optimised yet though.. so its even slower than the orig.
cant wait till you next pack man.. it will be something special..
can we have another zvezda-ish scope perhaps?? i love that preset.
NemoOrange
4th April 2003 06:23 UTC
holy crap, that is stunning. Too bad the FPS are so low its not even worth using as a visualization. but keep working on it. only good things can happen.
NemoOrange
4th April 2003 06:25 UTC
I take that back. FPS are kinda low, but not too bad. keep working on this one.
jheriko
6th April 2003 14:37 UTC
59.1fps @ 400x300
19.0fps @ 1280x1024 fullscreen w/pd
This is faster than most of my presets.
AVS Axer
6th April 2003 15:09 UTC
this sort of wuestion always seems to piss people of on this board, but here goes:
where can i find the rest of your packs fsk?
i have pdm3.
i have searched the forums and the wa3 site.
jheriko
6th April 2003 15:20 UTC
Try using deviantart I got pickin dim 2 from there. winamp.com is pretty weak for AVS because it is flooded with noob packs and because the serious artists tend only to release their major releases there.
Take a look at all of the artists that you like there, you will probably find a lot of amazing AVS presets that you won't see anywhere else. For instance... on winamp.com I haven't published anything since J7, yet at deviantart I have about 7 or 8 newer presets.
Also if you are serious about AVS you should get an account there because you will get *real* feedback (a decent amount of useful comments) from actual AVS artists there. Also you will get to see the AVS packs first, usually before they turn up on winamp.com
AVS Axer
6th April 2003 15:27 UTC
hm.. i used to have an account there when i was into pixel art..
im actually looking at your page at deviant now jheriko.
jheriko
6th April 2003 15:33 UTC
Its always good to look at my page. :p
Its better to download my presets. :D
(NOTE: A dominating factor in my personality is self-plugging, I need publicity god dammit!)
Fork me on GitHub