Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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 1624 times)
0 Members and 1 Guest are viewing this topic.
« Posted 2004-02-12 03: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

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2004-02-12 04: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.

« Reply #2 - Posted 2004-02-12 20:27:13 »

Anyone else have any suggestion on how this can be done?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #3 - Posted 2004-02-12 20: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.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
« Reply #4 - Posted 2004-02-12 22: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: 57
Projects: 11

Monkey for a head

« Reply #5 - Posted 2004-02-12 22: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.

[ - 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.

SHC (37 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (44 views)
2015-07-27 16:38:00

Riven (24 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (39 views)
2015-07-25 00:14:37

BurntPizza (48 views)
2015-07-24 22:06:39

BurntPizza (33 views)
2015-07-24 06:06:53

NoxInc (40 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
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!