Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 3:44 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: OpenGL Class #4 - Lights (Open Source)
PostPosted: Sun Apr 25, 2010 10:21 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
And let there be light! Here is the fourth class I'm opening up to everyone. Keep in mind there can only be 8 (GL_LIGHT0 - GL_LIGHT7) lights turned on at a time, if you are using the class for a game make sure you have a good light management system :)

Download Version 1.0
Released: 4/25/2010

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #4 - Lights (Open Source)
PostPosted: Mon Apr 26, 2010 1:17 am 
Offline

Joined: Wed Mar 26, 2008 10:04 am
Posts: 60
Thanks again! You mentioned OpenGL does not do shadows. Any clue how to add them?

_________________
-----------------------------------------------------------------
Check out Alwaysbusy's Corner for more tips and tricks!

Click here to Image if you like my work


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #4 - Lights (Open Source)
PostPosted: Mon Apr 26, 2010 10:47 am 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
I've never done real-time shadows (yet) so there are only a couple directions I can point you towards.

First the most basic is to simply render the object a second time with all of the Y values set to 0 and textures disabled, this would give you the appearance of a shadow directly below you like you are standing in the sun at noon. Then there is ray tracing which is fairly advanced, information on that can be found at: http://en.wikipedia.org/wiki/Ray_tracing_(graphics)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #4 - Lights (Open Source)
PostPosted: Mon Apr 26, 2010 12:00 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
For shadows, it depends on the type of shadow algorithm you want to implement. The simplest I've seen (shadow mapping) can be found at http://www.paulsprojects.net/tutorials/smt/smt.html.

I'm trying to integrate it into my GL classes myself, and it's tough when you allow multiple textures. I may end up abandoning it in favor of using GLSL shaders, where I'm told it's much easier to implement.

_________________
Regards,

Jeff Quan
jeff@jcquan.com
http://www.jcquan.com/JQportfolio
My RBGL replacement classes: http://www.jcquan.com/REALbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #4 - Lights (Open Source)
PostPosted: Mon Apr 26, 2010 10:12 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
If you get something that renders shadows quick please let me know, I would love to have some place to start when I get to addressing shadows myself :)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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