Author Topic: Realtime Ray Tracing in Freebasic  (Read 49314 times)

0 Members and 1 Guest are viewing this topic.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #40 on: March 27, 2007 »
Doesn't look bad!

Yeah I think a bit more speed is possible with more code on the algorithm...it seems like about 50% of your pixels are being traced, when usually I get around 20%.
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Realtime Ray Tracing in Freebasic
« Reply #41 on: March 27, 2007 »
Voltage, id say that if you can at least double the speed of the tracer as you say you can then you can have some more karma to go with the karma I'm giving you now.

The lighting looks really great, you have your plane in there too, just fabulous really and you posted your source too. wow!

Top quality stuff and when you have finished the optimisations, it will be even better to convert it over to tinyptc, sure the optimisation won't be as dramatic as what you've done so far, but it will still be significant enough to do it :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Realtime Ray Tracing in Freebasic
« Reply #42 on: March 27, 2007 »
Thats looking real nice man, You got my respect. I can only imagine how much work was involved in gettin to a stage where you felt confident enough to take on a project like this all by yourself
  :cheers:

Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #43 on: March 27, 2007 »
Nice one Voltage, looks like you've got further with this than i did. There is a slight bug there, on the floor plane one of the spheres only seems to be casting half a shadow, maybe only on to one triangle.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #44 on: March 28, 2007 »
Got my first preview working :)

Give me 5 minutes and I'll have it up here.
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #45 on: March 28, 2007 »
Here it is, my C++ preview.

I'm going to recode alot of the engine's inner workings for more speed, because I can :)

Right now that's 24 spheres, all with specular lighting and shadows.

DO NOT RUN FULLSCREEN!!! I have yet to fix problems with it.

Also probably some errors with changing resolution. I don't care right now and won't until the tracer's as fast as I want it :P
« Last Edit: March 28, 2007 by Thygrion »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #46 on: March 28, 2007 »
Hooah!   :goodpost: Looks great mate, I'm gonna have to try mine with 24 spheres at 320x200.

This thread is fast becoming the RTRT mecca.

I have mine down to casting 30% of the total rays, and I have found that a 6x6 sub sample works best (ie least number of rays needed).... although I'm not sub dividing my sub samples.

I will add reflections and post something up today.

@Stonemonkey: Shadow bug fixed.  Thanks mate.

@Rain_Storm: Thanks, years of hair pulling.  31 now - 8 when I started programming = 23 years hobbist programmer :)  Sad, very sad.

@Shockwave:  Thanks for the comments and karma.  What is karma? (in relation to this forum)
Challenge Trophies Won:

Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #47 on: March 28, 2007 »
Here is a comparable (kinda) one to Thygrion's earlier posted raytracer....

Same resolution, same number of spheres, same effects.

Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #48 on: March 28, 2007 »
Lookin good!

And just so you know (not that I think you don't, I'm just clarifying ;) ) I'm not competing with you - I'm competing with my old raytracers and posting my code to help you and/or anyone else who reads this thread.
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #49 on: March 28, 2007 »
This is not realtime, it takes ages but I thought I'd post the code anyway as there might be something useful in it somewhere. I did make an attempt at realtime but can't find it anywhere and might've lost it with my HD failure a while back.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #50 on: March 28, 2007 »
Worth the wait for the render :)

Lovely stonemonkey!
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #51 on: March 28, 2007 »
Thanks Thygrion.

This is annoying, I've found an exe of my realtime effort but still no source. I hadn't heard of or thought of subdivision at the time so there's nothing like that in it.

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #52 on: March 28, 2007 »
I really like these ray tracers and my thought when i did my raycaster was to go on to one of these but to much work for me ;::(

So GOOD work voltage and Stonemonkey
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Realtime Ray Tracing in Freebasic
« Reply #53 on: March 28, 2007 »
Stonemonkey, I was not prepared for the quality of that image, it looks simply excellent. Thygrion, that looks wonderful! I was surprised at the nice speed of it! Voltage, ditto, and it's great to see a basic language being pused to produce things like this.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #54 on: March 28, 2007 »
Thanks, the image can be impoved a bit with oversampling which reduces the jaggies and smooths the image by changing line 1443 from

raytrace_world(world,display,0)

to

raytrace_world(world,display,1)

but be prepared for a long wait as it's really really slow.

docgen

  • Guest
Re: Realtime Ray Tracing in Freebasic
« Reply #55 on: March 28, 2007 »

Hi!

That's really cool!

Greetings
stef

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Realtime Ray Tracing in Freebasic
« Reply #56 on: March 28, 2007 »
Welcome aboard stef :hi:
That was one hell of a render stonemonkey well worth waiting for.
These tracers are really well done thanks guys for sharing your code (not that I'm planning on taking on a tracer anytime soon) this thread will definately prove invaluable to somebody its become a one stop shop
  ;D well done for you efforts

Challenge Trophies Won:

Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #57 on: March 28, 2007 »
Great stuff Stonemonkey!  The chess board looks amazing, that would have taken some time to model mate.

..... pawn takes rounded cube.......

And I see you have reflections in your realtime code, that rocks, and has inspired me to get relfections up and running in mine. 

@Thygrion:  :telloff: Who do you think you are! ......;)  No probs here.  The more info/interest/demos/source that are posted here the better for everyone involved.  And that info about sub sampling was like a nerds wet dream :)  Thanks mate.
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Realtime Ray Tracing in Freebasic
« Reply #58 on: March 28, 2007 »
No problem :)

When I start adding CSG to mine I'll try to explain almost everything with my updates.

Here's a small update.

I fixed some....ah hell just read the readme :P

run rtrtmask.exe, and you can see how little tracing is actually done.

The point of all my tracers and why they're faster than alot of others is because I try to use a non struct/class/type approach and try to store everything on only arrays.

Probably at the end of this, when I reach my goals for a tracer (And BTW thanks a hell of alot Voltage for refreshing my RTRT memory and getting me going again :D ) I'll probably see to writing a tutorial on all of this.
« Last Edit: March 28, 2007 by Thygrion »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Realtime Ray Tracing in Freebasic
« Reply #59 on: March 29, 2007 »
Pretty impressive stuff.  How many recursions are allowed?

Jim
Challenge Trophies Won: