Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (591)
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 801 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, http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1082736276;start=2#2 , but I thought I could overcome it by manually transforming the light's position doing something like:
1  
2  
3  
Point3f location = new Point3f(0.0f,0.0f,0.0f);
myWorldTransform.get(location);
plight.setLocation(location);


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,
Terje
Offline orz

Senior Newbie




Java games rock!


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

*bump*

Surely someone must have experienced similar problems?

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

Terje
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


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

Hi,

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

Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (34 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!