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 / Problem with point lights

Author
Message
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Mar 2013 01:09
I'm trying to use point lights, but for some reason I can only see the light with the id of 1.

If I comment out the one with id 1, I still don't see the light with id 2.

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Mar 2013 08:38
The built in shader only features 1 texture, 1 directional and 1 point light. You would have to write your own shader to support more. I think Cliff on the forum has made one. I might do it later today if I have time

My hovercraft is full of eels
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Mar 2013 09:40
3d is not finished, in tier1 i can't see a LightPoint.
And there is allways a ambient light present.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Mar 2013 10:01
In this post there is a download of a rar with an example project of a plane being lit by directional and pointlight, in tier 1. Includes code and all needed.

The shaderfiles can be opened in wordpad/notepad

http://forum.thegamecreators.com/?m=forum_view&t=201508&b=41&msg=2441096#m2441096

My hovercraft is full of eels
wargasmic
17
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Mar 2013 17:14
Thanks guys.

I'd really like to get into writing shaders. Are there tutorials on how to do this? Is there anything specific to agk or will general tutorials on writing shaders do?
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Mar 2013 17:44 Edited at: 17th Mar 2013 17:45
I can only recommend that entire thread my previous link is from. It has a lot of info from Paul, Cliff and others.

There are some AppGameKit specifics, yes.

I'll post the default shaders that are used if you don't set a shader on an object, you can start with those and try stuff out.

vertex shader: (open notepad and save as "something.vs" in the media folder of your project.



Fragment Shader: (AKA pixel shader, save as "something.ps" like the vertex shader.



Added to the top of the pixel shader is some code that hopefully will make the shader run smoother on a non-windows machine.

My hovercraft is full of eels

Login to post a reply

Server time is: 2024-05-07 15:00:06
Your offset time is: 2024-05-07 15:00:06