Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ? Consuming light rays after striking a surface...  (Read 1179 times)
0 Members and 1 Guest are viewing this topic.
zahl2001
Guest
« Posted 2004-02-12 04:00:01 »

I'm trying to learn the very basics of lighting now, and I have a diffuse light in one corner of a room, a large sphere in the middle of the room, and another object in the corner oposite the light source.  The last object should not be getting any direct light from the source due to the sphere blocking it, but it seems to come right through and light the other object anyway.  Besides this, the scene looks fine.

Thanks, as usual Smiley
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #1 - Posted 2004-02-12 05:55:06 »

OpenGL doesn't light with "rays", hence there is no blocking. What actually happens is each vertex on the geometry is evaluated against the lights in the scene and coloured approriately.

Hence, both the sphehe and the other shape are being illuminated, because they are both evaluated.

Shadow Volumes (google for it) seems to one way people are getting round this (see Xith3D). I imagine there are several otherways.

zahl2001
Guest
« Reply #2 - Posted 2004-02-12 21:27:13 »

Anyone else have any suggestion on how this can be done?
Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #3 - Posted 2004-02-12 21:32:13 »

The two current favorite methods of doing shadows are shadow volumes and shadow mapping. Both of which eat fillrate like crazy and require various bits of voodoo to make them robust.

You can find detailed explainations all over the net, try starting with nVidia's website.

http://developer.nvidia.com/object/robust_shadow_volumes.html

http://developer.nvidia.com/object/hwshadowmap_paper.html

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
zahl2001
Guest
« Reply #4 - Posted 2004-02-12 23:03:46 »

Are shadows the only way to accomplish what my original question asks?  I'm playing Gothic 2 right now, and they don't have fancy shadows in the game, yet, when there is a lamp out in the street it doesn't shine through the walls of the shops and into the interiors.
Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #5 - Posted 2004-02-12 23:19:35 »

Judging from screenshots, Gothic uses lightmaps for most of its lighting. Theses are usually pre-calculated at level compile time which means you can do lighting based on ray casting or whatever fancy method you want (like radiosity). The downside being that they're totally static so neither the lights or the geometry can change.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (84 views)
2013-05-17 21:29:12

alaslipknot (92 views)
2013-05-16 21:24:48

gouessej (123 views)
2013-05-16 00:53:38

gouessej (117 views)
2013-05-16 00:17:58

theagentd (127 views)
2013-05-15 15:01:13

theagentd (114 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (187 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.102 seconds with 28 queries.