Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 14, 2019 8:30 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Ray Casting
PostPosted: Tue Aug 31, 2010 12:14 am 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
I've started up a blog where I'm going to try and share some of the projects I've done over the years. Hopefully, they will help other Rb coders.

My first post is a project exploring Raycasting. This is really a fun, clever algorithm that the original Wolfenstein 3D game used to fake a 3D environment. Perhaps it could be the start of a forum contributions game.

Also, added the port of Lesson 7 at NeHe, OpenGL.
http://bigdaddysurf.com/blog/?m=201008

And Lesson 8, textures with blending and simple transparency.
http://bigdaddysurf.com/blog/?p=26

--
Thomas C.

p.s. I'm really enjoying a new book, Beginning iPhone Games Development by Cabrera et. al. I've been porting the code to Rb - Nice OpenGL techniques. :wink:


Last edited by mauitom on Sat Sep 25, 2010 8:10 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Wed Sep 22, 2010 2:47 am 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
Just a little 'bump' for a new post on textured quads from the previously mentioned book. Thanks!

http://bigdaddysurf.com/blog/?p=49

--
Thomas C.


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Sat Sep 25, 2010 2:57 am 
Offline

Joined: Thu Oct 13, 2005 1:05 am
Posts: 101
THANKS !
Lesson 8, (spinning cube with texture) works good and good readable RB code :)

Question:
The FPS always shows 60 - same as my TFT refresh rate = 60 HZ.
How to disable VSYNC, i think thats the reason why fixed 60 FPS.
I ask to make changes (VSYNC off) to measure GPU speed, so FPS would rise much if GPU is fast enough (sure, also CPU does matter for > 60 FPS + VSYNC OFF).

Any chance to enable also multisampling * 2 (or *4 ) ?

I cant find the code which sets the window size.
If i change (make bigger ) the window1 with / high the window rises but only an part of the window is used to draw the cube, rest is unused and the cube not in the middle anymore.


Great work!


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Sat Sep 25, 2010 8:05 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
mitch_stgt wrote:
THANKS !
Lesson 8, (spinning cube with texture) works good and good readable RB code :)


Thank you.

Quote:
Question:
The FPS always shows 60 - same as my TFT refresh rate = 60 HZ.
How to disable VSYNC, i think thats the reason why fixed 60 FPS.
I ask to make changes (VSYNC off) to measure GPU speed, so FPS would rise much if GPU is fast enough (sure, also CPU does matter for > 60 FPS + VSYNC OFF).


I do not know, outside of my knowledge. It may just be the code I have for FPS.

Quote:
Any chance to enable also multisampling * 2 (or *4 ) ?


I do not know, it looks like lesson 46 at NeHe address this area. What about just add this in the InitGL method,
Const GL_MULTISAMPLE_ARB = &h809D
OpenGL.glEnable GL_MULTISAMPLE_ARB


Quote:
I cant find the code which sets the window size.
If i change (make bigger ) the window1 with / high the window rises but only an part of the window is used to draw the cube, rest is unused and the cube not in the middle anymore.


I haven't looked in to that in quite awhile, but ...... Two things, you need to do some math in the Resized() Event for the OpenGL.gluPerspective call in the InitGL method. And you need to readjust the OpenGL.glTranslatef parameters in the DrawScene method. The surface is hard to work with on resizing if I remember correctly.

Quote:
Great work!


Not so great, but thanks again ...

Are you on a Mac or PC?

_________________
Thomas C.
Real Studio Blog
http://bigdaddysurf.com/blog/

https://itunes.apple.com/us/app/maui-dragstrip-2013/id604516033?mt=8
https://itunes.apple.com/us/book/how-to-waterstart/id576214730?mt=11


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Sat Sep 25, 2010 8:36 pm 
Offline

Joined: Thu Oct 05, 2006 11:45 pm
Posts: 1002
Location: Sol:Planet Earth:North America:California
Hey thanks for sharing! I checked out the Raycasting demo and that is pretty cool. I had a lot of fun in the early days of these pseudo 3D type games, brings back good memories. Now everything is ultra realistic and ultra-bloody, which, IMHO, is just too much. I much prefer the older games with less detailed graphics and not so much violence.

One thing, the second RB project from the RayCasting demo (RayCaster200.rbp) is missing 15.gif for the FlatRedBrick Texture, so it won't run as is. I haven't tried it with an alternate yet, so just an FYI...

Thanks again.

_________________
This message made with 100% recycled pixels.
MacBook CD2.0/2GB/OSX 10.6.8 / REAL Studio 2010R1 Pro


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Sat Sep 25, 2010 9:36 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
paulg wrote:
One thing, the second RB project from the RayCasting demo (RayCaster200.rbp) is missing 15.gif for the FlatRedBrick Texture, so it won't run as is. I haven't tried it with an alternate yet, so just an FYI...


Ah, I was going to add the texturing of the walls, so that picture file is not needed for this demo anyway, no texturing. I'll try and get that straightened out, thanks for the post. :)

*fixed


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Fri Oct 01, 2010 11:36 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
Bump. Added Lesson 9 from the NeHe site ....
http://bigdaddysurf.com/blog/?p=57


Top
 Profile  
Reply with quote  
 Post subject: Re: Ray Casting
PostPosted: Tue Oct 05, 2010 1:43 am 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
Bump. Added Lesson 10.

http://bigdaddysurf.com/blog/?p=62


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group