Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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  (Read 1710 times)
0 Members and 1 Guest are viewing this topic.
Offline nickdotjava

Junior Member




I have fallen to the dark side.  I'm using DX9


« Posted 2003-07-08 19:06:16 »

I'm having trouble with lighting effects on my models (from certain angles, it still looks 2d), and am trying to find some good tutorials and/or books on the subject.  Any recommendations?

Thanks.

-Nick

"Oh ya, that's trivial.  I should have it done in an hour."
Offline bmyers

Junior Member





« Reply #1 - Posted 2003-07-09 13:54:38 »

Hmmm... do you have some specifics?  Like what angles causes it to look 2D?  Or maybe even a (small!) screenshot?

Are you using Java3D or LWJGL or JOGL?

If you're using Java3D then I would suggest the Daniel Selman book on Java 3D Programming: http://www.manning.com/selman/

And it will all probably come down to how your normals are defined, and/or what Material you are using for your models.

Offline nickdotjava

Junior Member




I have fallen to the dark side.  I'm using DX9


« Reply #2 - Posted 2003-07-10 15:41:49 »

I'm using LWJGL

Well, after thinking about it, I realized that since I'm allowed an 8 light max, I won't have lighting on every ship, but a few huge lights that will light everything on the screen.  I figured a light really far away at the top back left of a cube, the top back right, and the top back middle.  This is an RTS, similar view to Starcraft, but with 3d graphics (2-d playing).

My normals are just cross products of two lines on the triangles.  Haven't added materials yet.  They'll probably be metal colored with some empty spaces where the player's color will show through.  I'm still trying to figure out how to make it so the color of the polygons only show through where the texture is transparent, and elsewhere, the colors don't blend.

-Nick

"Oh ya, that's trivial.  I should have it done in an hour."
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Member





« Reply #3 - Posted 2003-07-10 16:28:27 »

You probably should not use 8 lights at same time anyway - they cost a lot of GPU power. Maybe finding few lights closest to given object + 1 or two global lights for ambient light would be enough ? Anyway, to get really nice effects, you should think about some kind of per-pixel light - should be doable for ships in RTS game.

Artur Biesiadowski
Offline Breakfast

Senior Member




for great justice!


« Reply #4 - Posted 2003-07-11 08:45:11 »

I thought it was 8 lights on one thing at a time- is it 8 lights total?
Offline abies

Senior Member





« Reply #5 - Posted 2003-07-11 09:26:35 »

Yes, it is 8 lights at one time. But these 8 lights cost performance and unless you have very tessalated object (which will cost you even more performance, as light is computed per-vertex), they do not give a real difference in look of object.

Artur Biesiadowski
Offline nickdotjava

Junior Member




I have fallen to the dark side.  I'm using DX9


« Reply #6 - Posted 2003-07-11 17:38:26 »

hmmm....  Any good tutorials on doing per-pixel lighting with OpenGL?  I've found some stuff on the math behind it, which is nice and all, but there's no sample code.  And is it video card specific?  Because most said "with NVIDIA...".

Edit:

OT:  I just realized I'm a full member!  Woo hoo!

-Nick

"Oh ya, that's trivial.  I should have it done in an hour."
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.

xsi3rr4x (18 views)
2014-04-15 18:08:23

BurntPizza (15 views)
2014-04-15 03:46:01

UprightPath (28 views)
2014-04-14 17:39:50

UprightPath (13 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (54 views)
2014-04-10 04:04:31

BurntPizza (111 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!