Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Looking for help with point lighting for 3D

Author
Message
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 6th Dec 2013 14:40
I'm trying to get a point light working for a 3D level.

Here's my code:



Default shader, no directional light, one point light, all objects have lighting turned on.

How do I get to see the lighting?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Dec 2013 15:53
i thinks its because the 3d part is not finished...
the point light don't work as expected yet.
but the beta update for v2 comes this year.

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Dec 2013 16:19
I can't get it to work. I have even set the light to pulse (change radius) but there is no effect. My attempt is below for reference



Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Dec 2013 16:27
For lighting in AppGameKit, really the only worthwhile thing to do is grab a shader and try and work with that. The lighting is terrible in AppGameKit, it's not even worth trying to get working - make your own lighting system with a shader I say. I'm sure there's help around the forum for this - I know that Cliff.M and Paul Johnston and others have posted a lot of shader stuff.

I am the one who knocks...
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 6th Dec 2013 18:07 Edited at: 6th Dec 2013 18:08
With the default shader, you have to add the directional light. Just set it to 0,0,0.

Edit:

Or download the file in the first post and snatch the point light shader I made.

http://forum.thegamecreators.com/?m=forum_view&t=205814&b=48

My hovercraft is full of eels
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 6th Dec 2013 23:34
To add to what lilpissywilly said, I managed to get Rich's original code to work:



I removed bits that I didn't think were needed and increased the range of the light. I also changed the colour to white so it would show better. The original range of 5 wasn't big enough to reach the plains. I think I read somewhere that the intensity of the light drops off fairly rapidly with distance so you need to use a large range to get it to show.

one of these days I'll come up with a better signature
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 7th Dec 2013 00:07
Sweet. With the info from both of you, I've got it looking good now.

A combination of moving the point light above the ceiling and increasing the range to around 1200 looks pretty decent. I was hoping for a sharper edge to the falloff, but I'll take what I can get.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Dec 2013 02:13 Edited at: 7th Dec 2013 02:20
i think ClearLightDirectionals did not work.
(odd, without lights its still grey,maybe ambient?)

the same as "29 games" found with a mix of both:


AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670

Login to post a reply

Server time is: 2024-11-24 23:55:26
Your offset time is: 2024-11-24 23:55:26