Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (AndrewAMD, Grant, valino), 3,361 guests, and 13 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PP Normalmapping how to get the nearest lights?? #103566
12/22/06 17:38
12/22/06 17:38
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
Hi,
After playing a bit with Irrlicht&Ogre I´m thinking about coming back to GS and doing a real game-project.
So I`m interested in programming a "better" normalmapping shader for GS.
Well, I didn´t have any problems with doing the shader fx stuff, but i want every objekt to be lighten by, lets say, 8 lights (or 4 or what ever), and heres the problem, every object shuold be only affected by the 8 nearest lights. Is there a posibility to get those nearest lights?? All Gs shader i´ve seen affected every objekt the same way. In other engins (Irrlicht) there is a render callback, that is called everytime a model is rendered, and in this callback its possible to set the shader params. Is there something equvalent in GS??

thx in advance TGM

Re: PP Normalmapping how to get the nearest lights?? [Re: TheGameMaker] #103567
12/23/06 04:13
12/23/06 04:13
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
yes, you can pass parameters to shaders every frame with material's event function.
and welcome back

Re: PP Normalmapping how to get the nearest lights [Re: Lion_Ts] #103568
12/23/06 10:18
12/23/06 10:18
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
thx... After thinking about it, I came over, that it may be the best idea to get the bearest Lights every frame and save it in a skill, and pass those skills to the shader...
Or have i overlooked something??
TGM

Re: PP Normalmapping how to get the nearest lights [Re: TheGameMaker] #103569
12/23/06 11:48
12/23/06 11:48
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
There is no need for special functions like this, A6 does this automatically. Just use the arrays vecLightPos[8] and vecLightColor[8]

In Sphere i do use my own lighitng managemnt, but that is for other reasons.


Sphere Engine--the premier A6 graphics plugin.
Re: PP Normalmapping how to get the nearest lights [Re: Matt_Aufderheide] #103570
12/23/06 17:18
12/23/06 17:18
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
well.. stupid me... sry.. I know, rtfm...
but one question is still left:
are those "best lghts" calulated per entety/per poly/per vert??

Greetz TGM

Re: PP Normalmapping how to get the nearest lights [Re: TheGameMaker] #103571
12/23/06 20:07
12/23/06 20:07
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
I dont know how they work with the new light management system, but in the old system they were just the 8 active lights..


Sphere Engine--the premier A6 graphics plugin.
Re: PP Normalmapping how to get the nearest lights [Re: Matt_Aufderheide] #103572
12/23/06 20:24
12/23/06 20:24
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
8 lights all in all?? damished thats to less... I thought it were 8 per lighten surface/poly/object.
well... thats a problem..
so I have to code my own light managment, if I want around 50 lights, but each objekt just lit by 8 or even less.... right???

Re: PP Normalmapping how to get the nearest lights [Re: TheGameMaker] #103573
12/23/06 20:29
12/23/06 20:29
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline
Serious User
ChrisB  Offline
Serious User

Joined: Sep 2002
Posts: 1,604
Deutschland
With the new light managment you have 8 dyn. lights per model.
I don't know if the 6.5 release has the new light managment enabled.


www.Swollen-Eyeballs.org
ICQ:169213431
#3dgs@quakenet
Re: PP Normalmapping how to get the nearest lights [Re: ChrisB] #103574
12/23/06 20:34
12/23/06 20:34
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
well. that are good news... thx..
I gonna have a look if that is alredy in 6.5...

Re: PP Normalmapping how to get the nearest lights [Re: TheGameMaker] #103575
12/25/06 12:14
12/25/06 12:14
Joined: Apr 2004
Posts: 320
TheGameMaker Offline OP
Senior Member
TheGameMaker  Offline OP
Senior Member

Joined: Apr 2004
Posts: 320
no.. unfortunably it isn´t integrated till jet...
Thx for the tips!!
greetz TGM


Moderated by  Blink, Hummel, Superku 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1