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 / Multiple lights - shaders?

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 7th Mar 2014 20:32
I really could do with multiple lights and am using lilpissywilly's nice point light shader at the moment.

Did anyone manage to produce a multiple pointlight shader? I think Cliff was messing with multiple light points at some stage?

lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 7th Mar 2014 22:22
http://forum.thegamecreators.com/?m=forum_view&t=209559&b=41

There you go. Not courtesy of me or cliff for once

I have made a shader that allows up to 8 pointlights, but you can probably figure out how to add more lights to the shader provided in that thread

My hovercraft is full of eels
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 8th Mar 2014 16:56
I used it for Hover Car Race Challenge Accepted!

nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Mar 2014 23:51
Excellent! Will have a play.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 9th Mar 2014 14:22
I stoped my multiple lights shader as mobile devices gets extremely slow with only 2 lights even.

That's why I ended up with specific shaders on eat drink slay that only use a single light,a single fog, a single light map to get the illusion of more lights and ambience.

But this whas whe I started to learn shaders.

Maybe we all should have a go at some kind of default shader if anyone can check around some more.

I only know that the fastest method is to use functions for the lights and loops that only runs active lights for best performance.

But you still have to manually send this data to your shader thru agk.

light pos are they on screen etc.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jun 2014 02:45 Edited at: 11th Jun 2014 02:46
Cliff, I'm struggling with a shader problem you might be able to help with. I just want a texture, single point light, single directional light shader. I have this that Paul shared on your shader thread:
Pixel shader


Vertex shader


The problem is I get planes behind other planes showing through like this:

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jun 2014 02:46 Edited at: 11th Jun 2014 02:46
Here's a top view so you can see what's happening:

Attachments

Login to view attachments
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 11th Jun 2014 03:59
Bax, it seems to be a Depth writing order problem instead of shader problem no ?

If you disable the SetObjectShader() command ... is it doing the same thing or not ?

--------------
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jun 2014 09:14
I'll test but I doubt it. I wonder though if it is a problem with AppGameKit primitives...
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 11th Jun 2014 09:15
AGK V2 or V1 ?

--------------
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jun 2014 09:56
V2. Yes it happens without the shader. It looks like one side of a 2D plane object has the z buffer issue whereas the other doesn't. I think I'll make my own 1 sided plane object.

[/thread hijack]
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 11th Jun 2014 10:12
yes ... with OBJ loading, there is no problem. i never use AppGameKit primitives.

Good luck

--------------
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Jun 2014 11:33
Well it turns out it's not primitives it's a problem when using renderToImage...

If I render the scene using sync it looks fine. I'll post the bug. That stops this project in its tracks!
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 11th Jun 2014 18:14
Quote: "Well it turns out it's not primitives it's a problem when using renderToImage...

If I render the scene using sync it looks fine. I'll post the bug. That stops this project in its tracks! "

baxslash when it comes to AppGameKit we're fantastic at finding bugs renderToImage is very buggy. When alpha 3 had just been released I gave it a go and oh boy... If I remember correctly it's in dire need of extra parameters: A set of them to point to the part of the world to render and a set to dictate the size of the rendered image. Somehow they're combined at the moment Texture filtering gets weird with renderToImage() too... but an alpha is an alpha It's hard to complain this time.

Login to post a reply

Server time is: 2024-11-25 05:40:31
Your offset time is: 2024-11-25 05:40:31