Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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 2055 times)
0 Members and 1 Guest are viewing this topic.
Offline nickdotjava

Junior Devvie

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

« Posted 2003-07-08 17: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?



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

Junior Devvie

« Reply #1 - Posted 2003-07-09 11: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:

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 Devvie

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

« Reply #2 - Posted 2003-07-10 13: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.


"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 Devvie

« Reply #3 - Posted 2003-07-10 14: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 Devvie

for great justice!

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

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

Senior Devvie

« Reply #5 - Posted 2003-07-11 07: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 Devvie

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

« Reply #6 - Posted 2003-07-11 15: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...".


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


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

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

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

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

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

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

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

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

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

NoxInc (26 views)
2015-07-22 22:16:53

NoxInc (17 views)
2015-07-22 22:13:39
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!