Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 2
Page 2 of 3 1 2 3
Re: Fully working diffuse specular point lighting!! [Re: Matt_Aufderheide] #20291
12/19/03 17:34
12/19/03 17:34
Joined: Dec 2003
Posts: 118
zero Offline
Member
zero  Offline
Member

Joined: Dec 2003
Posts: 118
could you pust a screen shotof it?

Re: Fully working diffuse specular point lighting!! [Re: zero] #20292
06/11/04 15:37
06/11/04 15:37
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
I've been wanting to get into per pixel lighting. Were you ever able to blend lights? I'll give the shader a try in a bit. Any luck on a dynamic version?


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Fully working diffuse specular point lighting!! [Re: Orange Brat] #20293
06/11/04 16:11
06/11/04 16:11
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
lights cant really be blended with the current shader system. The reason is complicated.. basically, you need to pass a light vector to the shader.. this light vector has to come from the entity that is being lit.. there are only enough skills for one vector. material skills cant cut it because those can only be passed into it once per frame.. not per object. Also.. the number of passes is increased by 2 eveytime you want to render a light. The real way to blend per pixel lights is to do it in a difernt way.. a way not currently available. The a6 shader system is nice..but you need more skills to pass more light vectors.. of course you can fake it by adding in set lvectors.. but that only works for lights that have fixed positions.. like a sunlight.. in my system you can in fact have a fixed sunlight/ambient light as well as the point lights.. but the point lights can never mix. Until JCL adds in more skills or directly passes in the wed lighting info(more than just VecLight) you can never make the Doom3 engine
remember though.. even in engines like Doom 3 you cant really mix more than a few lights or it becomes very slow..i would say 3 lights mixed is the realistic max..

Re: Fully working diffuse specular point lighting!! [Re: Matt_Aufderheide] #20294
06/11/04 16:32
06/11/04 16:32
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
So the way this works is that it only lights up what the action is assigned to? I got it to work(after commenting out the event line) and this seems to be the case. I guess in order for it to affect other objects it would need to be a dynamic light version? Still, it's a pretty cool effect and it even has a shadow with models(too bad it takes 12 fps off my framerate). Is there any way to affect the range on the object?


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Fully working diffuse specular point lighting!! [Re: Orange Brat] #20295
06/11/04 19:54
06/11/04 19:54
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
you can reverse the order of events if you want.. this code posted here is old.. the way i do it now is have the light itself scan .. and have everyhitng else just have my.enable_scan=on; then the event should be triggered for the light ., not the model.. just change all the me to you...
so therfore the light model action should be the following:
ACTION lightobject
{
my.event=light_data;
MY.passable=ON;
MY.shadow=OFF;
my.enable_detect=on;
my.invisible=on;
scan_lights();
}

and the function light_data() should be this:

function light_data()
{

if event_type==event_detect
{
your.skill41=float(my.x);
your.skill42=float(my.z);
your.skill43=float(my.y);
}
}

everyting that has the material and is near the light should be lit. to adjust the light radius simple enlarge the scan radius in the scan_lights() function

make sure all the models that have the material have my.scan_enable set to on.
if you are using this material.. you'd best make everyhitng in world use it.. that wasy all the lighting will be coherent

Re: Fully working diffuse specular point lighting! [Re: Matt_Aufderheide] #20296
06/11/04 20:43
06/11/04 20:43
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Quote:

lights cant really be blended with the current shader system. The reason is complicated.. basically, you need to pass a light vector to the shader.. this light vector has to come from the entity that is being lit.. there are only enough skills for one vector. material skills cant cut it because those can only be passed into it once per frame.. not per object. Also.. the number of passes is increased by 2 eveytime you want to render a light. The real way to blend per pixel lights is to do it in a difernt way.. a way not currently available. The a6 shader system is nice..but you need more skills to pass more light vectors.. of course you can fake it by adding in set lvectors.. but that only works for lights that have fixed positions.. like a sunlight.. in my system you can in fact have a fixed sunlight/ambient light as well as the point lights.. but the point lights can never mix. Until JCL adds in more skills or directly passes in the wed lighting info(more than just VecLight) you can never make the Doom3 engine
remember though.. even in engines like Doom 3 you cant really mix more than a few lights or it becomes very slow..i would say 3 lights mixed is the realistic max..




Actually, I have a dll that I used to pass a 2nd matrix to a shader. Since the only matrix we have is the mtlMatrix, if you need to do more then one transform, you cant.

I've considered extending this dll to make calls to SetVertexShaderConstant and SetPixelShaderConstant, and then in the render_view (i think) callback, you can pass my.skill# to them to setup your own values. Not quite as elegant as the way its done in shaders, but if you have to have it, it would work.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Fully working diffuse specular point lighting! [Re: qwerty823] #20297
06/11/04 21:31
06/11/04 21:31
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
i would welcome such a dll and i think other poeple would too who are trying to push a6 to the max..

Re: Fully working diffuse specular point lighting! [Re: Matt_Aufderheide] #20298
06/12/04 04:03
06/12/04 04:03
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
(Edit..wrong shader)

Last edited by Drew; 06/14/04 09:14.
Re: Fully working diffuse specular point lighting!! [Re: Matt_Aufderheide] #20299
06/12/04 05:01
06/12/04 05:01
Joined: Apr 2004
Posts: 83
DWilki Offline
Junior Member
DWilki  Offline
Junior Member

Joined: Apr 2004
Posts: 83
You mention a scan_lights() function. I'm really interested in learning from this example. Could you give me any hints as to how this works?

Re: Fully working diffuse specular point lighting! [Re: Drew] #20300
06/13/04 07:17
06/13/04 07:17
Joined: Aug 2003
Posts: 145
Beorn Offline
Member
Beorn  Offline
Member

Joined: Aug 2003
Posts: 145
Drew,
Is that Mattīs shader youīre using there?
It looks... uuuummm. Yeah, i want that too.

If it is: Great work Matt.
If it isnīt: Great work anyway Matt and what kinda stuff are you using Drew?

Page 2 of 3 1 2 3

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | 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