Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
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  
  Lighting problems  (Read 1357 times)
0 Members and 1 Guest are viewing this topic.
Offline orz

Senior Newbie

Java games rock!

« Posted 2004-06-03 07:18:50 »

Okay, so now I'm starting to get comfortable with Xith3D, and I want to explore some of the more advanced functionality. Therefore, I decided to start playing around with lighting and shadows, and it turns out things don't work as I suspected them to.

First of all, the point lights are broken. With that, I mean that they seem to use the local coordinates of the light to calculate the lighting... This has already been mentioned in another thread,;action=display;num=1082736276;start=2#2 , but I thought I could overcome it by manually transforming the light's position doing something like:
Point3f location = new Point3f(0.0f,0.0f,0.0f);

However, it seems the local coordinates of the geometry is used as well. That means if you, like me, like to have your objects centered around 0,0,0 and then move them with transformgroups, you will get strange results when using a point light. This may of course be wrong, but at least it seemed to me like it was working this way.

Any plans of fixing this?

Second, I can't seem to figure out how to get the shadows working properly. I have made sure all my geometry is sealed (at least as far as I can tell), and then I choose a node and call setIsOccluder(true). This does create some sort of shadows effect, but not anything like I had in mind. Am I missing a step here?

Third, the directional light seems a bit strange as well. I have several cylinder shapes that I have rotated, translated and non-uniformly scaled. Their material has no specular or ambient component, only a diffuse one (red). When applying a directional light to the scene, the cylinders that are tallest have a darker color on the face closest to the observer. If my understanding of lighting is correct, the diffuse color should only depend on the incoming angle of the light, and since this is a directional light, that angle should be the same regardless of the size of the cylinders. See the attached screenshot:

Could there be a bug in the directional light code as well?

Any help to clear these things up would be highly appreciated.

Best regards,
Offline orz

Senior Newbie

Java games rock!

« Reply #1 - Posted 2004-06-08 13:54:46 »


Surely someone must have experienced similar problems?

Or is the problem in my code, not in xith?

Offline Yuri Vl. Gushchin

Senior Devvie

Speak Java!

« Reply #2 - Posted 2004-06-13 09:39:21 »


Can you please make a simple test case [for lighting problems & directional light)]? Create an issue in the Issuezilla and I will try to play around this.


Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  

EgonOlsen (38 views)
2018-06-10 19:43:48

EgonOlsen (20 views)
2018-06-10 19:43:44

EgonOlsen (40 views)
2018-06-10 19:43:20

DesertCoockie (187 views)
2018-05-13 18:23:11

nelsongames (122 views)
2018-04-24 18:15:36

nelsongames (121 views)
2018-04-24 18:14:32

ivj94 (861 views)
2018-03-24 14:47:39

ivj94 (122 views)
2018-03-24 14:46:31

ivj94 (758 views)
2018-03-24 14:43:53

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!